GuiToggledSubMenu Class Reference

#include <GuiMenuThings.h>

List of all members.

Public Member Functions

 GuiToggledSubMenu (Int_t state)
GuiMenuCreateMenu (GuiMenu *parent, const char *menuname)
GuiMenuItr AddItem (const char *name, Int_t value)
void CallBack (GuiMenu *menu, GuiMenu::GuiMenuList::iterator mit, Int_t value)
void Connect (SigC::Slot0< void > s)
void Connect (SigC::Slot1< void, Int_t > s)
void SetState (Int_t value)
Int_t GetState (void)
Int_t operator() (void)

Private Attributes

Int_t fState
SigC::Ptr< GuiMenufMenu
SigC::Signal0< void > fSig0
SigC::Signal1< void, Int_t > fSig1

Detailed Description

Definition at line 26 of file GuiMenuThings.h.


Constructor & Destructor Documentation

GuiToggledSubMenu::GuiToggledSubMenu ( Int_t  state  ) 

Definition at line 41 of file GuiMenuThings.cxx.

00041                                                   :
00042   fState(state),
00043   fMenu(0)
00044 {
00045 }


Member Function Documentation

GuiMenuItr GuiToggledSubMenu::AddItem ( const char *  name,
Int_t  value 
)

Definition at line 54 of file GuiMenuThings.cxx.

References CallBack(), fMenu, and fState.

Referenced by TridTransHistoPage::Init(), and TridHistoPage::Init().

00055 {
00056   GuiMenuItr mit = fMenu->Add(name);
00057   (*mit)->Connect(bind(bind(bind(slot_class(*this,&GuiToggledSubMenu::CallBack),
00058                                  value ) ,mit) , fMenu));
00059   fMenu->CheckEntry(mit, (value==fState));
00060   
00061   return mit;
00062 }

void GuiToggledSubMenu::CallBack ( GuiMenu menu,
GuiMenu::GuiMenuList::iterator  mit,
Int_t  value 
)

Definition at line 64 of file GuiMenuThings.cxx.

References GuiMenu::CheckEntry(), done(), fSig0, fSig1, fState, GuiMenu::GetMenuList(), and it.

Referenced by AddItem().

00067 {
00068   fState = value;
00069   // Set checkmarks appropriately.
00070   GuiMenu::GuiMenuList& mlist = menu->GetMenuList();
00071   GuiMenu::GuiMenuList::iterator it, done = mlist.end();
00072   for (it = mlist.begin(); it != done; ++it)
00073     menu->CheckEntry(it,false);
00074   menu->CheckEntry(mit,true);
00075   
00076   // Actually do the command.
00077   fSig0.emit(); 
00078   fSig1.emit(fState); 
00079 }

void GuiToggledSubMenu::Connect ( SigC::Slot1< void, Int_t >  s  )  [inline]

Definition at line 39 of file GuiMenuThings.h.

References fSig1.

00039 { fSig1.connect(s); };

void GuiToggledSubMenu::Connect ( SigC::Slot0< void >  s  )  [inline]

Definition at line 38 of file GuiMenuThings.h.

References fSig0.

Referenced by TridTransHistoPage::Init(), and TridHistoPage::Init().

00038 { fSig0.connect(s); };

GuiMenu * GuiToggledSubMenu::CreateMenu ( GuiMenu parent,
const char *  menuname 
)

Definition at line 47 of file GuiMenuThings.cxx.

References GuiMenu::Add(), and fMenu.

Referenced by TridTransHistoPage::Init(), and TridHistoPage::Init().

00048 {
00049   fMenu = manage(new GuiMenu);
00050   parent->Add(menuname,*fMenu);
00051   return fMenu.get();
00052 }

Int_t GuiToggledSubMenu::GetState ( void   )  [inline]

Definition at line 41 of file GuiMenuThings.h.

References fState.

00041 { return fState; };

Int_t GuiToggledSubMenu::operator() ( void   )  [inline]

Definition at line 42 of file GuiMenuThings.h.

References fState.

00042 { return fState; };

void GuiToggledSubMenu::SetState ( Int_t  value  )  [inline]

Definition at line 40 of file GuiMenuThings.h.

References fState.

Referenced by TridControl::ChangeColorMode(), and TridControl::ChangeTransMode().

00040 { fState = value; };


Member Data Documentation

SigC::Ptr<GuiMenu> GuiToggledSubMenu::fMenu [private]

Definition at line 29 of file GuiMenuThings.h.

Referenced by AddItem(), and CreateMenu().

SigC::Signal0<void> GuiToggledSubMenu::fSig0 [private]

Definition at line 30 of file GuiMenuThings.h.

Referenced by CallBack(), and Connect().

SigC::Signal1<void,Int_t> GuiToggledSubMenu::fSig1 [private]

Definition at line 31 of file GuiMenuThings.h.

Referenced by CallBack(), and Connect().

Int_t GuiToggledSubMenu::fState [private]

Definition at line 28 of file GuiMenuThings.h.

Referenced by AddItem(), CallBack(), GetState(), operator()(), and SetState().


The documentation for this class was generated from the following files:

Generated on 19 Jan 2018 for loon by  doxygen 1.6.1