Skip to content
Snippets Groups Projects
Commit 8ef3162a authored by Ilka Antcheva's avatar Ilka Antcheva
Browse files

Added a new check button for testing enabled/disabled split button state.

git-svn-id: http://root.cern.ch/svn/root/trunk@21982 27541ba8-7e3a-0410-8455-c3a389f83636
parent 7f18c6eb
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,7 @@ public:
void DoExit() ;
void DoSplit(Bool_t split) ;
void DoEnable(Bool_t on) ;
void HandleMenu(Int_t id) ;
ClassDef(SplitButtonTest, 0)
......@@ -93,6 +94,14 @@ SplitButtonTest::SplitButtonTest(const TGWindow *p, UInt_t w, UInt_t h)
// Add frames to their parent for layout.
fHL->AddFrame(fCButton, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY,
0, 10, 0, 0)) ;
TGCheckButton *fEButton = new TGCheckButton(fHL, new TGHotString("Enable"),
IDs.GetUnID());
fEButton->SetState(kButtonDown);
fEButton->Connect("Toggled(Bool_t)", "SplitButtonTest", this, "DoEnable(Bool_t)");
// Add frames to their parent for layout.
fHL->AddFrame(fEButton, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY,
0, 10, 0, 0)) ;
fHL->AddFrame(fMButton, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY));
fVL->AddFrame(fHL, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY)) ;
AddFrame(fVL, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY)) ;
......@@ -126,6 +135,14 @@ void SplitButtonTest::DoSplit(Bool_t split)
fMButton->SetSplit(split);
}
void SplitButtonTest::DoEnable(Bool_t on)
{
if (on)
fMButton->SetState(kButtonUp);
else
fMButton->SetState(kButtonDisabled);
}
void SplitButtonTest::HandleMenu(Int_t id)
{
// Activation of menu items in the popup menu are handled in a user
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment