-
Notifications
You must be signed in to change notification settings - Fork 3
/
vtkKWFrame.cxx
170 lines (142 loc) · 4.94 KB
/
vtkKWFrame.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*=========================================================================
Module: $RCSfile: vtkKWFrame.cxx,v $
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkKWFrame.h"
#include "vtkKWOptions.h"
#include "vtkObjectFactory.h"
//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkKWFrame);
vtkCxxRevisionMacro(vtkKWFrame, "$Revision: 1.34 $");
//----------------------------------------------------------------------------
void vtkKWFrame::CreateWidget()
{
// Call the superclass to set the appropriate flags then create manually
if (!vtkKWWidget::CreateSpecificTkWidget(this,
"frame", "-highlightthickness 0"))
{
vtkErrorMacro("Failed creating widget " << this->GetClassName());
return;
}
}
//----------------------------------------------------------------------------
void vtkKWFrame::GetBackgroundColor(double *r, double *g, double *b)
{
this->GetConfigurationOptionAsColor("-background", r, g, b);
}
//----------------------------------------------------------------------------
double* vtkKWFrame::GetBackgroundColor()
{
return this->GetConfigurationOptionAsColor("-background");
}
//----------------------------------------------------------------------------
void vtkKWFrame::SetBackgroundColor(double r, double g, double b)
{
this->SetConfigurationOptionAsColor("-background", r, g, b);
}
//----------------------------------------------------------------------------
void vtkKWFrame::SetHighlightThickness(int width)
{
this->SetConfigurationOptionAsInt("-highlightthickness", width);
}
//----------------------------------------------------------------------------
int vtkKWFrame::GetHighlightThickness()
{
return this->GetConfigurationOptionAsInt("-highlightthickness");
}
//----------------------------------------------------------------------------
void vtkKWFrame::SetBorderWidth(int width)
{
this->SetConfigurationOptionAsInt("-bd", width);
}
//----------------------------------------------------------------------------
int vtkKWFrame::GetBorderWidth()
{
return this->GetConfigurationOptionAsInt("-bd");
}
//----------------------------------------------------------------------------
void vtkKWFrame::SetRelief(int relief)
{
this->SetConfigurationOption(
"-relief", vtkKWOptions::GetReliefAsTkOptionValue(relief));
}
void vtkKWFrame::SetReliefToRaised()
{
this->SetRelief(vtkKWOptions::ReliefRaised);
};
void vtkKWFrame::SetReliefToSunken()
{
this->SetRelief(vtkKWOptions::ReliefSunken);
};
void vtkKWFrame::SetReliefToFlat()
{
this->SetRelief(vtkKWOptions::ReliefFlat);
};
void vtkKWFrame::SetReliefToRidge()
{
this->SetRelief(vtkKWOptions::ReliefRidge);
};
void vtkKWFrame::SetReliefToSolid()
{
this->SetRelief(vtkKWOptions::ReliefSolid);
};
void vtkKWFrame::SetReliefToGroove()
{
this->SetRelief(vtkKWOptions::ReliefGroove);
};
//----------------------------------------------------------------------------
int vtkKWFrame::GetRelief()
{
return vtkKWOptions::GetReliefFromTkOptionValue(
this->GetConfigurationOption("-relief"));
}
//----------------------------------------------------------------------------
void vtkKWFrame::SetPadX(int arg)
{
this->SetConfigurationOptionAsInt("-padx", arg);
}
//----------------------------------------------------------------------------
int vtkKWFrame::GetPadX()
{
return this->GetConfigurationOptionAsInt("-padx");
}
//----------------------------------------------------------------------------
void vtkKWFrame::SetPadY(int arg)
{
this->SetConfigurationOptionAsInt("-pady", arg);
}
//----------------------------------------------------------------------------
int vtkKWFrame::GetPadY()
{
return this->GetConfigurationOptionAsInt("-pady");
}
//----------------------------------------------------------------------------
void vtkKWFrame::SetWidth(int width)
{
this->SetConfigurationOptionAsInt("-width", width < 0 ? 0 : width);
}
//----------------------------------------------------------------------------
int vtkKWFrame::GetWidth()
{
return this->GetConfigurationOptionAsInt("-width");
}
//----------------------------------------------------------------------------
void vtkKWFrame::SetHeight(int height)
{
this->SetConfigurationOptionAsInt("-height", height < 0 ? 0 : height);
}
//----------------------------------------------------------------------------
int vtkKWFrame::GetHeight()
{
return this->GetConfigurationOptionAsInt("-height");
}
//----------------------------------------------------------------------------
void vtkKWFrame::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}