ROOT  6.06/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 #ifndef ROOT_TGedPatternSelect
34 #include "TGedPatternSelect.h"
35 #endif
36 
37 class TGToolTip;
38 class TGPicture;
39 
40 
41 class TGedMarkerPopup : public TGedPopup {
42 
43 protected:
44  Style_t fCurrentStyle; //currently selected style
45 
46 public:
47  TGedMarkerPopup(const TGWindow *p, const TGWindow *m, Style_t markerStyle);
48  virtual ~TGedMarkerPopup();
49 
50  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
51 
52  ClassDef(TGedMarkerPopup,0) //marker select popup
53 };
54 
55 
56 class TGedMarkerSelect : public TGedSelect {
57 
58 protected:
59  Style_t fMarkerStyle; //marker style
60  const TGPicture *fPicture; //image used for popup window
61 
62  virtual void DoRedraw();
63 
64 public:
65  TGedMarkerSelect(const TGWindow *p, Style_t markerStyle, Int_t id);
66  virtual ~TGedMarkerSelect() { if(fPicture) gClient->FreePicture(fPicture);}
67 
68  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
69  Style_t GetMarkerStyle() const { return fMarkerStyle; }
71  virtual void MarkerSelected(Style_t marker = 0) { Emit("MarkerSelected(Style_t)", marker ? marker : GetMarkerStyle()); } // *SIGNAL*
72  virtual void SavePrimitive(std::ostream &out, Option_t * = "");
73  virtual TGDimension GetDefaultSize() const { return TGDimension(38, 21); }
74 
75  ClassDef(TGedMarkerSelect,0) // Marker selection button
76 };
77 
78 #endif
virtual void DoRedraw()
Draw selected marker type as current one.
short Style_t
Definition: RtypesCore.h:76
const TGPicture * fPicture
const char Option_t
Definition: RtypesCore.h:62
void SetMarkerStyle(Style_t pattern)
Set marker.
#define gClient
Definition: TGClient.h:174
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGedMarkerSelect(const TGWindow *p, Style_t markerStyle, Int_t id)
Create and show marker popup window.
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void MarkerSelected(Style_t marker=0)
static const std::string pattern("pattern")
virtual TGDimension GetDefaultSize() const
default size
char * out
Definition: TBase64.cxx:29
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by the marker popup window.
void Emit(const char *signal)
Acitvate signal without args.
Definition: TQObject.cxx:559
virtual ~TGedMarkerSelect()
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages according to the user input.
virtual ~TGedMarkerPopup()
Destructor.
Style_t GetMarkerStyle() const
TMarker * m
Definition: textangle.C:8
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 *="")
Save the pattern select widget as a C++ statement(s) on output stream out.