00001 #include "GuiMainWindow.h"
00002
00003 #include "TApplication.h"
00004 #include <sigc++/object_slot.h>
00005
00006 GuiMainWindow::GuiMainWindow(int width, int height)
00007 : TGMainFrame(gClient->GetRoot(),(unsigned int)width,(unsigned int)height)
00008 {
00009 this->SetLayoutHints(kLHintsExpandX | kLHintsExpandY);
00010
00011 }
00012
00013 GuiMainWindow::~GuiMainWindow()
00014 {
00015 }
00016
00017 void GuiMainWindow::ShowAll()
00018 {
00019 this->LayoutChildren();
00020 this->MapSubwindows();
00021 this->Layout();
00022
00023 this->Resize(this->GetDefaultSize());
00024
00025 this->MapWindow();
00026 }
00027
00028 void GuiMainWindow::SetMinSize(int width, int height)
00029 {
00030 return;
00031 const unsigned int max = 20000;
00032
00033 if (width < 0) width = this->GetDefaultWidth();
00034 if (height < 0) height = this->GetDefaultHeight();
00035 this->SetWMSizeHints((unsigned int)width,(unsigned int)height,
00036 max,max,1U,1U);
00037 }
00038
00039 void GuiMainWindow::ConnectClose(bool delete_on_close)
00040 {
00041 if (delete_on_close)
00042 close_window.connect(SigC::slot(*this,&GuiMainWindow::KillMe));
00043 else
00044 close_window.connect(SigC::slot(*this,&GuiMainWindow::UnmapWindow));
00045 }
00046
00047 void GuiMainWindow::KillMe()
00048 {
00049 delete this;
00050 }
00051 void GuiMainWindow::CloseWindow()
00052 {
00053
00054 close_window();
00055 }