<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 閱讀(3779) 評論(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.
      回復  更多評論    
    主站蜘蛛池模板: 免费成人av电影| 久久国产乱子伦精品免费强| 9420免费高清在线视频| 亚洲五月综合缴情在线观看| 性生大片视频免费观看一级| 日本免费无遮挡吸乳视频电影| 亚洲一区精彩视频| 丁香花在线观看免费观看 | 亚洲免费视频网站| 亚洲日产韩国一二三四区| 国产成人精品免费视频大全| 免费一级大黄特色大片| 激情吃奶吻胸免费视频xxxx| 国产高清在线精品免费软件| 亚洲精品V天堂中文字幕| 国产免费牲交视频| 色费女人18女人毛片免费视频| 亚洲国产精品成人AV无码久久综合影院| 国产av无码专区亚洲av毛片搜| 亚洲色欲久久久久综合网| 国产伦精品一区二区免费| 亚洲精品乱码久久久久久蜜桃不卡 | 无码乱肉视频免费大全合集| 亚洲天堂男人影院| 日本免费一区二区三区最新vr| 色偷偷亚洲男人天堂| 亚洲综合网站色欲色欲| 美女视频黄的免费视频网页| 亚洲美女视频一区| 久久久久久久免费视频| 国产精品亚洲天堂| 亚洲AV无码不卡在线播放| 妻子5免费完整高清电视| 国产精品亚洲精品爽爽| 亚洲va无码专区国产乱码| 精品国产无限资源免费观看| 国产精品亚洲片在线花蝴蝶| 亚洲AV永久无码区成人网站| 久久久久国色AV免费观看性色| 怡红院亚洲红怡院在线观看| 国产精品国产亚洲精品看不卡|