<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    天空是藍色的

    做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標文件 #gcc helloworld.o -o helloworld //編譯成可執行exe #helloworld //運行exe
    數據加載中……
    Minimal wxWidgets sample~~

    /////////////////////////////////////////////////////////////////////////////
    // Name:??????? minimal.cpp
    // Purpose:???? Minimal wxWidgets sample
    // Author:????? Julian Smart
    // Modified by:
    // Created:???? 04/01/98
    // RCS-ID:????? $Id: minimal.cpp,v 1.67 2005/02/20 16:14:03 JS Exp $
    // Copyright:?? (c) Julian Smart
    // Licence:???? wxWindows licence
    /////////////////////////////////////////////////////////////////////////////

    // ============================================================================
    // declarations
    // ============================================================================

    // ----------------------------------------------------------------------------
    // headers
    // ----------------------------------------------------------------------------

    // For compilers that support precompilation, includes "wx/wx.h".
    #include <string>
    #include <iostream>
    #include "wx/wxprec.h"

    #ifdef __BORLANDC__
    ??? #pragma hdrstop
    #endif

    // for all others, include the necessary headers (this file is usually all you
    // need because it includes almost all "standard" wxWidgets headers)
    #ifndef WX_PRECOMP
    ??? #include "wx/wx.h"
    #endif
    // ----------------------------------------------------------------------------
    // resources
    // ----------------------------------------------------------------------------

    // the application icon (under Windows and OS/2 it is in resources and even
    // though we could still include the XPM here it would be unused)
    #if !defined(__WXMSW__) && !defined(__WXPM__)
    ??? #include "sample.xpm"
    #endif

    // ----------------------------------------------------------------------------
    // private classes
    // ----------------------------------------------------------------------------

    // Define a new application type, each program should derive a class from wxApp
    class MyApp : public wxApp
    {
    public:
    ??? // override base class virtuals
    ??? // ----------------------------

    ??? // this one is called on application startup and is a good place for the app
    ??? // initialization (doing it here and not in the ctor allows to have an error
    ??? // return: if OnInit() returns false, the application terminates)
    ??? virtual bool OnInit();
    };

    // Define a new frame type: this is going to be our main frame
    class MyFrame : public wxFrame
    {
    public:
    ??? // ctor(s)
    ??? MyFrame(const wxString& title);
    ?wxButton *WxButton1;
    ??? wxTextCtrl *wxTextCtrl1;
    ??????? wxTextCtrl *wxTextCtrl2;
    ??? // event handlers (these functions should _not_ be virtual)
    ??? void OnQuit(wxCommandEvent& event);
    ??? void OnAbout(wxCommandEvent& event);
    void WxButton1Click(wxCommandEvent& event);
    private:
    ??? // any class wishing to process wxWidgets events must use this macro
    ??? DECLARE_EVENT_TABLE()
    };

    // ----------------------------------------------------------------------------
    // constants
    // ----------------------------------------------------------------------------

    // IDs for the controls and the menu commands
    enum
    {
    ?ID_WXBUTTON1 = 1001,
    ??? // menu items
    ???
    ??? Minimal_Quit = wxID_EXIT,

    ??? // it is important for the id corresponding to the "About" command to have
    ??? // this standard value as otherwise it won't be handled properly under Mac
    ??? // (where it is special and put into the "Apple" menu)
    ??? Minimal_About = wxID_ABOUT

    };

    // ----------------------------------------------------------------------------
    // event tables and other macros for wxWidgets
    // ----------------------------------------------------------------------------

    // the event tables connect the wxWidgets events with the functions (event
    // handlers) which process them. It can be also done at run-time, but for the
    // simple menu events like this the static method is much simpler.
    BEGIN_EVENT_TABLE(MyFrame, wxFrame)
    ??? EVT_MENU(Minimal_Quit,? MyFrame::OnQuit)
    ??? EVT_MENU(Minimal_About, MyFrame::OnAbout)
    ??? EVT_BUTTON(ID_WXBUTTON1,MyFrame::WxButton1Click)
    END_EVENT_TABLE()

    // Create a new application object: this macro will allow wxWidgets to create
    // the application object during program execution (it's better than using a
    // static object for many reasons) and also implements the accessor function
    // wxGetApp() which will return the reference of the right type (i.e. MyApp and
    // not wxApp)
    IMPLEMENT_APP(MyApp)

    // ============================================================================
    // implementation
    // ============================================================================

    // ----------------------------------------------------------------------------
    // the application class
    // ----------------------------------------------------------------------------

    // 'Main program' equivalent: the program execution "starts" here
    bool MyApp::OnInit()
    {
    ??? // create the main application window
    ??? MyFrame *frame = new MyFrame(_T("helloworld-test"));

    ??? // and show it (the frames, unlike simple controls, are not shown when
    ??? // created initially)
    ??? frame->Show(true);

    ??? // success: wxApp::OnRun() will be called which will enter the main message
    ??? // loop and the application will run. If we returned false here, the
    ??? // application would exit immediately.
    ??? return true;
    }

    // ----------------------------------------------------------------------------
    // main frame
    // ----------------------------------------------------------------------------

    // frame constructor
    MyFrame::MyFrame(const wxString& title)
    ?????? : wxFrame(NULL, wxID_ANY, title)
    {

    ??? // set the frame icon
    ??? SetIcon(wxICON(sample));

    #if wxUSE_MENUS
    ??? wxMenu *fileMenu = new wxMenu;
    ??? wxMenu *helpMenu = new wxMenu;
    ??? helpMenu->Append(Minimal_About, _T("&About...\tF1"), _T("Show about dialog"));

    ??? fileMenu->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));


    ??? wxMenuBar *menuBar = new wxMenuBar();
    ??? menuBar->Append(fileMenu, _T("&系統"));
    ??? menuBar->Append(helpMenu, _T("&幫助"));

    ??? // ... and attach this menu bar to the frame
    ??? SetMenuBar(menuBar);
    ??
    #endif // wxUSE_MENUS

    #if wxUSE_STATUSBAR
    ??? // create a status bar just for fun (by default with 1 pane only)
    ??? CreateStatusBar(2);
    ??? SetStatusText(_T("helloworld-test"));
    #endif // wxUSE_STATUSBAR
    ?wxPanel* p = new wxPanel(this, -1);
    ? ?wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
    ? ?
    ? ?
    /*? ? topsizer->Add(
    ??? new wxStaticText( p, wxID_ANY, _T("An explanation (wxALIGN_RIGHT).") ),
    ??? wxSizerFlags().Align(wxALIGN_RIGHT).Border(wxALL & ~wxBOTTOM, 5));


    ? topsizer->Add(
    ??? new wxTextCtrl( p, wxID_ANY, _T("My text (wxEXPAND)."), wxDefaultPosition, wxSize(100,60), wxTE_MULTILINE),
    ??? wxSizerFlags(1).Expand().Border(wxALL, 5));


    ? wxBoxSizer *statsizer = new wxStaticBoxSizer(
    ??? new wxStaticBox(p, wxID_ANY, _T("A wxStaticBoxSizer")), wxVERTICAL );
    ? statsizer->Add(
    ??? new wxStaticText(p, wxID_ANY, _T("And some TEXT inside it")),
    ??? wxSizerFlags().Center().Border(wxALL, 30));
    ? topsizer->Add(
    ??? statsizer,
    ??? wxSizerFlags(1).Expand().Border(wxALL, 10));*/
    ? ?
    ? ?
    ??? wxGridSizer *gridsizer = new wxGridSizer(2, 5, 5);
    ???
    ??? gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Label")),
    ?????????????????? wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));
    ?????????????????? wxTextCtrl1 = new wxTextCtrl(p, wxID_ANY, _T(""));
    ??? gridsizer->Add(wxTextCtrl1,
    ?????????????????? wxSizerFlags(1).Align(wxGROW | wxALIGN_CENTER_VERTICAL));
    ??? gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Another label")),
    ?????????????????? wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));
    ??????????????????
    ?????????????????? wxTextCtrl2 = new wxTextCtrl(p, wxID_ANY, _T(""));
    ??????????????????
    ??? gridsizer->Add(wxTextCtrl2,
    ?????????????????? wxSizerFlags(1).Align(wxGROW | wxALIGN_CENTER_VERTICAL));
    ??? gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Final label")),
    ?????????????????? wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));
    ??? gridsizer->Add(new wxTextCtrl(p, wxID_ANY, _T("")),
    ?????????????????? wxSizerFlags().Align(wxGROW | wxALIGN_CENTER_VERTICAL));
    ???? topsizer->Add(
    ??????? gridsizer,
    ??????? wxSizerFlags().Proportion(1).Expand().Border(wxALL, 10));
    ???????
    ???? wxBoxSizer *button_box = new wxBoxSizer( wxHORIZONTAL );
    ? button_box->Add(
    ???? new wxButton( p, wxID_ANY, _T("Two buttons in a box") ),
    ???? wxSizerFlags().Border(wxALL, 7));
    ????
    ?
    ? ?WxButton1 = new wxButton(p, ID_WXBUTTON1, _T("WxButton1"), wxPoint(142,184), wxSize(75,25), 0, wxDefaultValidator, wxT("WxButton1"));
    ?
    ?????? button_box->Add(WxButton1,? wxSizerFlags().Border(wxALL, 7));
    ? button_box->Add(
    ???? new wxButton( p, wxID_ANY, _T("(wxCENTER)") ),
    ???? wxSizerFlags().Border(wxALL, 7));

    ? topsizer->Add(button_box, wxSizerFlags().Center());

    ? p->SetSizer( topsizer );
    ?

    ? ??? topsizer->SetSizeHints( this );
    ???

    }


    // event handlers

    void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
    {
    ??? // true is to force the frame to close
    ??? Close(true);
    }

    void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
    {
    ??? wxString msg;
    ??? msg.Printf( _T("helloworld-test.\n")
    ??????????????? _T("helloworld-test"));
    ???????????????

    ??? wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this);
    }
    void MyFrame::WxButton1Click(wxCommandEvent&? WXUNUSED(event))
    {
    ?


    ?wxString n1 = wxTextCtrl1->GetValue();
    ?wxString n2 = wxTextCtrl1->GetValue();
    ?std::string nx = (std::string)n1;
    ?std::cout << nx <<std::endl;
    ?wxString msg;
    ?msg.Printf( _T(n1));

    ??? wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this);
    }

    posted on 2006-05-15 00:00 bluesky 閱讀(3782) 評論(1)  編輯  收藏 所屬分類: C/C++

    評論

    # re: Minimal wxWidgets sample~~ 2016-06-14 15:10 http://www.sosirradies31.fr

    I was going through a big loss in my online business but since.
      回復  更多評論    
    主站蜘蛛池模板: 亚洲色欲久久久久综合网| 日本大片在线看黄a∨免费| 亚洲精品无码mv在线观看网站| 男女男精品网站免费观看 | a级成人毛片免费视频高清| 亚洲午夜精品一级在线播放放 | 中文在线免费看视频| 亚洲中文字幕在线第六区| 三上悠亚在线观看免费| 亚洲产国偷V产偷V自拍色戒| 久久这里只精品国产免费10 | 亚洲国产精品无码久久九九大片 | 亚洲免费视频观看| 免费jjzz在在线播放国产| 亚洲av无码专区在线| 亚洲国产成人va在线观看网址| 久久精品7亚洲午夜a| 免费v片在线观看无遮挡| 伊人久久亚洲综合影院首页| 成年女人喷潮毛片免费播放| 337p日本欧洲亚洲大胆人人| 亚洲精品老司机在线观看| 日韩a级无码免费视频| 久久亚洲日韩看片无码| 国内免费高清在线观看| 免费夜色污私人影院网站电影| 亚洲精品乱码久久久久久自慰| 国产成人精品免费视频动漫| 亚洲成av人无码亚洲成av人 | 国产成人免费网站在线观看| a一级爱做片免费| 亚洲情a成黄在线观看动漫尤物| 2021免费日韩视频网| 国产亚洲精品91| 亚洲成在人天堂一区二区| 精品熟女少妇AV免费观看| 国产精品免费久久久久久久久| 亚洲高清免费在线观看| 四虎影视永久免费观看地址| 久久成人免费大片| 激情无码亚洲一区二区三区|