//------------------------------------------------------------------------------ // gui_Form class -- // (C) Piero Giubilato 2007, Berkeley Lab -- //------------------------------------------------------------------------------ //______________________________________________________________________________ // {Trace} // [File name] "gui_Form.cpp" // [Author] "Piero Giubilato" // [Version] "0.1" // [Modified by] "Piero Giubilato" // [Last revision] "17 Jun 2008" // [Language] "C++" // [Compiler] "Visual C++ 8.x 9.x" // [Member of] "Cool SEAL" // [Project] "SEAL" // [Description] "Stand alone form class" // [Key documentation] // "Visual C++ Reference Help" // "Root reference guide" // {Trace} //______________________________________________________________________________ /* // Standard libraries #include // Root objects #include #include //#include //#include //#include "TGIcon.h" // Application components #include "gui_Form.h" #include "gui_Const.h" #include "global.h" // CINT Preprocessor class import definition ClassImp(gui_Form) //______________________________________________________________________________ gui_Form::gui_Form(const Char_t* caption, const UInt_t options) { // gui_Form // // Implements a stand-alone frame that can be populated with both gui_Objects // and root native objects. // `wMng` is a pointer to the window manager (usually gClient->GetRoot()). // `wPrn` is a pointer to the parent window (usually the calling window). // `caption` is the title of the windows. // 'options' is used to set the appearance and the behaviur of the message // window. It uses the usual AND constants aggregation style, the gui_Const // namespace contains all the form_CONST items you can pass with this // parameter. // Debug dbg_Print("gui_Form::gui_From: standard constructor", DBG_LVL_ZERO); // Define the main frame //frm_Main = new TGTransientFrame(wMng, wPrn, 320, 200); frm_Main = new TGTransientFrame(gClient->GetRoot(), window(), 320, 200); frm_Main->Connect("CloseWindow()", "gui_Form", this, "form_Close()"); //frm_Main->DontCallClose(); // to avoid double deletions. frm_Main->SetWindowName(caption); // Use hierarchical cleaning frm_Main->SetCleanup(kDeepCleanup); // Set up the form elements //frm_main_Label(options, message); //frm_main_Button(options); frm_Main->MapSubwindows(); // Makes windos fixed size (and delete min max win buttons) frm_Main->Resize(frm_Main->GetWidth(), 100); TGDimension size = frm_Main->GetSize(); frm_Main->SetWMSize(size.fWidth, size.fHeight); frm_Main->SetWMSizeHints(size.fWidth, size.fHeight, size.fWidth, size.fHeight, 0, 0); frm_Main->SetMWMHints(kMWMDecorAll | kMWMDecorResizeH | kMWMDecorMaximize | kMWMDecorMinimize | kMWMDecorMenu, kMWMFuncAll | kMWMFuncResize | kMWMFuncMaximize | kMWMFuncMinimize, kMWMInputModeless); } //______________________________________________________________________________ gui_Form::~gui_Form() { // Standard destructor dbg_Print("gui_Form::~gui_Form: destructor called", DBG_LVL_ZERO); // Delete the window //frm_Main->DeleteWindow(); // Deletes all the widgets } //______________________________________________________________________________ void gui_Form::form_Show() { // Show the window frm_Main->CenterOnParent(); frm_Main->MapWindow(); // Refresh frm_Main->MapSubwindows(); // Wait for close if modal gClient->WaitFor(frm_Main); } //______________________________________________________________________________ void gui_Form::form_Refresh() { // Refresh frm_Main->MapSubwindows(); } //______________________________________________________________________________ void gui_Form::form_Close() { // Close the window. dbg_Print("gui_Frame::form_Close: closing window", DBG_LVL_FLOW); // Close the main form (myself!) delete this; } */