<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 閱讀(3792) 評論(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.
      回復  更多評論    
    主站蜘蛛池模板: 一区二区三区免费视频网站| 亚洲精品亚洲人成在线| 2019中文字幕免费电影在线播放| 免费一级毛片在级播放| 亚洲精品人成网线在线播放va | 亚洲一区二区三区日本久久九| 亚洲电影一区二区三区| 亚洲日本国产综合高清| 一个人看www在线高清免费看 | 免费A级毛片无码免费视| 亚洲资源最新版在线观看| 每天更新的免费av片在线观看| 亚洲高清中文字幕综合网| 精品一区二区三区无码免费直播| 国产成人aaa在线视频免费观看 | 亚洲国产成人精品无码区花野真一| 24小时日本在线www免费的| 亚洲熟妇无码AV| 1000部羞羞禁止免费观看视频| 亚洲精品美女在线观看| 成人毛片18女人毛片免费视频未| 亚洲午夜国产精品无码| 日韩精品内射视频免费观看| 免费亚洲视频在线观看| 91视频精品全国免费观看| 国产成人啪精品视频免费网| 高潮毛片无遮挡高清免费 | 久久精品国产亚洲AV高清热| 我们的2018在线观看免费高清| 亚洲区日韩精品中文字幕| 一本色道久久88亚洲综合 | 国产A∨免费精品视频| 亚洲国产成人久久综合一| 一级看片免费视频| 久久国产精品亚洲综合| 成人黄动漫画免费网站视频| 一日本道a高清免费播放| 亚洲国产片在线观看| 亚洲国产精品嫩草影院久久| 午夜免费福利视频| 无码天堂va亚洲va在线va|