Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGColorSelect.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Bertrand Bellenot + Fons Rademakers 22/08/02
3
4/*************************************************************************
5 * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11/**************************************************************************
12
13 This source is based on Xclass95, a Win95-looking GUI toolkit.
14 Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15
16 Xclass95 is free software; you can redistribute it and/or
17 modify it under the terms of the GNU Library General Public
18 License as published by the Free Software Foundation; either
19 version 2 of the License, or (at your option) any later version.
20
21**************************************************************************/
22
23//////////////////////////////////////////////////////////////////////////
24// //
25// TGColorFrame, TG16ColorSelector, TGColorPopup and TGColorSelect. //
26// //
27// The TGColorFrame is a small frame with border showing a specific //
28// color. //
29// //
30// The TG16ColorSelector is a composite frame with 16 TGColorFrames. //
31// //
32// The TGColorPopup is a popup containing a TG16ColorSelector and a //
33// "More..." button which popups up a TGColorDialog allowing custom //
34// color selection. //
35// //
36// The TGColorSelect widget is like a checkbutton but instead of the //
37// check mark there is color area with a little down arrow. When //
38// clicked on the arrow the TGColorPopup pops up. //
39// //
40// Selecting a color in this widget will generate the event: //
41// kC_COLORSEL, kCOL_SELCHANGED, widget id, pixel. //
42// and the signal: //
43// ColorSelected(Pixel_t color) //
44// //
45//////////////////////////////////////////////////////////////////////////
46
47#include "TGClient.h"
48#include "TGMsgBox.h" // for kMBOk
49#include "TGGC.h"
50#include "TGColorSelect.h"
51#include "TGColorDialog.h"
52#include "TGResourcePool.h"
53#include "RConfigure.h"
54#include "TG3DLine.h"
55#include "TColor.h"
56#include "TVirtualX.h"
57
58#include <iostream>
59
64
65
66////////////////////////////////////////////////////////////////////////////////
67/// TGColorFrame constructor.
68/// The TGColorFrame is a small frame with border showing a specific color.
69
71 TGFrame(p, 20, 20, kOwnBackground, color)
72{
73 SetBackgroundColor(color);
74
75 fPixel = fColor = color;
76
78 fMsgWindow = p;
80
81 fGrayGC = GetShadowGC()();
83}
84
85////////////////////////////////////////////////////////////////////////////////
86/// Handle button events in TGColorFrame.
87
89{
90 if (event->fType == kButtonPress) {
92 } else { // kButtonRelease
94 }
95
96 return kTRUE;
97}
98
99////////////////////////////////////////////////////////////////////////////////
100/// Draw TGColorFrame border.
101
103{
104 gVirtualX->DrawRectangle(fId, GetBckgndGC()(), 0, 0, fWidth - 1, fHeight - 1);
106}
107
108////////////////////////////////////////////////////////////////////////////////
109/// TG16ColorSelector constructor.
110/// The TG16ColorSelector is a composite frame with 16 TGColorFrames.
111
113 TGCompositeFrame(p, 10, 10)
114{
115 SetLayoutManager(new TGMatrixLayout(this, 4, 4, 1, 1));
116
117 fCe[0] = new TGColorFrame(this, TColor::Number2Pixel(0), 0);
118 fCe[1] = new TGColorFrame(this, TColor::Number2Pixel(1), 1);
119 fCe[2] = new TGColorFrame(this, TColor::Number2Pixel(2), 2);
120 fCe[3] = new TGColorFrame(this, TColor::Number2Pixel(3), 3);
121 fCe[4] = new TGColorFrame(this, TColor::Number2Pixel(4), 4);
122 fCe[5] = new TGColorFrame(this, TColor::Number2Pixel(5), 5);
123 fCe[6] = new TGColorFrame(this, TColor::Number2Pixel(6), 6);
124 fCe[7] = new TGColorFrame(this, TColor::Number2Pixel(7), 7);
125 fCe[8] = new TGColorFrame(this, TColor::Number2Pixel(8), 8);
126 fCe[9] = new TGColorFrame(this, TColor::Number2Pixel(9), 9);
127 fCe[10] = new TGColorFrame(this, TColor::Number2Pixel(30), 10);
128 fCe[11] = new TGColorFrame(this, TColor::Number2Pixel(38), 11);
129 fCe[12] = new TGColorFrame(this, TColor::Number2Pixel(41), 12);
130 fCe[13] = new TGColorFrame(this, TColor::Number2Pixel(42), 13);
131 fCe[14] = new TGColorFrame(this, TColor::Number2Pixel(50), 14);
132 fCe[15] = new TGColorFrame(this, TColor::Number2Pixel(51), 15);
133
134 for (Int_t i = 0; i < 16; i++)
136
137 fMsgWindow = p;
138 fActive = -1;
139
141}
142
143////////////////////////////////////////////////////////////////////////////////
144/// TG16ColorSelector destructor.
145
147{
148 Cleanup();
149}
150
151////////////////////////////////////////////////////////////////////////////////
152/// Set active color frame.
153
155{
156 if (fActive != newat) {
157 if ((fActive >= 0) && (fActive < 16)) {
159 }
160 fActive = newat;
161 if ((fActive >= 0) && (fActive < 16)) {
163 }
164 }
165}
166
167////////////////////////////////////////////////////////////////////////////////
168/// Process messages for TG16ColorSelector.
169
171{
172 switch (GET_MSG(msg)) {
173 case kC_COLORSEL:
174 switch (GET_SUBMSG(msg)) {
175 case kCOL_SELCHANGED:
176 switch (parm1) {
177 case kButton1:
180 parm1, parm2);
181 break;
182 }
183 break;
184
185 case kCOL_CLICK:
186 switch (parm1) {
187 case kButton1:
188 SetActive(parm2);
189 break;
190 }
191 break;
192 }
193 }
194
195 return kTRUE;
196}
197
198////////////////////////////////////////////////////////////////////////////////
199/// TGColorPopup constructor.
200/// The TGColorPopup is a popup containing a TG16ColorSelector and a "More..."
201/// button which popups up a TGColorDialog allowing custom color selection.
202
205 GetDefaultFrameBackground())
206{
207 fMsgWindow = m;
208 fCurrentColor = color;
209
211
212 wattr.fMask = kWAOverrideRedirect; // | kWASaveUnder ;
213 wattr.fOverrideRedirect = kTRUE;
214 //wattr.fSaveUnder = kTRUE;
215 gVirtualX->ChangeWindowAttributes(fId, &wattr);
216
218
219 fActive = -1;
221
222 TG16ColorSelector *cs = new TG16ColorSelector(this);
223 AddFrame(cs, new TGLayoutHints(kLHintsCenterX, 1, 1, 1, 1));
225 new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 2, 2, 2, 2));
226 TGTextButton *other = new TGTextButton(this, "Other...", 102);
227 other->SetToolTipText("Popups up Color Selector");
228 other->Associate(this);
229 AddFrame(other, new TGLayoutHints(kLHintsCenterX | kLHintsExpandX, 2, 2, 2, 2));
230
232
233 Resize(cs->GetDefaultWidth() + 6, cs->GetDefaultHeight() +
234 other->GetDefaultHeight());
236}
237
238////////////////////////////////////////////////////////////////////////////////
239/// TGColorPopup destructor.
240
242{
243 Cleanup();
244}
245
246////////////////////////////////////////////////////////////////////////////////
247/// Ungrab pointer and unmap window.
248
250{
251 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
252 UnmapWindow();
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Popup TGColorPopup at x,y position
257
259{
260 Int_t rx, ry;
261 UInt_t rw, rh;
262
263 // Parent is root window for the popup:
264 gVirtualX->GetWindowSize(fParent->GetId(), rx, ry, rw, rh);
265
266 if (gVirtualX->InheritsFrom("TGWin32")) {
267 if ((x > 0) && ((x + abs(rx) + (Int_t)fWidth) > (Int_t)rw))
268 x = rw - abs(rx) - fWidth;
269 if ((y > 0) && (y + abs(ry) + (Int_t)fHeight > (Int_t)rh))
270 y = rh - fHeight;
271 } else {
272 if (x < 0) x = 0;
273 if (x + fWidth > rw) x = rw - fWidth;
274 if (y < 0) y = 0;
275 if (y + fHeight > rh) y = rh - fHeight;
276 }
277
278 MoveResize(x, y, w, h);
280 Layout();
281 MapRaised();
282
286
288
289 gClient->WaitForUnmap(this);
290 EndPopup();
291
292 if (fLaunchDialog) {
293 Int_t retc;
294 ULong_t color = fCurrentColor;
295
296 new TGColorDialog(gClient->GetDefaultRoot(), this, &retc, &color);
297
298 if (retc == kMBOk) {
299 fCurrentColor = color;
301 -1, color);
302 }
303 }
304 DeleteWindow();
305}
306
307////////////////////////////////////////////////////////////////////////////////
308/// Handle mouse button events for TGColorPopup.
309
311{
312 if (event->fX < 0 || event->fX >= (Int_t) fWidth ||
313 event->fY < 0 || event->fY >= (Int_t) fHeight) {
314 if (event->fType == kButtonRelease)
315 UnmapWindow();
316 } else {
317 TGFrame *f = GetFrameFromPoint(event->fX, event->fY);
318 if (f && f != this) {
319 TranslateCoordinates(f, event->fX, event->fY, event->fX, event->fY);
320 f->HandleButton(event);
321 }
322 }
323 return kTRUE;
324}
325
326////////////////////////////////////////////////////////////////////////////////
327/// Process messages for TGColorPopup.
328
330{
331 switch (GET_MSG(msg)) {
332 case kC_COLORSEL:
333 switch (GET_SUBMSG(msg)) {
334 case kCOL_SELCHANGED:
336 parm1, parm2);
337 UnmapWindow();
338 break;
339
340 default:
341 break;
342 }
343 break;
344
345 case kC_COMMAND:
346 switch (GET_SUBMSG(msg)) {
347 case kCM_BUTTON:
348 if (parm1 == 102) {
350 UnmapWindow();
351 }
352 break;
353 }
354 break;
355 }
356 return kTRUE;
357}
358
359////////////////////////////////////////////////////////////////////////////////
360/// Emit a signal to see preview.
361
363{
364 if (fClient->IsEditable()) return;
365
366 fCurrentColor = color;
368}
369
370////////////////////////////////////////////////////////////////////////////////
371/// Emit a signal to see preview.
372
374{
375 if (fClient->IsEditable()) return;
376
377 TColor *tcolor = (TColor *)color;
378 fCurrentColor = tcolor->GetPixel();
380}
381
382////////////////////////////////////////////////////////////////////////////////
383/// TGColorSelect constructor.
384/// The TGColorSelect widget is like a checkbutton but instead of the check
385/// mark there is color area with a little down arrow.
386/// When clicked on the arrow the TGColorPopup pops up.
387
389 TGCheckButton(p, "", id)
390{
391 if (!p && fClient->IsEditable() && !color) {
392 color = TColor::Number2Pixel(6); // magenta
393 }
394
395 fColor = color;
396 fColorPopup = 0;
398
399 Enable();
403
405}
406
407////////////////////////////////////////////////////////////////////////////////
408/// TGColorSelect destructor.
409
411{
412 delete fColorPopup;
413}
414
415////////////////////////////////////////////////////////////////////////////////
416/// Process messages for TGColorSelect.
417
419{
420 switch (GET_MSG(msg)) {
421 case kC_COLORSEL:
422 switch (GET_SUBMSG(msg)) {
423 case kCOL_SELCHANGED:
424 {
425 if (parm1 == 0) {
426 SetAlphaColor((ULong_t)parm2);
427 parm1 = (Long_t)fWidgetId; // parm1 needs to pass the widget Id
429 parm1, parm2);
430 }
431 else {
432 SetColor(parm2);
433 parm1 = (Long_t)fWidgetId; // parm1 needs to pass the widget Id
435 parm1, parm2);
436 }
437 }
438 break;
439
440 default:
441 break;
442 }
443 break;
444 }
445 return kTRUE;
446}
447
448////////////////////////////////////////////////////////////////////////////////
449/// Handle button events for TGColorSelect.
450
452{
454 if (!IsEnabled()) return kTRUE;
455
456 if (event->fCode != kButton1) return kFALSE;
457
458 if ((event->fType == kButtonPress) && HasFocus())
459 WantFocus();
460
461 if (event->fType == kButtonPress) {
462 fPressPos.fX = fX;
463 fPressPos.fY = fY;
464
465 if (fState != kButtonDown) {
468 }
469 } else {
470 if (fState != kButtonUp) {
472
473 // case when it was dragged during guibuilding
474 if ((fPressPos.fX != fX) || (fPressPos.fY != fY)) {
475 return kFALSE;
476 }
477 Window_t wdummy;
478 Int_t ax, ay;
479
480 if (!fColorPopup)
481 fColorPopup = new TGColorPopup(gClient->GetDefaultRoot(), this, fColor);
482
483 gVirtualX->TranslateCoordinates(fId, gClient->GetDefaultRoot()->GetId(),
484 0, fHeight, ax, ay, wdummy);
485
486#ifdef R__HAS_COCOA
487 gVirtualX->SetWMTransientHint(fColorPopup->GetId(), GetId());
488#endif
491 fColorPopup = 0;
492 }
493 }
494 return kTRUE;
495}
496
497////////////////////////////////////////////////////////////////////////////////
498/// Set state of widget as enabled.
499
501{
502 if (on) {
504 } else {
506 }
507 fClient->NeedRedraw(this);
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Set state of widget as disabled.
512
514{
516 fClient->NeedRedraw(this);
517}
518
519////////////////////////////////////////////////////////////////////////////////
520/// Redraw TGColorSelect widget.
521
523{
524 Int_t x, y;
525 UInt_t w, h;
526
528
529 if (IsEnabled()) {
530
531 // color rectangle
532
533 x = fBorderWidth + 2;
534 y = fBorderWidth + 2; // 1;
535 w = 22;
536 h = fHeight - (fBorderWidth * 2) - 4; // -3; // 14
537
538 if (fState == kButtonDown) { ++x; ++y; }
539
540#ifdef R__HAS_COCOA
541 //Adjustment for Quartz 2D is required:
542 //first, I DO not try to fit filled rectangle into outline - this
543 //simply DOES NOT work (with retina/non-retina display, for example.
544 //First - fill rectable, then draw outline.
545 gVirtualX->FillRectangle(fId, fDrawGC(), x + 1, y + 1, w - 1, h - 1);
546 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x + 1, y + 1, w - 1, h - 1);
547#else
548 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x, y, w - 1, h - 1);
549 gVirtualX->FillRectangle(fId, fDrawGC(), x + 1, y + 1, w - 2, h - 2);
550#endif
551
552 // separator
553
554 x = fWidth - 6 - fBorderWidth - 6;
555 y = fBorderWidth + 1;
556 h = fHeight - fBorderWidth - 1; // actually y1
557
558 if (fState == kButtonDown) { ++x; ++y; }
559
560 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
561 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
562 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
563
564 // arrow
565
566 x = fWidth - 6 - fBorderWidth - 2;
567 y = (fHeight - 4) / 2 + 1;
568
569 if (fState == kButtonDown) { ++x; ++y; }
570
571 DrawTriangle(GetBlackGC()(), x, y);
572
573 } else {
574
575 // sunken rectangle
576
577 x = fBorderWidth + 2;
578 y = fBorderWidth + 2; // 1;
579 w = 22;
580 h = fHeight - (fBorderWidth * 2) - 4; // 3;
581
583
584 // separator
585
586 x = fWidth - 6 - fBorderWidth - 6;
587 y = fBorderWidth + 1;
588 h = fHeight - fBorderWidth - 1; // actually y1
589
590 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
591 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
592 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
593
594 // sunken arrow
595
596 x = fWidth - 6 - fBorderWidth - 2;
597 y = (fHeight - 4) / 2 + 1;
598
599 DrawTriangle(GetHilightGC()(), x + 1, y + 1);
601 }
602}
603
604////////////////////////////////////////////////////////////////////////////////
605/// Draw triangle (arrow) on which user can click to open TGColorPopup.
606
608{
609 Point_t points[3];
610
611#ifdef R__HAS_COCOA
612 //When it comes to tiny pixel-precise objects like this,
613 //Quartz is not really good: triangle is ugly and wrong.
614 //I have to adjust pixels manually.
615 points[0].fX = x;
616 points[0].fY = y;
617 points[1].fX = x + 6;
618 points[1].fY = y;
619 points[2].fX = x + 3;
620 points[2].fY = y + 3;
621#else
622 points[0].fX = x;
623 points[0].fY = y;
624 points[1].fX = x + 5;
625 points[1].fY = y;
626 points[2].fX = x + 2;
627 points[2].fY = y + 3;
628#endif
629
630 gVirtualX->FillPolygon(fId, gc, points, 3);
631}
632
633////////////////////////////////////////////////////////////////////////////////
634/// Set color.
635
637{
638 fColor = color;
639 fDrawGC.SetForeground(color);
640 gClient->NeedRedraw(this);
641 if (emit)
642 ColorSelected(fColor); // emit a signal
643}
644
645////////////////////////////////////////////////////////////////////////////////
646/// Set color.
647
649{
650 if (emit) {
651 AlphaColorSelected(color); //emit opacity signal
652 }
653}
654
655
656////////////////////////////////////////////////////////////////////////////////
657/// Save a color select widget as a C++ statement(s) on output stream out
658
659void TGColorSelect::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
660{
661 char quote = '"';
662 static Int_t nn = 1;
663 TString cvar = TString::Format("ColPar%d",nn);
664
665 ULong_t color = GetColor();
666 const char *colorname = TColor::PixelAsHexString(color);
667 gClient->GetColorByName(colorname, color);
668
669 out << std::endl << " // color select widget" << std::endl;
670 out << " ULong_t " << cvar.Data() << ";" << std::endl;
671 out << " gClient->GetColorByName(" << quote << colorname << quote
672 << ", " << cvar.Data() << ");" << std::endl;
673
674 out <<" TGColorSelect *";
675 out << GetName() << " = new TGColorSelect(" << fParent->GetName()
676 << ", " << cvar.Data() << ", " << WidgetId() << ");" << std::endl;
677 nn++;
678
679 if (option && strstr(option, "keep_names"))
680 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
681
682 if (!IsEnabled()) {
683 out << " " << GetName() << "->Disable();" << std::endl;
684 }
685 out << std::endl;
686}
687
@ kButtonRelease
Definition GuiTypes.h:60
@ kButtonPress
Definition GuiTypes.h:60
const Mask_t kWAOverrideRedirect
Definition GuiTypes.h:149
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
@ kRaisedFrame
Definition GuiTypes.h:384
@ kSunkenFrame
Definition GuiTypes.h:383
@ kDoubleBorder
Definition GuiTypes.h:385
@ kOwnBackground
Definition GuiTypes.h:391
const Handle_t kNone
Definition GuiTypes.h:88
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:166
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ kButton1
Definition GuiTypes.h:214
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
const Bool_t kFALSE
Definition RtypesCore.h:92
unsigned long ULong_t
Definition RtypesCore.h:55
long Long_t
Definition RtypesCore.h:54
const Bool_t kTRUE
Definition RtypesCore.h:91
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:364
@ kButtonDown
Definition TGButton.h:54
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:166
@ kLHintsCenterY
Definition TGLayout.h:35
@ kLHintsCenterX
Definition TGLayout.h:32
@ kLHintsExpandX
Definition TGLayout.h:37
@ kMBOk
Definition TGMsgBox.h:40
@ kWidgetIsEnabled
Definition TGWidget.h:47
XFontStruct * id
Definition TGX11.cxx:109
#define gVirtualX
Definition TVirtualX.h:338
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Int_t GET_MSG(Long_t val)
@ kCOL_CLICK
@ kCOL_SELCHANGED
@ kC_COLORSEL
@ kC_COMMAND
@ kCM_BUTTON
Int_t GET_SUBMSG(Long_t val)
point * points
Definition X3DBuffer.c:22
The color creation and management class.
Definition TColor.h:19
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition TColor.cxx:2016
static const char * PixelAsHexString(ULong_t pixel)
Convert machine dependent pixel value (obtained via RGB2Pixel or via Number2Pixel() or via TColor::Ge...
Definition TColor.cxx:2109
ULong_t GetPixel() const
Return pixel value corresponding to this color.
Definition TColor.cxx:1437
void SetActive(Int_t newat)
Set active color frame.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for TG16ColorSelector.
TGColorFrame * fCe[16]
virtual ~TG16ColorSelector()
TG16ColorSelector destructor.
const TGWindow * fMsgWindow
TG16ColorSelector(const TG16ColorSelector &)=delete
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:398
EButtonState fState
Definition TGButton.h:75
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
EButtonState fPrevState
Definition TGButton.h:272
Bool_t IsEditable() const
Definition TGClient.h:98
const TGResourcePool * GetResourcePool() const
Definition TGClient.h:133
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:371
virtual Bool_t HandleButton(Event_t *event)
Handle button events in TGColorFrame.
TGColorFrame(const TGColorFrame &)=delete
GContext_t fGrayGC
const TGWindow * fMsgWindow
virtual void DrawBorder()
Draw TGColorFrame border.
void SetActive(Bool_t in)
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button events for TGColorPopup.
const TGWindow * fMsgWindow
virtual ~TGColorPopup()
TGColorPopup destructor.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for TGColorPopup.
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
Popup TGColorPopup at x,y position.
void EndPopup()
Ungrab pointer and unmap window.
void PreviewAlphaColor(ULong_t color)
Emit a signal to see preview.
TGColorPopup(const TGColorPopup &)=delete
Pixel_t fCurrentColor
void PreviewColor(Pixel_t color)
Emit a signal to see preview.
TGColorPopup * fColorPopup
virtual void AlphaColorSelected(ULong_t colptr=0)
virtual ~TGColorSelect()
TGColorSelect destructor.
TGColorSelect(const TGColorSelect &)=delete
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for TGColorSelect.
void SetColor(Pixel_t color, Bool_t emit=kTRUE)
Set color.
TGPosition fPressPos
void Enable(Bool_t on=kTRUE)
Set state of widget as enabled.
virtual void ColorSelected(Pixel_t color=0)
void SetAlphaColor(ULong_t color, Bool_t emit=kTRUE)
Set color.
void Disable()
Set state of widget as disabled.
virtual Bool_t HandleButton(Event_t *event)
Handle button events for TGColorSelect.
Pixel_t GetColor() const
void DrawTriangle(GContext_t gc, Int_t x, Int_t y)
Draw triangle (arrow) on which user can click to open TGColorPopup.
virtual void DoRedraw()
Redraw TGColorSelect widget.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a color select widget as a C++ statement(s) on output stream out.
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:985
virtual TGFrame * GetFrameFromPoint(Int_t x, Int_t y)
Get frame located at specified point.
Definition TGFrame.cxx:1293
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1102
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:348
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:952
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1242
virtual Bool_t TranslateCoordinates(TGFrame *child, Int_t x, Int_t y, Int_t &fx, Int_t &fy)
Translate coordinates to child frame.
Definition TGFrame.cxx:1317
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1149
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:350
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition TGFrame.cxx:1007
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:324
virtual void DoRedraw()
Redraw the frame.
Definition TGFrame.cxx:415
static const TGGC & GetBlackGC()
Get black graphics context.
Definition TGFrame.cxx:720
Int_t fX
Definition TGFrame.h:109
virtual void MapRaised()
map raised
Definition TGFrame.h:229
UInt_t fHeight
Definition TGFrame.h:112
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:215
virtual void Draw3dRectangle(UInt_t type, Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw 3D rectangle on the frame border.
Definition TGFrame.cxx:342
Int_t fBorderWidth
Definition TGFrame.h:117
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:740
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:297
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition TGFrame.cxx:630
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:261
Int_t fY
Definition TGFrame.h:110
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:750
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:590
UInt_t fWidth
Definition TGFrame.h:111
virtual Bool_t HandleButton(Event_t *)
Definition TGFrame.h:185
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition TGFrame.cxx:614
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition TGFrame.cxx:760
virtual void UnmapWindow()
unmap window
Definition TGFrame.h:230
void SetForeground(Pixel_t v)
Set foreground color.
Definition TGGC.cxx:277
TGClient * fClient
Definition TGObject.h:37
Handle_t GetId() const
Definition TGObject.h:47
Handle_t fId
Definition TGObject.h:36
const TGGC * GetFrameGC() const
Cursor_t GetGrabCursor() const
Int_t fWidgetId
Definition TGWidget.h:56
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:82
Bool_t HasFocus() const
Definition TGWidget.h:80
Int_t ClearFlags(Int_t flags)
Definition TGWidget.h:69
Int_t SetFlags(Int_t flags)
Definition TGWidget.h:68
const TGWindow * fMsgWindow
Definition TGWidget.h:58
Bool_t IsEnabled() const
Definition TGWidget.h:79
Int_t WidgetId() const
Definition TGWidget.h:78
Bool_t WantFocus() const
Definition TGWidget.h:81
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:335
const TGWindow * fParent
Definition TGWindow.h:36
@ kEditDisable
Definition TGWindow.h:58
UInt_t fEditDisabled
Definition TGWindow.h:40
Basic string class.
Definition TString.h:136
const char * Data() const
Definition TString.h:369
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2331
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:178
Int_t fX
Definition GuiTypes.h:178
UInt_t fCode
key or button code
Definition GuiTypes.h:180
Point structure (maps to the X11 XPoint structure)
Definition GuiTypes.h:356
Short_t fX
Definition GuiTypes.h:357
Attributes that can be used when creating or changing a window.
Definition GuiTypes.h:93
Bool_t fOverrideRedirect
boolean value for override-redirect
Definition GuiTypes.h:107
Mask_t fMask
bit mask specifying which fields are valid
Definition GuiTypes.h:110
auto * m
Definition textangle.C:8