library: libGui
#include "TGColorDialog.h"

TGColorPick


class description - source file - inheritance tree (.pdf)

class TGColorPick : public TGFrame, public TGWidget

Inheritance Chart:
TObject
<-
TGObject
<-
TGWindow
TQObject
<-
TGFrame
TGWidget
<-
TGColorPick

    protected:
void AllocColors() void CreateDitheredImage(Pixmap_t image, Int_t which) void CreateImages() virtual void DoRedraw() void DrawHScursor(Int_t onoff) void DrawLcursor(Int_t onoff) void FreeColors() void InitImages() void SetHScursor(Int_t x, Int_t y) void SetLcursor(Int_t z) void SetSliderColor() void UpdateCurrentColor() public:
TGColorPick(const TGWindow* p = 0, Int_t w = 1, Int_t h = 1, Int_t id = -1) TGColorPick(const TGColorPick&) virtual ~TGColorPick() static TClass* Class() virtual void ColorSelected(Pixel_t col = 0) Pixel_t GetCurrentColor() const virtual Bool_t HandleButton(Event_t* event) virtual Bool_t HandleMotion(Event_t* event) virtual TClass* IsA() const void SetColor(Pixel_t color) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
Int_t fColormap[64][3] colormap Pixel_t fPixel[64] pixel values protected:
Pixmap_t fHSimage hue / saturation colormap pixmap Pixmap_t fLimage color lightness slider pixmap Int_t fNColors number of color samples Int_t fClick mouse click location (kCLICK_NONE, kCLICK_HS, kCLICK_L) Int_t fCx x position in hs colormap Int_t fCy y position in hs colormap Int_t fCz position in lightness slider Pixel_t fCurrentColor currently selected color value Rectangle_t fColormapRect hue / saturation colormap rectangle Rectangle_t fSliderRect color lightness slider rectangle TGGC fCursorGC color lightness slider cursor GC

Class Description

                                                                      
 TGColorPalette, TGColorPick and TGColorDialog.                       
                                                                      
 The TGColorPalette is a widget showing an matrix of color cells. The 
 colors can be set and selected.                                      
                                                                      
 The TGColorPick is a widget which allows a color to be picked from   
 HLS space. It consists of two elements: a color map window from      
 where the user can select the hue and saturation level of a color,   
 and a slider to select color's lightness.                            
                                                                      
 Selecting a color in these two widgets will generate the event:      
 kC_COLORSEL, kCOL_CLICK, widget id, 0.                               
 and the signal:                                                      
 ColorSelected(Pixel_t color)                                         
                                                                      
 The TGColorDialog presents a full featured color selection dialog.   
 It uses 2 TGColorPalette's and the TGColorPick widgets.              
                                                                      


TGColorPick(const TGWindow *p, Int_t w, Int_t h, Int_t id) : TGFrame(p, w, h, kChildFrame), fCursorGC(GetBlackGC())
 TGColorPick constructor.
 TGColorPick is a widget which allows a color to be picked from HLS space.
 It consists of two elements: a color map window from where the user can
 select the hue and saturation level of a color, and a slider to select
 color's lightness.

~TGColorPick()
 TGColorPick destructor.

Bool_t HandleButton(Event_t *event)
 Handle mouse button events in color pick widget.

Bool_t HandleMotion(Event_t *event)
 Handle mouse motion events in color pick widget.

void CreateImages()
 Create colormap and color slider images.

void AllocColors()
 Try to allocate first a palette of 64 colors. Used by the dithered
 version of the color maps.

void FreeColors()
 Free allocated colors.

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 of colors. The Floyd-Steinberg error
 diffusion dithering algorithm is used.
 This routine is called in PseudoColor modes only.

void InitImages()
 Initialize color palette and slider images.

void SetSliderColor()
 Set slider colors.

void SetColor(ULong_t color)
 Position the slider cursor on right color position.

void UpdateCurrentColor()
 Assign the current cursor position as currently selected color.

void DoRedraw()
 Redraw the color pick widget.

void SetHScursor(Int_t x, Int_t y)
 Set hue / saturation cursor position.

void SetLcursor(Int_t z)
 Set lightness slider cursor position.

void DrawHScursor(Int_t onoff)
 Draw hue / saturation cursor

void DrawLcursor(Int_t onoff)
 Draw lightness slider cursor



Inline Functions


            Pixel_t GetCurrentColor() const
               void ColorSelected(Pixel_t col = 0)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)
        TGColorPick TGColorPick(const TGColorPick&)


Author: Bertrand Bellenot + Fons Rademakers 22/08/02
Last update: root/gui:$Name: $:$Id: TGColorDialog.cxx,v 1.20 2005/11/21 00:25:37 rdm Exp $
Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.