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

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

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

    天空是藍(lán)色的

    做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標(biāo)文件 #gcc helloworld.o -o helloworld //編譯成可執(zhí)行exe #helloworld //運(yùn)行exe
    數(shù)據(jù)加載中……
    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("&系統(tǒng)"));
    ??? 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.
      回復(fù)  更多評論    
    主站蜘蛛池模板: 亚洲人成免费电影| aⅴ在线免费观看| 亚洲天堂男人影院| 久久99国产亚洲高清观看首页| 大地资源二在线观看免费高清| 玖玖在线免费视频| 亚洲一区二区三区免费| 亚洲熟妇无码八V在线播放| 亚洲精品高清视频| 久久夜色精品国产亚洲| 亚洲片国产一区一级在线观看 | 国产成人精品日本亚洲专区61| 永久黄网站色视频免费| 亚洲成人在线免费观看| 国产一区二区免费视频| 一级特黄录像视频免费| 国产成人亚洲精品播放器下载| 日韩亚洲不卡在线视频中文字幕在线观看| 亚洲AV无码久久精品蜜桃| 亚洲日本韩国在线| 又黄又爽无遮挡免费视频| 无码人妻精品一二三区免费| 91热成人精品国产免费| 免费国产黄网站在线观看视频| 免费看成人AA片无码视频吃奶| 成在线人视频免费视频| 一个人看的免费观看日本视频www 一个人看的免费视频www在线高清动漫 | 亚洲国产视频网站| 精品亚洲A∨无码一区二区三区 | 最新国产乱人伦偷精品免费网站| 一级一级一片免费高清| 美女被爆羞羞网站在免费观看| 亚洲经典千人经典日产| 亚洲乱色伦图片区小说| 亚洲乱理伦片在线观看中字| 一本天堂ⅴ无码亚洲道久久| 亚洲国产日韩综合久久精品| 亚洲人xxx日本人18| 中文字幕乱码亚洲无线三区| 亚洲精品无码人妻无码| 韩国亚洲伊人久久综合影院|