13#ifndef ROOT_TGColorDialog
14#define ROOT_TGColorDialog
Handle_t Pixmap_t
Pixmap handle.
ULong_t Pixel_t
Pixel value.
#define ClassDefOverride(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
Draw the ROOT Color Wheel.
The color creation and management class.
A full featured color selection dialog.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages for the color selection dialog.
TGColorDialog & operator=(const TGColorDialog &)=delete
TGColorPalette * fPalette
color palette
TGTab * fTab
tab widget holding the color selectors
TGLabel * fColorInfo
color info
virtual void SetCurrentColor(Pixel_t col)
Change current color.
void DoPreview()
Slot method called when Preview button is clicked.
Int_t * fRetc
return code (kMBOk, kMBCancel)
TColorWheel * fColorWheel
color wheel
TGTextBuffer * fAlb
RGB/HLS associated buffers.
TGTextButton * fPreview
preview button;
Pixel_t fCurrentColor
currently selected color
Pixel_t * fRetColor
return color
TGColorPick * fColors
color pick widget
TGColorDialog(const TGColorDialog &)=delete
TColor * fRetTColor
return TColor, needed for changed alpha
TGColorPalette * GetPalette() const
void SetColorInfo(Int_t event, Int_t px, Int_t py, TObject *selected)
Set the color info in RGB and HLS parts.
TRootEmbeddedCanvas * fEcanvas
embedded canvas holding the color wheel
TGColorPalette * fCpalette
color palette
virtual void ColorSelected(Pixel_t)
Emit signal about selected color.
void CloseWindow() override
Called when window is closed via window manager.
TGTextEntry * fAle
RGB/HLS text entries.
TGFrame * fSample
color sample frame
virtual void AlphaColorSelected(ULongptr_t)
Emit signal about selected alpha and color.
Bool_t fWaitFor
call WaitFor method in constructor
Pixel_t fInitColor
initially set color
TGColorPalette * GetCustomPalette() const
void UpdateRGBentries(Pixel_t *c)
Update RGB text entries with RGB values of color c.
void UpdateHLSentries(Pixel_t *c)
Update HLS text entries with HLS values of color c.
TGFrame * fSampleOld
color sample frame
~TGColorDialog() override
TGColorDialog destructor.
void UpdateAlpha(Pixel_t *c)
Update Opacity text entry with alpha value of color c.
A widget showing an matrix of color cells.
void SetCellSize(Int_t w=20, Int_t h=17)
Set color cell size.
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Bool_t HandleButton(Event_t *event) override
Handle button events in color palette.
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion events in color palette.
void SetColors(Pixel_t colors[])
Set color entries in color samples.
void DoRedraw() override
Redraw color palette.
Int_t fRows
number of color cell rows
Pixel_t GetColorByIndex(Int_t ix) const
virtual void LostFocus()
Remove keyboard input.
Pixel_t GetCurrentColor() const
Return currently selected color value.
UInt_t fCh
color cell height
void SetCurrentCellColor(Pixel_t color)
Set current cell color.
Int_t fCols
number of color cell columns
UInt_t fCw
color cell width
void DrawFocusHilite(Int_t onoff)
Draw a highlight rectangle around cell obtaining focus.
Pixel_t * fPixels
pixel value of colors
TGGC fDrawGC
graphics context used for drawing
virtual void GotFocus()
Add keyboard input.
void SetColor(Int_t ix, Pixel_t color)
Set color at index ix of color entries.
Int_t fCy
y coordinate of currently selected color cell
TGColorPalette(const TGColorPalette &)=delete
~TGColorPalette() override
Destructor.
virtual void ColorSelected(Pixel_t col=0)
Bool_t HandleKey(Event_t *event) override
Handle keyboard events in color palette.
Int_t fCx
x coordinate of currently selected color cell
TGColorPalette & operator=(const TGColorPalette &)=delete
A widget which allows a color to be picked from HLS color space.
Bool_t HandleButton(Event_t *event) override
Handle mouse button events in color pick widget.
void SetLcursor(Int_t z)
Set lightness slider cursor position.
void DoRedraw() override
Redraw the color pick widget.
Int_t fCx
x position in hs colormap
~TGColorPick() override
TGColorPick destructor.
Pixmap_t fLimage
color lightness slider pixmap
Int_t fNColors
number of color samples
Pixmap_t fHSimage
hue / saturation colormap pixmap
void UpdateCurrentColor()
Assign the current cursor position as currently selected color.
Int_t fClick
mouse click location (kCLICK_NONE, kCLICK_HS, kCLICK_L)
void CreateImages()
Create colormap and color slider images.
void SetColor(Pixel_t color)
Position the slider cursor on right color position.
virtual void ColorSelected(Pixel_t col=0)
Pixel_t fCurrentColor
currently selected color value
Int_t fCz
position in lightness slider
void SetSliderColor()
Set slider colors.
void AllocColors()
Try to allocate first a palette of 64 colors.
Rectangle_t fColormapRect
hue / saturation colormap rectangle
void FreeColors()
Free allocated colors.
Pixel_t GetCurrentColor() const
void DrawHScursor(Int_t onoff)
Draw hue / saturation cursor.
void CreateDitheredImage(Pixmap_t image, Int_t which)
Create a dithered version of the color map and lightness images for display modes with reduced number...
void DrawLcursor(Int_t onoff)
Draw lightness slider cursor.
void InitImages()
Initialize color palette and slider images.
Rectangle_t fSliderRect
color lightness slider rectangle
void SetHScursor(Int_t x, Int_t y)
Set hue / saturation cursor position.
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion events in color pick widget.
Int_t fCy
y position in hs colormap
TGGC fCursorGC
color lightness slider cursor GC
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Encapsulate a graphics context used in the low level graphics.
This class handles GUI labels.
A tab widget contains a set of composite frames each with a little tab with a name (like a set of fol...
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
A TGTextEntry is a one line text input widget.
Defines transient windows that typically are used for dialogs windows.
ROOT GUI Window base class.
Mother of all ROOT objects.
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
This class creates a TGCanvas in which a TCanvas is created.
Rectangle structure (maps to the X11 XRectangle structure)