• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ wxButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中wxButton的典型用法代码示例。如果您正苦于以下问题:C++ wxButton类的具体用法?C++ wxButton怎么用?C++ wxButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了wxButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DbgEmuPanel

	DbgEmuPanel(wxWindow* parent) : wxPanel(parent)
	{
		m_btn_run = new wxButton(this, wxID_ANY, "Run");
		m_btn_run->Bind(wxEVT_BUTTON, &DbgEmuPanel::OnRun, this);

		m_btn_stop = new wxButton(this, wxID_ANY, "Stop");
		m_btn_stop->Bind(wxEVT_BUTTON, &DbgEmuPanel::OnStop, this);

		m_btn_restart = new wxButton(this, wxID_ANY, "Restart");
		m_btn_restart->Bind(wxEVT_BUTTON, &DbgEmuPanel::OnRestart, this);

		m_btn_capture_frame = new wxButton(this, wxID_ANY, "Capture frame");
		m_btn_capture_frame->Bind(wxEVT_BUTTON, &DbgEmuPanel::OnCaptureFrame, this);

		wxBoxSizer* s_b_main = new wxBoxSizer(wxHORIZONTAL);
		s_b_main->Add(m_btn_run,     wxSizerFlags().Border(wxALL, 5));
		s_b_main->Add(m_btn_stop,    wxSizerFlags().Border(wxALL, 5));
		s_b_main->Add(new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL), 0, wxEXPAND);
		s_b_main->Add(m_btn_restart, wxSizerFlags().Border(wxALL, 5));
		s_b_main->Add(m_btn_capture_frame, wxSizerFlags().Border(wxALL, 5));

		SetSizerAndFit(s_b_main);
		Layout();

		UpdateUI();
		wxGetApp().Bind(wxEVT_DBG_COMMAND, &DbgEmuPanel::HandleCommand, this);
	}
开发者ID:976717326,项目名称:rpcs3,代码行数:27,代码来源:Debugger.cpp


示例2: wxButton

void MyFrame::InitButtons() {
	m_copy = new wxButton(this, wxID_ANY, wxT("Process"), wxDefaultPosition,
			wxDefaultSize, 0);
	m_select_img = new wxButton(this, wxID_ANY, wxT("Executable..."),
			wxDefaultPosition, wxDefaultSize, 0);
	m_select_corefile = new wxButton(this, wxID_ANY, wxT("Core dump..."),
			wxDefaultPosition, wxDefaultSize, 0);
	m_reset = new wxButton(this, wxID_ANY, wxT("Clear"), wxDefaultPosition,
			wxDefaultSize, 0);
	m_copy->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
			wxCommandEventHandler(MyFrame::OnCopyClick), NULL, this);
	m_select_img->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
			wxCommandEventHandler(MyFrame::OnSelectExecutable), NULL, this);
	m_select_corefile->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
			wxCommandEventHandler(MyFrame::OnSelectCoreFile), NULL, this);
	m_reset->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
			wxCommandEventHandler(MyFrame::OnReset), NULL, this);
}
开发者ID:flyfaster,项目名称:toysrc,代码行数:18,代码来源:coreinfo.cpp


示例3: DbgEmuPanel

	DbgEmuPanel(wxWindow* parent) : wxPanel(parent)
	{
		m_btn_run     = new wxButton(this, wxID_ANY, "Run");
		m_btn_stop    = new wxButton(this, wxID_ANY, "Stop");
		m_btn_restart = new wxButton(this, wxID_ANY, "Restart");

		wxBoxSizer& s_b_main = *new wxBoxSizer(wxHORIZONTAL);

		s_b_main.Add(m_btn_run,     wxSizerFlags().Border(wxALL, 5));
		s_b_main.Add(m_btn_stop,    wxSizerFlags().Border(wxALL, 5));
		s_b_main.Add(new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL), 0, wxEXPAND);
		s_b_main.Add(m_btn_restart, wxSizerFlags().Border(wxALL, 5));

		SetSizerAndFit(&s_b_main);
		Layout();

		UpdateUI();
		Connect(m_btn_run->GetId(),     wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DbgEmuPanel::OnRun));
		Connect(m_btn_stop->GetId(),    wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DbgEmuPanel::OnStop));
		Connect(m_btn_restart->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DbgEmuPanel::OnRestart));

		m_app_connector.Connect(wxEVT_DBG_COMMAND, wxCommandEventHandler(DbgEmuPanel::HandleCommand), (wxObject*)0, this);
	}
开发者ID:MorganCabral,项目名称:rpcs3,代码行数:23,代码来源:Debugger.cpp


示例4: MainFrame

    MainFrame(const wxString& title) {
        wxXmlResource::Get()->LoadFrame(this, NULL, "Frame1");

        m_buttonFindAll = XRCCTRL(*this, "m_buttonFindAll", wxButton);
        m_textCtrlRegex = XRCCTRL(*this, "m_textCtrlRegex", wxTextCtrl);
        m_textCtrlString = XRCCTRL(*this, "m_textCtrlString", wxTextCtrl);
        m_textCtrlFindAll = XRCCTRL(*this, "m_textCtrlFindAll", wxTextCtrl);
        m_textCtrlRegex->Bind(wxEVT_TEXT, [=](wxCommandEvent &event){
            std::wstring a = m_textCtrlRegex->GetValue();
            auto R = re::compile(a);
            if (R){
                m_textCtrlRegex->SetBackgroundColour(wxColor(0,255,0));
                m_textCtrlRegex->Refresh();
                m_textCtrlFindAll->Clear();
                m_textCtrlFindAll->Refresh();
            }
            else{
                m_textCtrlRegex->SetBackgroundColour(wxColor(255, 0, 0));
                m_textCtrlRegex->Refresh();
                m_textCtrlFindAll->Clear();
                m_textCtrlFindAll->AppendText(std::to_string(re::getlasterror()));
                m_textCtrlFindAll->AppendText("\n");
                m_textCtrlFindAll->AppendText(re::getlasterrorstr());
                m_textCtrlFindAll->Refresh();
            }
        }
        );
        //------------------------------------------------------------------------------
        m_buttonFindAll->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent &event){
            m_textCtrlFindAll->Clear();
            std::wstring a = m_textCtrlRegex->GetValue();
            auto R = re::compile(a);
            if (R){
                std::wstring s = m_textCtrlString->GetValue();
                auto v = R->findall(s);
                for (auto i = v.begin(); i < v.end(); i++){
                    m_textCtrlFindAll->AppendText(*i);
                    m_textCtrlFindAll->AppendText("\n");
                }
            }
            m_textCtrlFindAll->Refresh();

        });
        //------------------------------------------------------------------------------

    }
开发者ID:FoxTeamZone,项目名称:PCRE2Plus,代码行数:46,代码来源:PCRE2PlusTest.cpp


示例5: wxT

bool wxMiniApp::OnInit()
{
	//update_server = "http://vengeance-rpg.com/updates/";
	update_server = wxT("http://ofarts.rpgmaker.es/updater-test/");
	local_path = wxT("./");
	window = new wxFrame( NULL, -1, wxT("Vengeance RPG Online Updater"), wxDefaultPosition, wxSize( 400, 300) );
    SetTopWindow( window );
	
	GetTopWindow()->SetMinSize(wxSize(400,300));
	GetTopWindow()->SetMaxSize(wxSize(400,300));
	
	main_panel = new wxPanel(GetTopWindow(), wxID_ANY, wxPoint(0, 0), wxSize(400, 300));
	
	wxImage::AddHandler(new wxPNGHandler);	
	initialize_images();
	// 134 height
	logo = new wxBitmapButton(main_panel, wxID_ANY, _img_vengeance, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE);

	status = new wxTextCtrl(main_panel, wxID_ANY, wxT(""), wxPoint(1,135), wxSize(389,100), wxTE_READONLY|wxTE_MULTILINE);
	
	status_text = new wxStaticText(main_panel, wxID_ANY, wxT("Conectando..."), wxPoint(15, 245), wxDefaultSize);
    
	start_button = new wxButton(main_panel, 21, wxT("Start Game"), wxPoint(210, 242), wxSize(80,20));
	start_button->Enable(false);
	exit_button = new wxButton(main_panel, wxID_EXIT, wxT("Exit"), wxPoint(305, 242), wxSize(80,20));
	
	Connect(21, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(wxMiniApp::launch_game) );
    Connect(wxID_EXIT, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(wxMiniApp::OnClick) );

	// show main frame
    GetTopWindow()->Show();
	DoIt();
	
	// enter the application's main loop
    return true;
}
开发者ID:Dahrkael,项目名称:toys,代码行数:36,代码来源:main.cpp


示例6: DispFreq_NextNum

void DispFreq_NextNum(wxButton &but,wxCommandEvent&)
{
  DispFreqs *tmp=(DispFreqs*)(but.GetClientData());
  tmp->ShiftBy(tmp->GetLines());
}
开发者ID:msperl,项目名称:Period,代码行数:5,代码来源:xpfreq.cpp


示例7: CreateArtificialDataOK

void CreateArtificialDataOK(wxButton& calc,wxEvent &)
{
  calc.SetClientData((char*)1);
  calc.GetParent()->Show(FALSE);
}
开发者ID:msperl,项目名称:Period,代码行数:5,代码来源:xppredic.cpp


示例8: CreateArtificialDataCancel

void CreateArtificialDataCancel(wxButton& calc,wxEvent &)
{
  calc.GetParent()->Show(FALSE);
}
开发者ID:msperl,项目名称:Period,代码行数:4,代码来源:xppredic.cpp


示例9: PredictQUIT

void PredictQUIT(wxButton& calc,wxEvent &)
{
  calc.GetParent()->Show(FALSE);
}
开发者ID:msperl,项目名称:Period,代码行数:4,代码来源:xppredic.cpp


示例10: myGeneralButtonHandlerNoHide

void myGeneralButtonHandlerNoHide(wxButton& but,wxEvent &)
{
  but.SetClientData((char*)1);
}
开发者ID:msperl,项目名称:Period,代码行数:4,代码来源:xgeneral.cpp


示例11: myGeneralButtonHandler

void myGeneralButtonHandler(wxButton& but,wxEvent &)
{
  but.GetParent()->Show(FALSE);
  but.SetClientData((char*)1);
}
开发者ID:msperl,项目名称:Period,代码行数:5,代码来源:xgeneral.cpp


示例12: NewMapDialog

    NewMapDialog(wxWindow* parent, int game, int port, vector<Archive::mapdesc_t>& maps, Archive* archive)
        : wxDialog(parent, -1, "New Map")
    {
        // Setup dialog
        wxBoxSizer* msizer = new wxBoxSizer(wxVERTICAL);
        SetSizer(msizer);
        wxGridBagSizer* sizer = new wxGridBagSizer(4, 4);
        msizer->Add(sizer, 1, wxEXPAND|wxALL, 10);

        // Open selected game configuration if no map names are currently loaded
        if (theGameConfiguration->nMapNames() == 0)
        {
            string gname = theGameConfiguration->gameConfig(game).name;
            string pname = theGameConfiguration->portConfig(port).name;
            theGameConfiguration->openConfig(gname, pname);
        }

        // Check if the game configuration allows any map name
        int flags = 0;
        if (!theGameConfiguration->anyMapName())
            flags = wxCB_READONLY;

        // Create map name combo box
        cbo_mapname = new wxComboBox(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, flags);
        sizer->Add(new wxStaticText(this, -1, "Map Name:"), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
        sizer->Add(cbo_mapname, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND);

        // Limit map name length if necessary
        if (theGameConfiguration->anyMapName() &&
                (!theGameConfiguration->allowLongNames() ||
                 (archive && archive->getType() != ARCHIVE_ZIP &&
                  archive->getType() != ARCHIVE_7Z &&
                  archive->getType() != ARCHIVE_FOLDER)))
            cbo_mapname->SetMaxLength(8);

        // Add possible map names to the combo box
        for (unsigned a = 0; a < theGameConfiguration->nMapNames(); a++)
        {
            // Check if map already exists
            string mapname = theGameConfiguration->mapName(a);
            bool exists = false;
            for (unsigned m = 0; m < maps.size(); m++)
            {
                if (S_CMPNOCASE(maps[m].name, mapname))
                {
                    exists = true;
                    break;
                }
            }

            if (!exists)
                cbo_mapname->Append(mapname);
        }

        // Set inital map name selection
        if (theGameConfiguration->nMapNames() > 0)
            cbo_mapname->SetSelection(0);

        // Create map format combo box
        choice_mapformat = new wxChoice(this, -1);
        sizer->Add(new wxStaticText(this, -1, "Map Format:"), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
        sizer->Add(choice_mapformat, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND);

        // Add possible map formats to the combo box
        uint8_t default_format = MAP_UNKNOWN;
        if (! maps.empty())
            default_format = maps[0].format;
        for (uint8_t map_type = 0; map_type < MAP_UNKNOWN; map_type++)
        {
            if (theGameConfiguration->mapFormatSupported(map_type, game, port))
            {
                choice_mapformat->Append(MAP_TYPE_NAMES[map_type]);
                if (map_type == default_format)
                    choice_mapformat->SetSelection(choice_mapformat->GetCount() - 1);
            }
        }
        // Default to the "best" supported format, the last one in the list
        if (choice_mapformat->GetSelection() == wxNOT_FOUND)
            choice_mapformat->SetSelection(choice_mapformat->GetCount() - 1);

        // Add dialog buttons
        wxBoxSizer* hbox = new wxBoxSizer(wxHORIZONTAL);
        msizer->Add(hbox, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10);
        hbox->AddStretchSpacer();
        btn_ok = new wxButton(this, -1, "OK");
        hbox->Add(btn_ok, 0, wxEXPAND | wxRIGHT, 4);
        btn_cancel = new wxButton(this, -1, "Cancel");
        hbox->Add(btn_cancel, 0, wxEXPAND);
        sizer->AddGrowableCol(1);

        // Bind events
        btn_ok->Bind(wxEVT_BUTTON, &NewMapDialog::onBtnOk, this);
        btn_cancel->Bind(wxEVT_BUTTON, &NewMapDialog::onBtnCancel, this);

        Layout();
        msizer->Fit(this);
        CenterOnParent();
    }
开发者ID:sirjuddington,项目名称:SLADE,代码行数:98,代码来源:MapEditorConfigDialog.cpp


示例13: ChangeDialogOK

void ChangeDialogOK(wxButton& button,wxEvent &)
{
  button.GetParent()->SetClientData((char*)1);
  button.GetParent()->Show(FALSE);
}
开发者ID:msperl,项目名称:Period,代码行数:5,代码来源:xtdialog.cpp


示例14: DispFreq_Next

void DispFreq_Next(wxButton &but,wxCommandEvent&)
{
  ((DispFreqs*)(but.GetClientData()))->ShiftBy(1);
}
开发者ID:msperl,项目名称:Period,代码行数:4,代码来源:xpfreq.cpp


示例15: play

void MainWindow::play() {
    libvlc_media_player_play(media_player);
    playpause_button->SetLabel(wxT("Pause"));
    playpause_button->Enable(true);
    stop_button->Enable(true);
    timeline->Enable(true);
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:7,代码来源:wx_player.cpp


示例16: HandleCommand

	void HandleCommand(wxCommandEvent& event)
	{
		event.Skip();

		switch(event.GetId())
		{
		case DID_STOP_EMU:
			m_btn_run->SetLabel("Run");
		break;

		case DID_PAUSE_EMU:
			m_btn_run->SetLabel("Resume");
		break;

		case DID_START_EMU:
		case DID_RESUME_EMU:
			m_btn_run->SetLabel("Pause");
		break;

		case DID_EXIT_THR_SYSCALL:
			Emu.GetCPU().RemoveThread(((PPCThread*)event.GetClientData())->GetId());
		break;
		}

		UpdateUI();
	}
开发者ID:MorganCabral,项目名称:rpcs3,代码行数:26,代码来源:Debugger.cpp


示例17: OnConnectionLost

void StreamerFrame::OnConnectionLost(wxSocketEvent& event){
  connect->SetValue(false);
 
  connect->SetLable("Connect");

  SetStatusText("Connection to server lost");

}
开发者ID:tanerochris,项目名称:Streamer,代码行数:8,代码来源:Clients.cpp


示例18: OnConnectionEstablished

void StreamerFrame::OnConnectionEstablished(wxSocketEvent& event){
   
   connect->SetValue(true);

   connect->SetLabel("Disconnect");
  
   SetStatusText( "Connection Established" );

}
开发者ID:tanerochris,项目名称:Streamer,代码行数:9,代码来源:Clients.cpp


示例19: UpdateUI

	void UpdateUI()
	{
		const auto status = Emu.GetStatus();

		if (m_last_status != status)
		{
			m_last_status = status;

			m_btn_run->Enable(status != system_state::stopped);
			m_btn_stop->Enable(status != system_state::stopped);
			m_btn_restart->Enable(!Emu.GetPath().empty());
			m_btn_run->SetLabel(status == system_state::paused ? "Resume" : status == system_state::running ? "Pause" : "Run");
		}
	}
开发者ID:cornytrace,项目名称:rpcs3,代码行数:14,代码来源:Debugger.cpp


示例20: stop

void MainWindow::stop() {
    pause();
    libvlc_media_player_stop(media_player);
    stop_button->Enable(false);
    setTimeline(0.0);
    timeline->Enable(false);
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:7,代码来源:wx_player.cpp



注:本文中的wxButton类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxCharBuffer类代码示例发布时间:2022-05-31
下一篇:
C++ wxBufferedDC类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap