Logo ROOT  
Reference Guide
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;
79  fActive = kFALSE;
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 
210  SetWindowAttributes_t wattr;
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));
224  AddFrame(new TGHorizontal3DLine(this),
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 
231  MapSubwindows();
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);
279  MapSubwindows();
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();
402  SetColor(fColor);
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 {
453  TGFrame::HandleButton(event);
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) {
466  fPrevState = fState;
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);
600  DrawTriangle(GetShadowGC()(), x, y);
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 
659 void 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 
TGButton::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:398
TGColorSelect::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a color select widget as a C++ statement(s) on output stream out.
Definition: TGColorSelect.cxx:659
Event_t::fType
EGEventType fType
Definition: GuiTypes.h:174
m
auto * m
Definition: textangle.C:8
GET_MSG
Int_t GET_MSG(Long_t val)
Definition: WidgetMessageTypes.h:112
TGFrame::fY
Int_t fY
Definition: TGFrame.h:111
TGColorPopup::~TGColorPopup
virtual ~TGColorPopup()
TGColorPopup destructor.
Definition: TGColorSelect.cxx:241
Event_t::fY
Int_t fY
Definition: GuiTypes.h:177
Event_t::fX
Int_t fX
Definition: GuiTypes.h:177
TGColorFrame
Definition: TGColorSelect.h:45
TGFrame::Draw3dRectangle
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
TGColorPopup::fActive
Int_t fActive
Definition: TGColorSelect.h:101
TGColorSelect::fColor
Pixel_t fColor
Definition: TGColorSelect.h:130
TGWindow
Definition: TGWindow.h:31
kLHintsCenterX
@ kLHintsCenterX
Definition: TGLayout.h:38
TGColorPopup::fLaunchDialog
Int_t fLaunchDialog
Definition: TGColorSelect.h:102
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1203
TGPosition::fY
Int_t fY
Definition: TGDimension.h:48
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGColorDialog.h
f
#define f(i)
Definition: RSha256.hxx:122
TGFrame::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:297
TG16ColorSelector
Definition: TGColorSelect.h:73
kC_COLORSEL
@ kC_COLORSEL
Definition: WidgetMessageTypes.h:83
TGHorizontal3DLine
Definition: TG3DLine.h:29
TGColorFrame::fActive
Bool_t fActive
Definition: TGColorSelect.h:56
kPointerMotionMask
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TGColorSelect::Disable
void Disable()
Set state of widget as disabled.
Definition: TGColorSelect.cxx:513
kButtonDown
@ kButtonDown
Definition: TGButton.h:60
TString::Data
const char * Data() const
Definition: TString.h:369
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
Point_t
Definition: GuiTypes.h:355
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGCompositeFrame::GetFrameFromPoint
virtual TGFrame * GetFrameFromPoint(Int_t x, Int_t y)
Get frame located at specified point.
Definition: TGFrame.cxx:1293
TColor::GetPixel
ULong_t GetPixel() const
Return pixel value corresponding to this color.
Definition: TColor.cxx:1434
TGFrame::fWidth
UInt_t fWidth
Definition: TGFrame.h:112
TGCompositeFrame::Cleanup
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:952
TG16ColorSelector::fCe
TGColorFrame * fCe[16]
Definition: TGColorSelect.h:78
TGFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:216
kButtonUp
@ kButtonUp
Definition: TGButton.h:59
TGWindow::kEditDisable
@ kEditDisable
Definition: TGWindow.h:58
TGColorSelect::GetColor
Pixel_t GetColor() const
Definition: TGColorSelect.h:153
TGColorPopup::PreviewColor
void PreviewColor(Pixel_t color)
Emit a signal to see preview.
Definition: TGColorSelect.cxx:362
TGTextButton
Definition: TGButton.h:142
TGClient::IsEditable
Bool_t IsEditable() const
Definition: TGClient.h:98
TGFrame::HandleButton
virtual Bool_t HandleButton(Event_t *)
Definition: TGFrame.h:186
TGColorSelect::TGColorSelect
TGColorSelect(const TGColorSelect &)
TGCompositeFrame::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1007
x
Double_t x[n]
Definition: legend1.C:17
kButton1
@ kButton1
Definition: GuiTypes.h:213
TColor.h
TGResourcePool::GetGrabCursor
Cursor_t GetGrabCursor() const
Definition: TGResourcePool.h:170
TVirtualX.h
TColor::PixelAsHexString
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:2106
TColor::Number2Pixel
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition: TColor.cxx:2013
TGClient::GetResourcePool
const TGResourcePool * GetResourcePool() const
Definition: TGClient.h:133
TGWidget::WantFocus
Bool_t WantFocus() const
Definition: TGWidget.h:83
TGColorFrame::fColor
Pixel_t fColor
Definition: TGColorSelect.h:58
TString::Format
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:2311
TGColorPopup::EndPopup
void EndPopup()
Ungrab pointer and unmap window.
Definition: TGColorSelect.cxx:249
TGFrame::GetBlackGC
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:720
TString
Definition: TString.h:136
TGFrame
Definition: TGFrame.h:105
kButtonPressMask
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
TGColorFrame::fPixel
Pixel_t fPixel
Definition: TGColorSelect.h:55
SetWindowAttributes_t::fMask
Mask_t fMask
Definition: GuiTypes.h:109
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:47
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
TGColorSelect::DrawTriangle
void DrawTriangle(GContext_t gc, Int_t x, Int_t y)
Draw triangle (arrow) on which user can click to open TGColorPopup.
Definition: TGColorSelect.cxx:607
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
bool
TG16ColorSelector::~TG16ColorSelector
virtual ~TG16ColorSelector()
TG16ColorSelector destructor.
Definition: TGColorSelect.cxx:146
TG16ColorSelector::fActive
Int_t fActive
Definition: TGColorSelect.h:76
TGColorSelect::~TGColorSelect
virtual ~TGColorSelect()
TGColorSelect destructor.
Definition: TGColorSelect.cxx:410
TGColorPopup::fCurrentColor
Pixel_t fCurrentColor
Definition: TGColorSelect.h:104
TGWidget::HasFocus
Bool_t HasFocus() const
Definition: TGWidget.h:82
id
XFontStruct * id
Definition: TGX11.cxx:109
TGColorSelect::Enable
void Enable(Bool_t on=kTRUE)
Set state of widget as enabled.
Definition: TGColorSelect.cxx:500
kCOL_SELCHANGED
@ kCOL_SELCHANGED
Definition: WidgetMessageTypes.h:85
GContext_t
Handle_t GContext_t
Definition: GuiTypes.h:37
gClient
#define gClient
Definition: TGClient.h:166
TGCheckButton
Definition: TGButton.h:264
TGFrame::AddInput
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:324
kNone
const Handle_t kNone
Definition: GuiTypes.h:87
TGFrame::GetHilightGC
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:740
TGFrame::DeleteWindow
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:261
TGColorFrame::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGColorSelect.h:54
TGMatrixLayout
Definition: TGLayout.h:242
TG16ColorSelector::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGColorSelect.h:77
TGColorSelect::DoRedraw
virtual void DoRedraw()
Redraw TGColorSelect widget.
Definition: TGColorSelect.cxx:522
TG3DLine.h
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGColorDialog
Definition: TGColorDialog.h:157
TGPosition::fX
Int_t fX
Definition: TGDimension.h:47
TG16ColorSelector::TG16ColorSelector
TG16ColorSelector(const TG16ColorSelector &)
kLHintsCenterY
@ kLHintsCenterY
Definition: TGLayout.h:41
TColor
Definition: TColor.h:19
h
#define h(i)
Definition: RSha256.hxx:124
TGWidget::WidgetId
Int_t WidgetId() const
Definition: TGWidget.h:80
TGWidget::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGWidget.h:60
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:317
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1149
SetWindowAttributes_t::fOverrideRedirect
Bool_t fOverrideRedirect
Definition: GuiTypes.h:106
TGColorFrame::TGColorFrame
TGColorFrame(const TGColorFrame &)
kCOL_CLICK
@ kCOL_CLICK
Definition: WidgetMessageTypes.h:84
TGWidget::Associate
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:590
TGGC.h
TGObject::fId
Handle_t fId
Definition: TGObject.h:36
TGCompositeFrame::TranslateCoordinates
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
Event_t::fCode
UInt_t fCode
Definition: GuiTypes.h:179
TGFrame::SendMessage
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:630
TGColorFrame::SetActive
void SetActive(Bool_t in)
Definition: TGColorSelect.h:71
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGColorSelect::ColorSelected
virtual void ColorSelected(Pixel_t color=0)
Definition: TGColorSelect.h:165
TGFrame::fBorderWidth
Int_t fBorderWidth
Definition: TGFrame.h:118
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:59
kWidgetIsEnabled
@ kWidgetIsEnabled
Definition: TGWidget.h:48
kCM_BUTTON
@ kCM_BUTTON
Definition: WidgetMessageTypes.h:42
Long_t
long Long_t
Definition: RtypesCore.h:54
kButtonReleaseMask
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
TGWidget::IsEnabled
Bool_t IsEnabled() const
Definition: TGWidget.h:81
kButtonRelease
@ kButtonRelease
Definition: GuiTypes.h:59
TGColorPopup::PreviewAlphaColor
void PreviewAlphaColor(ULong_t color)
Emit a signal to see preview.
Definition: TGColorSelect.cxx:373
TGLayoutHints
Definition: TGLayout.h:57
TGFrame::MapRaised
virtual void MapRaised()
map raised
Definition: TGFrame.h:230
Window_t
Handle_t Window_t
Definition: GuiTypes.h:28
y
Double_t y[n]
Definition: legend1.C:17
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TGColorPopup::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for TGColorPopup.
Definition: TGColorSelect.cxx:329
TGClient.h
TGFrame::GetBckgndGC
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:760
TGCompositeFrame::SetLayoutManager
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition: TGFrame.cxx:985
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
TGColorFrame::fGrayGC
GContext_t fGrayGC
Definition: TGColorSelect.h:57
unsigned int
TGCompositeFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:351
kMBOk
@ kMBOk
Definition: TGMsgBox.h:44
TGFrame::fX
Int_t fX
Definition: TGFrame.h:110
TGColorFrame::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle button events in TGColorFrame.
Definition: TGColorSelect.cxx:88
TGColorPopup::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGColorSelect.h:103
TGColorSelect::AlphaColorSelected
virtual void AlphaColorSelected(ULong_t colptr=0)
Definition: TGColorSelect.h:167
TGColorSelect::SetAlphaColor
void SetAlphaColor(ULong_t color, Bool_t emit=kTRUE)
Set color.
Definition: TGColorSelect.cxx:648
TGWidget::fWidgetId
Int_t fWidgetId
Definition: TGWidget.h:58
TGWidget::ClearFlags
Int_t ClearFlags(Int_t flags)
Definition: TGWidget.h:71
TGColorFrame::DrawBorder
virtual void DrawBorder()
Draw TGColorFrame border.
Definition: TGColorSelect.cxx:102
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:373
TGFrame::UnmapWindow
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
TGColorSelect::fColorPopup
TGColorPopup * fColorPopup
Definition: TGColorSelect.h:132
TGMsgBox.h
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
TGFrame::MoveResize
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
TGColorPopup
Definition: TGColorSelect.h:98
kC_COMMAND
@ kC_COMMAND
Definition: WidgetMessageTypes.h:39
points
point * points
Definition: X3DBuffer.c:22
TGGC::SetForeground
void SetForeground(Pixel_t v)
Set foreground color.
Definition: TGGC.cxx:277
TGColorSelect::fPressPos
TGPosition fPressPos
Definition: TGColorSelect.h:133
TGButton::fState
EButtonState fState
Definition: TGButton.h:75
Event_t
Definition: GuiTypes.h:173
GET_SUBMSG
Int_t GET_SUBMSG(Long_t val)
Definition: WidgetMessageTypes.h:113
TGColorSelect::SetColor
void SetColor(Pixel_t color, Bool_t emit=kTRUE)
Set color.
Definition: TGColorSelect.cxx:636
TGFrame::GetShadowGC
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:750
TGColorSelect
Definition: TGColorSelect.h:127
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:43
TGWidget::SetFlags
Int_t SetFlags(Int_t flags)
Definition: TGWidget.h:70
TGResourcePool.h
kStructureNotifyMask
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
TGColorSelect.h
TGFrame::fHeight
UInt_t fHeight
Definition: TGFrame.h:113
TGCompositeFrame::GetDefaultWidth
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:349
TGWindow::fEditDisabled
UInt_t fEditDisabled
Definition: TGWindow.h:40
kWAOverrideRedirect
const Mask_t kWAOverrideRedirect
Definition: GuiTypes.h:148
TG16ColorSelector::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for TG16ColorSelector.
Definition: TGColorSelect.cxx:170
TGCompositeFrame
Definition: TGFrame.h:324
TGCheckButton::fPrevState
EButtonState fPrevState
Definition: TGButton.h:272
TGColorSelect::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for TGColorSelect.
Definition: TGColorSelect.cxx:418
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1102
TGColorPopup::PlacePopup
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
Popup TGColorPopup at x,y position.
Definition: TGColorSelect.cxx:258
TGColorSelect::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle button events for TGColorSelect.
Definition: TGColorSelect.cxx:451
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1242
TGColorSelect::fDrawGC
TGGC fDrawGC
Definition: TGColorSelect.h:131
MK_MSG
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Definition: WidgetMessageTypes.h:110
TG16ColorSelector::SetActive
void SetActive(Int_t newat)
Set active color frame.
Definition: TGColorSelect.cxx:154
TGWindow::fParent
const TGWindow * fParent
Definition: TGWindow.h:36
TGColorPopup::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button events for TGColorPopup.
Definition: TGColorSelect.cxx:310
TGColorPopup::TGColorPopup
TGColorPopup(const TGColorPopup &)
int
SetWindowAttributes_t
Definition: GuiTypes.h:92
TGFrame::DoRedraw
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:415
TGResourcePool::GetFrameGC
const TGGC * GetFrameGC() const
Definition: TGResourcePool.h:143