22 ClassImp(TGuiBldHintsButton);
29 TGuiBldHintsButton::TGuiBldHintsButton(
const TGWindow* p, Int_t
id) :
34 switch ((ELayoutHints)fWidgetId) {
52 void TGuiBldHintsButton::DoRedraw()
69 case (kLHintsTop | kLHintsLeft):
72 case (kLHintsTop | kLHintsRight):
75 case (kLHintsBottom | kLHintsLeft):
78 case (kLHintsBottom | kLHintsRight):
90 void TGuiBldHintsButton::DrawExpandX()
93 const int amplitude = TMath::Min(3, (
int)fHeight/3);
96 const TGResourcePool *pool = fClient->GetResourcePool();
97 const TGGC* gc = pool->GetWhiteGC();
99 if ((fState == kButtonDown) || (fState == kButtonEngaged)) {
103 for ( i = 1; i < (int)fWidth/3 - 2; ++i ) {
104 gVirtualX->DrawLine(fId, gc->GetGC(), i * dist, base - amplitude,
105 i * dist + dist/2, base + amplitude);
107 gc = IsEnabled() ? pool->GetSelectedBckgndGC() : pool->GetFrameShadowGC();
109 for ( i = 1; i < (int)fWidth/3 - 2; ++i ) {
110 gVirtualX->DrawLine(fId, gc->GetGC(), i * dist + dist/2, base + amplitude,
111 i * dist + dist, base - amplitude);
113 gVirtualX->DrawLine(fId, gc->GetGC(), 3, 6, 3, fHeight - 6);
114 gVirtualX->DrawLine(fId, gc->GetGC(), fWidth - 6, 6, fWidth - 6, fHeight - 6);
120 void TGuiBldHintsButton::DrawExpandY()
123 const int amplitude = TMath::Min(3, (
int)fWidth/3);
127 if ((fState == kButtonDown) || (fState == kButtonEngaged)) {
130 const TGResourcePool *pool = fClient->GetResourcePool();
131 const TGGC* gc = pool->GetWhiteGC();
133 for ( i = 1; i < (int)fHeight/3 - 2; ++i ) {
134 gVirtualX->DrawLine(fId, gc->GetGC(), base - amplitude, i * dist,
135 base + amplitude,i * dist + dist/2);
138 gc = IsEnabled() ? pool->GetSelectedBckgndGC() : pool->GetFrameShadowGC();
140 for ( i = 1; i < (int)fHeight/3 - 2; ++i ) {
141 gVirtualX->DrawLine(fId, gc->GetGC(), base + amplitude, i * dist + dist/2,
142 base - amplitude, i * dist + dist );
144 gVirtualX->DrawLine(fId, gc->GetGC(), 6, 3, fWidth - 6, 3);
145 gVirtualX->DrawLine(fId, gc->GetGC(), 6, fHeight - 6, fWidth - 6, fHeight - 6);
151 void TGuiBldHintsButton::DrawCenterX()
153 int base = fHeight/2;
157 const TGResourcePool *pool = fClient->GetResourcePool();
158 const TGGC* gc = pool->GetWhiteGC();
160 if ((fState == kButtonDown) || (fState == kButtonEngaged)) {
166 gVirtualX->DrawLine(fId, gc->GetGC(), x, base, x + fWidth - 12, base);
168 gc = IsEnabled() ? pool->GetSelectedBckgndGC() : pool->GetFrameShadowGC();
170 gVirtualX->DrawLine(fId, gc->GetGC(), x, base - 1, x + fWidth/2 - 12, base - 1);
171 gVirtualX->DrawLine(fId, gc->GetGC(), x + fWidth/2, base - 1, x + fWidth - 12, base - 1);
172 gVirtualX->DrawLine(fId, gc->GetGC(), x, base + 1, x + fWidth/2 - 12, base + 1);
173 gVirtualX->DrawLine(fId, gc->GetGC(), x + fWidth/2, base + 1, x + fWidth - 12, base + 1);
176 arrow[0].fX = arrow[01].fX = x + fWidth/2 - 12;
177 arrow[2].fX = x + fWidth/2 - 6;
178 arrow[2].fY = y + fHeight/2 - 6;
179 arrow[0].fY = arrow[2].fY - 4;
180 arrow[1].fY = arrow[2].fY + 4;
181 gVirtualX->FillPolygon(fId, gc->GetGC(), (Point_t*)&arrow, 3);
183 arrow[0].fX = arrow[01].fX = x + fWidth/2;
184 gVirtualX->FillPolygon(fId, gc->GetGC(), (Point_t*)&arrow, 3);
186 gVirtualX->DrawLine(fId, gc->GetGC(), x, y, x, y + fHeight - 12);
187 gVirtualX->DrawLine(fId, gc->GetGC(), x + fWidth - 12, y, x + fWidth - 12, y + fHeight - 12);
193 void TGuiBldHintsButton::DrawCenterY()
199 const TGResourcePool *pool = fClient->GetResourcePool();
200 const TGGC* gc = pool->GetWhiteGC();
202 if ((fState == kButtonDown) || (fState == kButtonEngaged)) {
208 gVirtualX->DrawLine(fId, gc->GetGC(), base, y, base, y + fHeight - 12);
210 gc = IsEnabled() ? pool->GetSelectedBckgndGC() : pool->GetFrameShadowGC();
212 gVirtualX->DrawLine(fId, gc->GetGC(), base - 1, y, base - 1, y + fHeight/2 - 12);
213 gVirtualX->DrawLine(fId, gc->GetGC(), base - 1, y + fHeight/2, base - 1, y + fHeight - 12);
214 gVirtualX->DrawLine(fId, gc->GetGC(), base + 1, y, base + 1, y + fHeight/2 - 12);
215 gVirtualX->DrawLine(fId, gc->GetGC(), base + 1, y + fHeight/2, base + 1, y + fHeight - 12);
218 arrow[0].fY = arrow[01].fY = y + fHeight/2 - 12;
219 arrow[2].fY = y + fHeight/2 - 6;
220 arrow[2].fX = x + fWidth/2 - 6;
221 arrow[0].fX = arrow[2].fX - 4;
222 arrow[1].fX = arrow[2].fX + 4;
223 gVirtualX->FillPolygon(fId, gc->GetGC(), (Point_t*)&arrow, 3);
225 arrow[0].fY = arrow[01].fY = y + fHeight/2;
226 gVirtualX->FillPolygon(fId, gc->GetGC(), (Point_t*)&arrow, 3);
227 gVirtualX->DrawLine(fId, gc->GetGC(), x, y, x + fWidth - 12, y);
228 gVirtualX->DrawLine(fId, gc->GetGC(), x, y + fHeight - 12, x + fWidth - 12, y + fHeight - 12);
234 void TGuiBldHintsButton::DrawTopLeft()
241 void TGuiBldHintsButton::DrawTopRight()
248 void TGuiBldHintsButton::DrawBottomLeft()
255 void TGuiBldHintsButton::DrawBottomRight()