#include <bbtkWx.h>
Classes | |
class | BusyCursor |
Public Types | |
typedef boost::signals::trackable | SignalObserver |
typedef boost::signal< void()> | Signal_type |
typedef Signal_type::slot_function_type | Slot_function_type |
Static Public Member Functions | |
static void | ProcessPendingEvents () |
static void | SetTopWindow (wxWindow *) |
Sets the parent of all bbtk windows. | |
static wxWindow * | GetTopWindow () |
Returns the parent of all bbtk windows. | |
static void | IncNbWindowsAlive () |
static void | DecNbWindowsAlive () |
static int | GetNbWindowsAlive () |
static bool | IsSomeWindowAlive () |
static void | AddSignalObserver (Slot_function_type) |
Static Private Member Functions | |
static void | CreateWxAppIfNeeded () |
static void | DestroyWxAppIfNeeded () |
Definition at line 91 of file bbtkWx.h.
typedef boost::signal<void ()> bbtk::Wx::Signal_type |
typedef boost::signals::trackable bbtk::Wx::SignalObserver |
typedef Signal_type::slot_function_type bbtk::Wx::Slot_function_type |
void bbtk::Wx::AddSignalObserver | ( | Slot_function_type | f | ) | [static] |
Definition at line 141 of file bbtkWx.cxx.
References bbtk::mgWxSignal.
00142 { 00143 mgWxSignal.connect(f); 00144 }
void bbtk::Wx::CreateWxAppIfNeeded | ( | ) | [static, private] |
Definition at line 78 of file bbtkWx.cxx.
References bbtkDebugMessage, bbtkGlobalError, and bbtk::mgWxApp.
00079 { 00080 if (wxApp::GetInstance()==0) 00081 { 00082 if (mgWxApp != 0) 00083 { 00084 bbtkGlobalError("Wx::CreateWxAppIfNeeded() : INTERNAL ERROR ! (wxApp::GetInstance()==0) && (mgWxApp != 0)"); 00085 } 00086 bbtkDebugMessage("wx",1," --> Creating bbtk wxApp"<<std::endl); 00087 mgWxApp = new WxApp; 00088 wxApp::SetInstance(mgWxApp); 00089 wxInitialize(); 00090 } 00091 }
void bbtk::Wx::DecNbWindowsAlive | ( | ) | [static] |
Definition at line 174 of file bbtkWx.cxx.
References bbtkDebugMessage, bbtk::mgNbWindowsAlive, and bbtk::mgWxSignal.
Referenced by bbtk::WxDialog::OnCloseWindow(), bbtk::WxFrame::OnCloseWindow(), and bbtk::WxFrame::~WxFrame().
00175 { 00176 mgNbWindowsAlive--; 00177 bbtkDebugMessage("wx",2,"* Number of windows alive = "<<mgNbWindowsAlive 00178 <<std::endl); 00179 00180 // BBTKWXSIG 00181 mgWxSignal(); 00182 // \BBTKWXSIG 00183 }
void bbtk::Wx::DestroyWxAppIfNeeded | ( | ) | [static, private] |
Definition at line 95 of file bbtkWx.cxx.
References bbtk::mgWxApp.
00096 { 00097 if (mgWxApp!= 0) 00098 { 00099 // bbtkDebugMessage("wx",1," --> Destructing bbtk WxApp"<<std::endl); 00100 //delete mgWxApp; 00101 // mgWxApp = 0; 00102 // Uninit wx 00103 // wxUninitialize(); 00104 } 00105 }
int bbtk::Wx::GetNbWindowsAlive | ( | ) | [static] |
Definition at line 187 of file bbtkWx.cxx.
References bbtk::mgNbWindowsAlive.
00188 { 00189 return mgNbWindowsAlive; 00190 }
wxWindow * bbtk::Wx::GetTopWindow | ( | ) | [static] |
Returns the parent of all bbtk windows.
Definition at line 132 of file bbtkWx.cxx.
References bbtk::mgTopWindow.
Referenced by bbtk::WxBlackBox::bbCreateDialogWindow(), and bbtk::WxBlackBox::bbCreateFrameWindow().
00133 { 00134 return mgTopWindow; 00135 }
void bbtk::Wx::IncNbWindowsAlive | ( | ) | [static] |
Definition at line 162 of file bbtkWx.cxx.
References bbtkDebugMessage, bbtk::mgNbWindowsAlive, and bbtk::mgWxSignal.
Referenced by bbtk::WxDialog::WxDialog(), and bbtk::WxFrame::WxFrame().
00163 { 00164 mgNbWindowsAlive++; 00165 bbtkDebugMessage("wx",2,"* Number of windows alive = "<<mgNbWindowsAlive 00166 <<std::endl); 00167 // BBTKWXSIG 00168 mgWxSignal(); 00169 // \BBTKWXSIG 00170 }
bool bbtk::Wx::IsSomeWindowAlive | ( | ) | [static] |
Definition at line 194 of file bbtkWx.cxx.
References bbtk::mgNbWindowsAlive.
Referenced by bbtk::BlackBox::bbCanReact(), wxBBIApp::OnInit(), and bbtk::WxGUIConsole::OnWxSignal().
00195 { 00196 return (mgNbWindowsAlive!=0); 00197 }
void bbtk::Wx::ProcessPendingEvents | ( | ) | [static] |
Definition at line 110 of file bbtkWx.cxx.
Referenced by bbtk::Executer::Reset().
00111 { 00112 /* 00113 if (Wx::GetTopWindow() != 0) 00114 { 00115 Wx::GetTopWindow()->DestroyChildren(); 00116 } 00117 */ 00118 00119 /* 00120 wxApp* a = (wxApp*)wxApp::GetInstance(); 00121 if (a==0) return; 00122 00123 std::cout << "$$$$$$$$$$$$$$ PROCESS PENDING "<<std::endl; 00124 while (a->Pending()) 00125 a->Dispatch(); 00126 std::cout << "$$$$$$$$$$$$$$ PROCESS PENDING DONE"<<std::endl; 00127 */ 00128 }
void bbtk::Wx::SetTopWindow | ( | wxWindow * | w | ) | [static] |
Sets the parent of all bbtk windows.
Definition at line 150 of file bbtkWx.cxx.
References bbtkGlobalError, and bbtk::mgTopWindow.
Referenced by bbtk::WxGUIConsole::WxGUIConsole(), bbtk::WxGUIScriptingInterface::WxGUIScriptingInterface(), and bbtk::WxGUITextEditorWindow::WxGUITextEditorWindow().
00151 { 00152 if ( mgTopWindow ) 00153 { 00154 bbtkGlobalError("Wx::SetTopWindow : top window already set !"); 00155 } 00156 //mgTopWindow = w; 00157 }