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

C++ wxTextCtrl类代码示例

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

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



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

示例1: RunConfigDialog

	RunConfigDialog(wxWindow* parent, string title, string name, string params, bool custom = true) : wxDialog(parent, -1, title)
	{
		// Setup sizer
		wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
		SetSizer(sizer);

		wxGridBagSizer* gb_sizer = new wxGridBagSizer(8, 4);
		sizer->Add(gb_sizer, 1, wxEXPAND|wxALL, 10);

		// Config name
		gb_sizer->Add(new wxStaticText(this, -1, "Config Name:"), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
		text_name = new wxTextCtrl(this, -1, name);
		text_name->Enable(custom);
		gb_sizer->Add(text_name, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND);

		// Config params
		gb_sizer->Add(new wxStaticText(this, -1, "Parameters:"), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
		text_params = new wxTextCtrl(this, -1, params);
		gb_sizer->Add(text_params, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND);

		wxStaticText* label_help = new wxStaticText(this, -1, "");
		gb_sizer->Add(label_help, wxGBPosition(2, 0), wxGBSpan(1, 2), wxEXPAND);

		gb_sizer->Add(CreateStdDialogButtonSizer(wxOK|wxCANCEL), wxGBPosition(3, 0), wxGBSpan(1, 2), wxALIGN_RIGHT);
		gb_sizer->AddGrowableCol(1);
		gb_sizer->AddGrowableRow(2);

		label_help->SetLabel("%i - Base resource archive\n%r - Resource archive(s)\n%a - Current archive\n%mn - Map name\n%mw - Map number (eg. E1M1 = 1 1, MAP02 = 02)");
		label_help->Wrap(300);
		text_params->SetInsertionPoint(0);
	}
开发者ID:devinacker,项目名称:SLADE,代码行数:31,代码来源:RunDialog.cpp


示例2: write

	//read messages from buffer and write them to the screen
	void write(wxCommandEvent &)
	{
		if (messages.size() > 0)
		{
			messages.lockGet();
			size_t size = messages.size();
			std::vector<char> local_messages(size);
			messages.popN(&local_messages.front(), size);
			messages.unlockGet();
			newLog = false;

			u32 cursor = 0;
			u32 removed = 0;
			while (cursor < local_messages.size())
			{
				Log::LogMessage msg = Log::LogMessage::deserialize(local_messages.data() + cursor, &removed);
				cursor += removed;
				if (removed <= 0)
				{
					break;
				}
				wxTextCtrl *llogcon = (msg.mType == Log::TTY) ? m_tty : m_log;
				if (llogcon)
				{
					switch (msg.mServerity)
					{
					case Log::LogSeverityNotice:
						llogcon->SetDefaultStyle(m_color_white);
						break;
					case Log::LogSeverityWarning:
						llogcon->SetDefaultStyle(m_color_yellow);
						break;
					case Log::LogSeverityError:
						llogcon->SetDefaultStyle(m_color_red);
						break;
					case Log::LogSeveritySuccess:
						llogcon->SetDefaultStyle(m_color_green);
						break;
					default:
						break;
					}
					llogcon->AppendText(fmt::FromUTF8(msg.mText));
				}
			}
			if (m_log->GetLastPosition() > GUI_BUFFER_MAX_SIZE)
			{
				m_log->Remove(0, m_log->GetLastPosition() - (GUI_BUFFER_MAX_SIZE/2));
			}
		}
	}
开发者ID:DeadlyGamer,项目名称:rpcs3,代码行数:51,代码来源:ConLogFrame.cpp


示例3: ValueFromTextCtrl

int ValueFromTextCtrl( const wxTextCtrl& aTextCtr )
{
    int      value;
    wxString msg = aTextCtr.GetValue();

    value = ValueFromString( g_UserUnit, msg );

    return value;
}
开发者ID:LDavis4559,项目名称:kicad-source-mirror,代码行数:9,代码来源:base_units.cpp


示例4: setArgValue

	// Set the value in the textbox
	void setArgValue(long val)
	{
		if (val < 0)
			text_control->ChangeValue("");
		else
			text_control->ChangeValue(S_FMT("%ld", val));
	}
开发者ID:jonrimmer,项目名称:SLADE,代码行数:8,代码来源:ActionSpecialDialog.cpp


示例5: log

	void log(agi::log::SinkMessage *sm) override {
#ifndef _WIN32
		tm tmtime;
		localtime_r(&sm->tv.tv_sec, &tmtime);
		auto log = wxString::Format("%c %02d:%02d:%02d %-6ld <%-25s> [%s:%s:%d]  %s\n",
			agi::log::Severity_ID[sm->severity],
			(int)tmtime.tm_hour,
			(int)tmtime.tm_min,
			(int)tmtime.tm_sec,
			(long)sm->tv.tv_usec,
			sm->section,
			sm->file,
			sm->func,
			sm->line,
			to_wx(sm->message));
#else
		auto log = wxString::Format("%c %-6ld <%-25s> [%s:%s:%d]  %s\n",
			agi::log::Severity_ID[sm->severity],
			sm->tv.tv_usec,
			sm->section,
			sm->file,
			sm->func,
			sm->line,
			to_wx(sm->message));
#endif

		if (wxIsMainThread())
			text_ctrl->AppendText(log);
		else
			agi::dispatch::Main().Async([=]{ text_ctrl->AppendText(log); });
	}
开发者ID:KagamiChan,项目名称:Aegisub,代码行数:31,代码来源:dialog_log.cpp


示例6: DoChangeFont

void MyFrame::DoChangeFont(const wxFont& font, const wxColour& col)
{
    m_canvas->SetTextFont(font);
    if ( col.IsOk() )
        m_canvas->SetColour(col);
    m_canvas->Refresh();

    m_textctrl->SetFont(font);
    if ( col.IsOk() )
        m_textctrl->SetForegroundColour(col);
    m_textctrl->Refresh();

    // update the state of the bold/italic/underlined menu items
    wxMenuBar *mbar = GetMenuBar();
    if ( mbar )
    {
        mbar->Check(Font_Light, font.GetWeight() == wxFONTWEIGHT_LIGHT);
        mbar->Check(Font_Bold, font.GetWeight() == wxFONTWEIGHT_BOLD);

        mbar->Check(Font_Italic, font.GetStyle() == wxFONTSTYLE_ITALIC);
#ifndef __WXMSW__
        mbar->Check(Font_Slant, font.GetStyle() == wxFONTSTYLE_SLANT);
#endif

        mbar->Check(Font_Underlined, font.GetUnderlined());
        mbar->Check(Font_Strikethrough, font.GetStrikethrough());
    }
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:28,代码来源:font.cpp


示例7: download_file

void wxMiniApp::download_file(wxString filename)
{
	try 
	{	
		text = wxT("Downloading ") + filename + wxT("...");
		status->AppendText(text);
		
		WebForm http_connection;
		http_connection.setHost(update_server.mb_str());
		http_connection.setScriptFile(filename.mb_str()); 
		http_connection.sendRequest();
		wxString complete_path = wxT("");
		complete_path += local_path;
		complete_path += filename;
		bool success = http_connection.downloadBigFile(complete_path.mb_str());
		// Downloaded succesfully?
		if(success)
		{
			// Yes :)
			text = wxT(" Done"); 
			status->AppendText(text);
			status->AppendText(wxT("\n"));
			
		}
		else 
		{
			// No :(
			text = wxT(" Error"); 
			status->AppendText(text);
			status->AppendText(wxT("\n"));
			
		}
	} catch(WebFormException ex) { /*cout << ex.getMessage() << endl;*/ }
		
}
开发者ID:Dahrkael,项目名称:toys,代码行数:35,代码来源:main.cpp


示例8: OnCalc

void MyFrame::OnCalc(wxCommandEvent& event)
{
	std::string text	= invoice_list->GetValue().ToStdString();
	std::string target	= target_input->GetValue().ToStdString();
	Finder f = Finder();
	int n;
	Finder::readToInt(&n,target.c_str());
	f.setTarget(n);
	f.setValues(text);
	f.make();
	std::vector<int> result = f.getResult();

	if (result.size() == 0) {
		result_list->SetValue(L"拼凑失败!");
		return;
	}

	double sum = 0;
	std::stringstream result_str;
	for (std::vector<int>::size_type i = 0; i != result.size(); ++i) {
		double v = result[i] / 100.0;
		result_str << v;
		if (i != result.size() -1)
			result_str << " + ";
		sum += v;
	}
	result_str << " = ";
	result_str << sum;

	result_list->SetValue(result_str.str());
}
开发者ID:sagaxu,项目名称:xcalc,代码行数:31,代码来源:main.cpp


示例9: TransferDataFromWindow

	virtual bool TransferDataFromWindow()
    {
		wxFileName fileName = m_filePicker->GetFileName();
		if (fileName.FileExists())
		{
			alertDlg("Project file is already exist.\nSelect other filename.", this);
			m_filePicker->SetFocus();
			return false;
		}

		if (!fileName.IsOk())
		{
			alertDlg("Project file name is empty or invalid.", this);
			m_filePicker->SetFocus();
			return false;
		}

		if (m_textName->GetLabelText().IsEmpty())
		{
			alertDlg("Project name is empty.", this);
			m_textName->SetFocus();
			return false;
		}

		return true;
	}
开发者ID:Ali-il,项目名称:gamekit,代码行数:26,代码来源:luWizard.cpp


示例10: Execute

  void DisplayProcess::Execute(const wxString& command)
  {
    if (!tctrl)
    {
      return;
    }

    wxProcess *process = new wxProcess(wxPROCESS_REDIRECT);
    //long pid =
      wxExecute(command, wxEXEC_ASYNC, process);
    process->Redirect();

    if (process)
    {
      wxString log;
      wxInputStream *msg = process->GetInputStream();

      wxTextInputStream tStream(*msg);
      while (!msg->Eof())
      {
        log = tStream.ReadLine();
        tctrl->AppendText(log + wxT("\n"));
        tctrl->ShowPosition(tctrl->GetLastPosition());
      }
      tctrl->AppendText(wxT("Finished!\n"));
    }
    else {
      tctrl->AppendText(wxT("FAIL: Command" + command + " could not be run!\n"));
    }
  }
开发者ID:gregsimon,项目名称:ftk,代码行数:30,代码来源:console.cpp


示例11: OnRun

void MyFrame::OnRun(wxCommandEvent &event) {
    ostringstream stream;

    text->Clear();

    unique_ptr<eph::nominate_abstract> nsl;

    switch (methods->GetCurrentSelection()) {
        case 0:
            nsl = make_unique<eph::nominate_pal>(stream, lines);
            break;
        case 1:
            nsl = make_unique<eph::nominate_sdv_lpe>(stream, lines);
            break;
        case 2:
            nsl = make_unique<eph::nominate_sdv_lpe>(stream, lines, eph::ENABLE_SL::YES);
            break;
    }

    auto result = nsl->nominate(finalists->GetCurrentSelection()+1, noms_per_ballot->GetCurrentSelection()+1);

    if (verbose->GetValue()) {
        text->AppendText(stream.str());
    }
    text->AppendText(result);
}
开发者ID:guy-middleton,项目名称:EPH,代码行数:26,代码来源:wxmain.cpp


示例12: HighlightCurrentField

    // Select the currently actively field.
    void HighlightCurrentField()
    {
        m_text->SetFocus();

        const CharRange range = GetFieldRange(m_currentField);

        m_text->SetSelection(range.from, range.to);
    }
开发者ID:jfiguinha,项目名称:Regards,代码行数:9,代码来源:timectrlg.cpp


示例13: OnTestTextValue

void MyFrame::OnTestTextValue(wxCommandEvent& WXUNUSED(event))
{
    wxString value = m_textctrl->GetValue();
    m_textctrl->SetValue(value);
    if ( m_textctrl->GetValue() != value )
    {
        wxLogError(wxT("Text value changed after getting and setting it"));
    }
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:9,代码来源:font.cpp


示例14: onPlistCheckboxPressed

    void onPlistCheckboxPressed(wxCommandEvent& evt)
    {
        const bool on = m_info_plist_cb->IsChecked();

        m_get_info_string->Enable(on);
        m_version->Enable(on);
        m_icon_file->Enable(on);
        m_identifier->Enable(on);
        m_signature->Enable(on);
    }
开发者ID:capturePointer,项目名称:codelite,代码行数:10,代码来源:macbundler.cpp


示例15: Log

// Log messages to the text control
void MyFrame::Log(const wxString& text)
{
    if (m_textCtrl)
    {
        wxString text2(text);
        text2.Replace(wxT("\n"), wxT(" "));
        text2.Replace(wxT("\r"), wxT(" "));
        m_textCtrl->SetInsertionPointEnd();
        m_textCtrl->WriteText(text2 + wxT("\n"));
    }
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:12,代码来源:accesstest.cpp


示例16: OnFind

void WebFrame::OnFind(wxCommandEvent& WXUNUSED(evt))
{
    wxString value = m_browser->GetSelectedText();
    if(value.Len() > 150)
    {
        value.Truncate(150);
    }
    m_find_ctrl->SetValue(value);
    if(!m_find_toolbar->IsShown()){
        m_find_toolbar->Show(true);
        SendSizeEvent();
    }
    m_find_ctrl->SelectAll();
}
开发者ID:anhlehoang410,项目名称:wxWebViewChromium,代码行数:14,代码来源:webview.cpp


示例17: OnWriteClipboardContents

void MyFrame::OnWriteClipboardContents(wxCommandEvent& WXUNUSED(event))
{
    if (wxTheClipboard->Open())
    {
        if (wxTheClipboard->IsSupported( wxDF_UNICODETEXT ))
        {
            wxTextDataObject data;
            wxTheClipboard->GetData( data );
            m_textctrl->Clear();
            m_textctrl->SetValue( data.GetText() );

        }
        wxTheClipboard->Close();
    }
}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:15,代码来源:clipboard.cpp


示例18: OnJustifyUpdateUI

void MyFrame::OnJustifyUpdateUI(wxUpdateUIEvent& evt)
{
    switch(evt.GetId())
    {
    case wxID_JUSTIFY_LEFT:
        evt.Check(!m_logwindow->HasFlag(wxTE_CENTER | wxTE_RIGHT));
        break;
    case wxID_JUSTIFY_CENTER:
        evt.Check(m_logwindow->HasFlag(wxTE_CENTER));
        break;
    case wxID_JUSTIFY_RIGHT:
        evt.Check(m_logwindow->HasFlag(wxTE_RIGHT));
        break;
    }
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:15,代码来源:ribbondemo.cpp


示例19: log

	void log(agi::log::SinkMessage *sm) {
#ifndef _WIN32
		tm tmtime;
		localtime_r(&sm->tv.tv_sec, &tmtime);
		wxString log = wxString::Format("%c %02d:%02d:%02d %-6ld <%-25s> [%s:%s:%d]  %s\n",
			agi::log::Severity_ID[sm->severity],
			(int)tmtime.tm_hour,
			(int)tmtime.tm_min,
			(int)tmtime.tm_sec,
			(long)sm->tv.tv_usec,
			sm->section,
			sm->file,
			sm->func,
			sm->line,
			wxString::FromUTF8(sm->message, sm->len));
#else
		wxString log = wxString::Format("%c %-6ld <%-25s> [%s:%s:%d]  %s\n",
			agi::log::Severity_ID[sm->severity],
			sm->tv.tv_usec,
			sm->section,
			sm->file,
			sm->func,
			sm->line,
			wxString::FromUTF8(sm->message, sm->len));
#endif
		text_ctrl->AppendText(log);
	}
开发者ID:Gpower2,项目名称:Aegisub,代码行数:27,代码来源:dialog_log.cpp


示例20: OnSolveButton

void MyFrame::OnSolveButton(wxCommandEvent& evt) {
    Solver solver;
    
    if(!solver.set_goal(goalEntry->GetValue().ToStdString())) {
        wxMessageBox(wxT("Неверный формат целевой функции"), 
                     wxT("Ошибка"), wxOK|wxCENTER|wxICON_ERROR);
        return;
    }
    
    for(auto const& entry : restrEntries) {
        bool restrSet = solver.add_restriction(entry->GetValue().ToStdString());
        
        if(!restrSet) {
            wxMessageBox(wxT("Неверный формат ограничения"), 
                         wxT("Ошибка"), wxOK|wxCENTER|wxICON_ERROR);
            return;
        }
    }
    
    Solver invSolver = solver;
    invSolver.invert_to_dual();
    
    auto steps = solver.solve();
    auto invSteps = invSolver.solve();
    
    if(!steps.back().valid()) {
        wxMessageBox(wxT("Неразрешимая система"),
                     wxT("Ошибка"), wxOK|wxCENTER|wxICON_ERROR);
        return;
    }
    
    ClearNotebooks();
    FillNotebook(steps, directStepsBook);
    FillNotebook(invSteps, invertStepsBook);
}
开发者ID:ts14ic,项目名称:UTM-CO,代码行数:35,代码来源:main.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ wxThreadEvent类代码示例发布时间:2022-05-31
下一篇:
C++ wxTextAttr类代码示例发布时间: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