Public Member Functions | |
TestShutter (const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h) | |
~TestShutter () | |
void | AddShutterItem (const char *name, shutterData_t *data) |
void | CloseWindow () |
void | HandleButtons () |
Private Attributes | |
TGTransientFrame * | fMain |
TGShutter * | fShutter |
TGLayoutHints * | fLayout |
const TGPicture * | fDefaultPic |
Definition at line 366 of file guitest.C.
TestShutter::TestShutter | ( | const TGWindow * | p, | |
const TGWindow * | main, | |||
UInt_t | w, | |||
UInt_t | h | |||
) |
Definition at line 1801 of file guitest.C.
01803 { 01804 // Create transient frame containing a shutter widget. 01805 01806 fMain = new TGTransientFrame(p, main, w, h); 01807 fMain->Connect("CloseWindow()", "TestShutter", this, "CloseWindow()"); 01808 fMain->DontCallClose(); // to avoid double deletions. 01809 01810 // use hierarchical cleaning 01811 fMain->SetCleanup(kDeepCleanup); 01812 01813 fDefaultPic = gClient->GetPicture("folder_s.xpm"); 01814 fShutter = new TGShutter(fMain, kSunkenFrame); 01815 01816 AddShutterItem("Histograms", histo_data); 01817 AddShutterItem("Functions", function_data); 01818 AddShutterItem("Trees", tree_data); 01819 01820 fLayout = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY); 01821 fMain->AddFrame(fShutter, fLayout); 01822 01823 fMain->MapSubwindows(); 01824 fMain->Resize(80, 300); 01825 01826 // position relative to the parent's window 01827 fMain->CenterOnParent(); 01828 01829 fMain->SetWindowName("Shutter Test"); 01830 01831 fMain->MapWindow(); 01832 //gClient->WaitFor(fMain); 01833 }
TestShutter::~TestShutter | ( | ) |
Definition at line 1868 of file guitest.C.
01869 { 01870 // dtor 01871 01872 gClient->FreePicture(fDefaultPic); 01873 fMain->DeleteWindow(); // deletes fMain 01874 }
void TestShutter::AddShutterItem | ( | const char * | name, | |
shutterData_t * | data | |||
) |
Definition at line 1835 of file guitest.C.
Referenced by TestShutter().
01836 { 01837 TGShutterItem *item; 01838 TGCompositeFrame *container; 01839 TGButton *button; 01840 const TGPicture *buttonpic; 01841 static int id = 5001; 01842 01843 TGLayoutHints *l = new TGLayoutHints(kLHintsTop | kLHintsCenterX, 01844 5, 5, 5, 0); 01845 01846 item = new TGShutterItem(fShutter, new TGHotString(name), id++); 01847 container = (TGCompositeFrame *) item->GetContainer(); 01848 01849 for (int i=0; data[i].pixmap_name != 0; i++) { 01850 buttonpic = gClient->GetPicture(data[i].pixmap_name); 01851 if (!buttonpic) { 01852 printf("<TestShutter::AddShutterItem>: missing pixmap \"%s\", using default", 01853 data[i].pixmap_name); 01854 buttonpic = fDefaultPic; 01855 } 01856 01857 button = new TGPictureButton(container, buttonpic, data[i].id); 01858 01859 container->AddFrame(button, l); 01860 button->Connect("Clicked()", "TestShutter", this, "HandleButtons()"); 01861 button->SetToolTipText(data[i].tip_text); 01862 data[i].button = button; 01863 } 01864 01865 fShutter->AddItem(item); 01866 }
void TestShutter::CloseWindow | ( | ) |
void TestShutter::HandleButtons | ( | ) |
TGTransientFrame* TestShutter::fMain [private] |
TGShutter* TestShutter::fShutter [private] |
TGLayoutHints* TestShutter::fLayout [private] |
const TGPicture* TestShutter::fDefaultPic [private] |
Definition at line 374 of file guitest.C.
Referenced by AddShutterItem(), TestShutter(), and ~TestShutter().