<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 2.6 完整的例子 現在是時候把所有的代碼放在一起了,通常,我們應該把頭文件和實現文件分開,但是對于這樣小的一個程序,就沒有這個必要了。 ``` // Name: minimal.cpp // Purpose: Minimal wxWidgets sample // Author: Julian Smart #include "wx/wx.h" // 定義應用程序類 class MyApp : public wxApp { public: // 這個函數將會在程序啟動的時候被調用 virtual bool OnInit(); }; // 定義主窗口類 class MyFrame : public wxFrame { public: // 主窗口類的構造函數 MyFrame(const wxString& title); // 事件處理函數 void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); private: // 聲明事件表 DECLARE_EVENT_TABLE() }; // 有了這一行就可以使用 MyApp& wxGetApp()了 DECLARE_APP(MyApp) // 告訴wxWidgets主應用程序是哪個類 IMPLEMENT_APP(MyApp) // 初始化程序 bool MyApp::OnInit() { // 創建主窗口 MyFrame *frame = new MyFrame(wxT("Minimal wxWidgets App")); // 顯示主窗口 frame->Show(true); // 開始事件處理循環 return true; } // MyFrame類的事件表 BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(wxID_ABOUT, MyFrame::OnAbout) EVT_MENU(wxID_EXIT, MyFrame::OnQuit) END_EVENT_TABLE() void MyFrame::OnAbout(wxCommandEvent& event) { wxString msg; msg.Printf(wxT("Hello and welcome to %s"), wxVERSION_STRING); wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this); } void MyFrame::OnQuit(wxCommandEvent& event) { // 釋放主窗口 Close(); } #include "mondrian.xpm" MyFrame::MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title) { // 設置窗口圖標 SetIcon(wxIcon(mondrian_xpm)); // 創建菜單條 wxMenu *fileMenu = new wxMenu; // 添加“關于”菜單項 wxMenu *helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"), wxT("Show about dialog")); fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // 將菜單項添加到菜單條中 wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(fileMenu, wxT("&File")); menuBar->Append(helpMenu, wxT("&Help")); // ...然后將菜單條放置在主窗口上 SetMenuBar(menuBar); // 創建一個狀態條來讓一切更有趣些。 CreateStatusBar(2); SetStatusText(wxT("Welcome to wxWidgets!")); } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看