Logo ROOT   6.10/09
Reference Guide
TGedMarkerSelect.h
Go to the documentation of this file.
1 // @(#)root/ged:$Id$
2 // Author: Marek Biskup, Ilka Antcheva 24/07/03
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 #ifndef ROOT_TGedMarkerSelect
13 #define ROOT_TGedMarkerSelect
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TGedMarkerPopup and TGedMarkerSelect. //
18 // //
19 // The TGedMarkerPopup is a popup containing all diferent styles of //
20 // markers. //
21 // //
22 // The TGedMarkerSelect widget is a button with marker drawn inside //
23 // and a little down arrow. When clicked the TGMarkerPopup. //
24 // //
25 // Selecting a marker in this widget will generate the event: //
26 // kC_MARKERSEL, kMAR_SELCHANGED, widget id, pixel. //
27 // //
28 // and the signal: //
29 // MarkerSelected(Style_t marker) //
30 // //
31 //////////////////////////////////////////////////////////////////////////
32 
33 #include "TGedPatternSelect.h"
34 
35 class TGToolTip;
36 class TGPicture;
37 
38 
39 class TGedMarkerPopup : public TGedPopup {
40 
41 protected:
42  Style_t fCurrentStyle; //currently selected style
43 
44 public:
45  TGedMarkerPopup(const TGWindow *p, const TGWindow *m, Style_t markerStyle);
46  virtual ~TGedMarkerPopup();
47 
48  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
49 
50  ClassDef(TGedMarkerPopup,0) //marker select popup
51 };
52 
53 
54 class TGedMarkerSelect : public TGedSelect {
55 
56 protected:
57  Style_t fMarkerStyle; //marker style
58  const TGPicture *fPicture; //image used for popup window
59 
60  virtual void DoRedraw();
61 
62 public:
63  TGedMarkerSelect(const TGWindow *p, Style_t markerStyle, Int_t id);
64  virtual ~TGedMarkerSelect() { if(fPicture) gClient->FreePicture(fPicture);}
65 
66  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
67  Style_t GetMarkerStyle() const { return fMarkerStyle; }
68  void SetMarkerStyle(Style_t pattern);
69  virtual void MarkerSelected(Style_t marker = 0) { Emit("MarkerSelected(Style_t)", marker ? marker : GetMarkerStyle()); } // *SIGNAL*
70  virtual void SavePrimitive(std::ostream &out, Option_t * = "");
71  virtual TGDimension GetDefaultSize() const { return TGDimension(38, 21); }
72 
73  ClassDef(TGedMarkerSelect,0) // Marker selection button
74 };
75 
76 #endif
short Style_t
Definition: RtypesCore.h:76
const TGPicture * fPicture
const char Option_t
Definition: RtypesCore.h:62
#define gClient
Definition: TGClient.h:166
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:412
#define ClassDef(name, id)
Definition: Rtypes.h:297
virtual void MarkerSelected(Style_t marker=0)
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by the marker popup window.
virtual ~TGedMarkerSelect()
virtual ~TGedMarkerPopup()
Destructor.
TMarker * m
Definition: textangle.C:8
m SetMarkerStyle(20)
Style_t GetMarkerStyle() const
long Long_t
Definition: RtypesCore.h:50
TGedMarkerPopup(const TGWindow *p, const TGWindow *m, Style_t markerStyle)
Create marker popup window.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a composite frame widget as a C++ statement(s) on output stream out.
Definition: TGFrame.cxx:2723
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
virtual TGDimension GetDefaultSize() const
default size