core/vgui/impl/wx/vgui_wx.h
Go to the documentation of this file.
00001 // This is core/vgui/impl/wx/vgui_wx.h
00002 #ifndef vgui_wx_h_
00003 #define vgui_wx_h_
00004 //=========================================================================
00005 //:
00006 // \file
00007 // \brief  wxWidgets implementation of vgui_toolkit.
00008 // \author Miguel A. Figueroa-Villanueva (miguelfv)
00009 //
00010 // \verbatim
00011 //  Modifications
00012 //   03/19/2006 - File created. (miguelfv)
00013 // \endverbatim
00014 //=========================================================================
00015 
00016 #include <vgui/vgui_toolkit.h>
00017 class vgui_wx_window;
00018 
00019 //-------------------------------------------------------------------------
00020 //: wxWidgets implementation of vgui_toolkit.
00021 //
00022 // Provides functions for controlling the event loop and creating new
00023 // windows and dialogs.
00024 //-------------------------------------------------------------------------
00025 class vgui_wx : public vgui_toolkit
00026 {
00027 public:
00028   //: Singleton method instance.
00029   static vgui_wx* instance();
00030 
00031 private:
00032   //: Returns the name of the GUI toolkit ("wx").
00033   virtual vcl_string name() const;
00034 
00035   //: Constructor - default.
00036   vgui_wx();
00037 
00038   //: Destructor.
00039   virtual ~vgui_wx();
00040   
00041   //: Initialize the wxWidgets GUI framework.
00042   virtual void init(int&, char**);
00043 
00044   virtual void uninit();
00045 
00046   //: Run the event loop.
00047   virtual void run();
00048 
00049   //: Run the next event.
00050   virtual void run_one_event();
00051 
00052   //: Run until event queue is empty.
00053   virtual void run_till_idle();
00054 
00055   //: Clear all events from the queue.
00056   virtual void flush();
00057 
00058   //: Add an event to the queue.
00059   virtual void add_event(const vgui_event&);
00060 
00061   //: Quit the application.
00062   virtual void quit();
00063 
00064   //: Create a new window with a menubar.
00065   virtual vgui_window* produce_window(int width, int height,
00066                                       const vgui_menu& menubar,
00067                                       const char* title="vgui wx window");
00068 
00069   //: Create a new window.
00070   virtual vgui_window* produce_window(int width, int height,
00071                                       const char* title="vgui wx popup");
00072 
00073   //: Create a new dialog window.
00074   virtual vgui_dialog_impl* produce_dialog(const char* name);
00075 
00076   //: Handle to windows created that need deleting.
00077   vcl_vector<vgui_window*> windows_to_delete_;
00078 
00079   //: True if we are embedding vgui_adaptor into wxWidgets app.
00080   bool adaptor_embedded_;
00081 };
00082 
00083 #endif // vgui_wx_h_