Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGShutter.h
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 18/9/2000
3
4/*************************************************************************
5 * Copyright (C) 1995-2021, 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_TGShutter
13#define ROOT_TGShutter
14
15
16#include "TGFrame.h"
17#include "TGCanvas.h"
18#include "TGWidget.h"
19
20
21class TGButton;
22class TGCanvas;
23class TTimer;
24class TList;
25
26
27
28class TGShutterItem : public TGVerticalFrame, public TGWidget {
29
30friend class TGShutter;
31
32protected:
33 TGButton *fButton; ///< shutter item button
34 TGCanvas *fCanvas; ///< canvas of shutter item
35 TGFrame *fContainer; ///< container in canvas containing shutter items
36 TGLayoutHints *fL1, *fL2; ///< positioning hints
37
38private:
39 TGShutterItem(const TGShutterItem&) = delete;
41
42public:
43 TGShutterItem(const TGWindow *p = nullptr, TGHotString *s = nullptr, Int_t id = -1,
44 UInt_t options = 0);
45 virtual ~TGShutterItem();
46
47 TGButton *GetButton() const { return fButton; }
48 TGFrame *GetContainer() const { return fCanvas->GetContainer(); }
49 virtual void Selected() { Emit(" Selected()"); } //*SIGNAL*
50
51 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
52
53 ClassDef(TGShutterItem,0) // Shutter widget item
54};
55
56
57
59
60protected:
61 TTimer *fTimer; ///< Timer for animation
62 TGShutterItem *fSelectedItem; ///< Item currently open
63 TGShutterItem *fClosingItem; ///< Item closing down
64 TList *fTrash; ///< Items that need to be cleaned up
65 Int_t fHeightIncrement; ///< Height delta
66 Int_t fClosingHeight; ///< Closing items current height
67 Int_t fClosingHadScrollbar; ///< Closing item had a scroll bar
68 UInt_t fDefWidth; ///< Default width
69 UInt_t fDefHeight; ///< Default height
70
71private:
72 TGShutter(const TGShutter&) = delete;
73 TGShutter& operator=(const TGShutter&) = delete;
74
75public:
76 TGShutter(const TGWindow *p = nullptr, UInt_t options = kSunkenFrame);
77 virtual ~TGShutter();
78
79 virtual void AddItem(TGShutterItem *item);
80 virtual void RemoveItem(const char *name);
81 virtual TGShutterItem *AddPage(const char *item = "Page"); //*MENU*
82 virtual void RemovePage(); //*MENU*
83 virtual void RenamePage(const char *name); //*MENU*
84 virtual Bool_t HandleTimer(TTimer *t);
85 virtual void Layout();
88 TGShutterItem *GetItem(const char *name);
89 virtual void SetSelectedItem(TGShutterItem *item);
90 virtual void SetSelectedItem(const char *name);
91 virtual void EnableItem(const char *name, Bool_t on = kTRUE);
92
93 virtual TGDimension GetDefaultSize() const;
94 virtual void SetDefaultSize(UInt_t w, UInt_t h);
95
96 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
97
98 virtual Bool_t ProcessMessage(Longptr_t cmd, Longptr_t parm1, Longptr_t parm2);
99 virtual void Selected(TGShutterItem *item) { Emit(" Selected(TGShutterItem*)", item); } //*SIGNAL*
100
101 ClassDef(TGShutter,0) // Shutter widget
102};
103
104#endif
@ kSunkenFrame
Definition GuiTypes.h:383
#define h(i)
Definition RSha256.hxx:106
long Longptr_t
Definition RtypesCore.h:82
unsigned int UInt_t
Definition RtypesCore.h:46
bool Bool_t
Definition RtypesCore.h:63
const Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
A button abstract base class.
Definition TGButton.h:68
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
TGFrame * GetContainer() const
Definition TGCanvas.h:216
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
TGHotString is a string with a "hot" character underlined.
Definition TGString.h:42
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Frame layout manager.
Definition TGLayout.h:135
TGLayoutHints * fL2
positioning hints
Definition TGShutter.h:36
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a shutter item widget as a C++ statement(s) on output stream out.
TGFrame * fContainer
container in canvas containing shutter items
Definition TGShutter.h:35
virtual ~TGShutterItem()
Clan up shutter item.
TGCanvas * fCanvas
canvas of shutter item
Definition TGShutter.h:34
TGLayoutHints * fL1
Definition TGShutter.h:36
TGButton * GetButton() const
Definition TGShutter.h:47
TGShutterItem & operator=(const TGShutterItem &)=delete
virtual void Selected()
Definition TGShutter.h:49
TGButton * fButton
shutter item button
Definition TGShutter.h:33
TGShutterItem(const TGShutterItem &)=delete
TGFrame * GetContainer() const
Definition TGShutter.h:48
A shutter widget contains a set of shutter items that can be open and closed like a shutter.
Definition TGShutter.h:58
virtual void AddItem(TGShutterItem *item)
Add shutter item to shutter frame.
Definition TGShutter.cxx:73
virtual void RemovePage()
Remove selected page.
virtual void SetLayoutManager(TGLayoutManager *)
Set the layout manager for the composite frame.
Definition TGShutter.h:86
TGShutterItem * fClosingItem
Item closing down.
Definition TGShutter.h:63
TGShutter & operator=(const TGShutter &)=delete
TTimer * fTimer
Timer for animation.
Definition TGShutter.h:61
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a shutter widget as a C++ statement(s) on output stream out.
TGShutterItem * GetItem(const char *name)
returns a shutter item by name (name is hot string of shutter item)
virtual void Layout()
Layout shutter items.
virtual Bool_t HandleTimer(TTimer *t)
Shutter item animation.
UInt_t fDefHeight
Default height.
Definition TGShutter.h:69
TGShutterItem * fSelectedItem
Item currently open.
Definition TGShutter.h:62
virtual void EnableItem(const char *name, Bool_t on=kTRUE)
Disable/enbale shutter item.
virtual void SetSelectedItem(TGShutterItem *item)
Set item to be the currently open shutter item.
TGShutter(const TGShutter &)=delete
TList * fTrash
Items that need to be cleaned up.
Definition TGShutter.h:64
Int_t fHeightIncrement
Height delta.
Definition TGShutter.h:65
virtual void SetDefaultSize(UInt_t w, UInt_t h)
Set the default / minimal size of the widget.
Int_t fClosingHeight
Closing items current height.
Definition TGShutter.h:66
virtual TGDimension GetDefaultSize() const
Return the default / minimal size of the widget.
virtual void Selected(TGShutterItem *item)
Definition TGShutter.h:99
TGShutterItem * GetSelectedItem() const
Definition TGShutter.h:87
Int_t fClosingHadScrollbar
Closing item had a scroll bar.
Definition TGShutter.h:67
virtual TGShutterItem * AddPage(const char *item="Page")
Add new page (shutter item)
virtual ~TGShutter()
Cleanup shutter widget.
Definition TGShutter.cxx:59
virtual void RenamePage(const char *name)
Rename selected page.
virtual Bool_t ProcessMessage(Longptr_t cmd, Longptr_t parm1, Longptr_t parm2)
Handle shutter messages.
UInt_t fDefWidth
Default width.
Definition TGShutter.h:68
virtual void RemoveItem(const char *name)
Remove item from shutter.
Definition TGShutter.cxx:86
A composite frame that layout their children in vertical way.
Definition TGFrame.h:375
The widget base class.
Definition TGWidget.h:43
ROOT GUI Window base class.
Definition TGWindow.h:23
A doubly linked list.
Definition TList.h:38
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51