bbPackageBrowser.cxx
Go to the documentation of this file.00001 #ifdef _USE_WXWIDGETS_
00002
00003
00004
00005
00006
00007
00008 #include "bbtkInterpreter.h"
00009 #include "bbtkWxGUIHtmlBrowser.h"
00010 #include "bbtkWxGUIPackageBrowser2.h"
00011
00012
00013 #include "../../src/icons/cc_exit.xpm"
00014
00015 using namespace bbtk;
00016
00017 class WxGUIHelp : public wxFrame
00018
00019 {
00020 public:
00021 WxGUIHelp( wxWindow *parent, wxString title, wxSize size );
00022 ~WxGUIHelp();
00023 void OnButtonRun(wxCommandEvent& WXUNUSED(event));
00024 void OnButtonQuit(wxCommandEvent& WXUNUSED(event));
00025
00026
00027 WxGUIPackageBrowser2* mWxGUIPackageBrowser;
00028
00029 wxButton* mwxButtonQuit;
00030
00031
00032
00033
00034 DECLARE_EVENT_TABLE();
00035 };
00036
00037 enum
00038 {
00039 ID_Button_Run,
00040 ID_Button_Quit
00041 };
00042
00043 WxGUIHelp::WxGUIHelp( wxWindow *parent, wxString title, wxSize size )
00044 : wxFrame((wxFrame *)parent, -1, title, wxDefaultPosition, size)
00045
00046 {
00047 wxBoxSizer *helpsizer = new wxBoxSizer(wxVERTICAL);
00048
00049
00050 mWxGUIPackageBrowser = new WxGUIPackageBrowser2(this);
00051 helpsizer->Add (mWxGUIPackageBrowser,1, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5 );
00052
00053 wxBoxSizer *btnsizer = new wxBoxSizer(wxHORIZONTAL);
00054
00055
00056
00057
00058
00059 wxBitmap bmp_quit(cc_exit_xpm);
00060 mwxButtonQuit = new wxBitmapButton(this,ID_Button_Quit,bmp_quit);
00061 btnsizer->Add( mwxButtonQuit, 0, wxALL, 5 );
00062
00063 helpsizer->Add( btnsizer );
00064
00065
00066
00067
00068
00069
00070
00071
00072 SetSizer(helpsizer);
00073 SetAutoLayout(true);
00074 Layout();
00075
00076
00077 mWxGUIPackageBrowser->IncludeAll();
00078 }
00079
00080 WxGUIHelp::~WxGUIHelp() {}
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127 void WxGUIHelp::OnButtonQuit(wxCommandEvent& WXUNUSED(event))
00128 {
00129 Close();
00130 }
00131
00132
00133 BEGIN_EVENT_TABLE(WxGUIHelp, wxFrame)
00134
00135 EVT_BUTTON(ID_Button_Quit, WxGUIHelp::OnButtonQuit )
00136 END_EVENT_TABLE()
00137
00138
00139
00140
00141 class myApp : public wxApp
00142 {
00143 public:
00144 bool OnInit( );
00145 int OnExit() { return true; }
00146 };
00147
00148 IMPLEMENT_APP(myApp);
00149
00150
00151 bool myApp::OnInit( )
00152 {
00153 wxApp::OnInit();
00154 #ifdef __WXGTK__
00155
00156 setlocale(LC_NUMERIC, "C");
00157 #endif
00158 wxInitAllImageHandlers();
00159
00160
00161
00162 WxGUIPackageBrowser2Window* I =
00163 new WxGUIPackageBrowser2Window(0,_T("bbtk help"),wxSize(1000,800));
00164 SetTopWindow(I);
00165 I->Show(true);
00166 return true;
00167 }
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184 #else
00185
00186
00187
00188 int main(int argc, char* argv[])
00189 {
00190 return 0;
00191 }
00192
00193
00194 #endif //#ifdef _USE_WXWIDGETS_
00195
00196
00197