本文整理汇总了C++中wxTextCtrl::SetFont方法的典型用法代码示例。如果您正苦于以下问题:C++ wxTextCtrl::SetFont方法的具体用法?C++ wxTextCtrl::SetFont怎么用?C++ wxTextCtrl::SetFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxTextCtrl
的用法示例。
在下文中一共展示了wxTextCtrl::SetFont方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
}
示例2: file
SLADECrashDialog(SLADEStackTrace& st) : wxDialog(wxTheApp->GetTopWindow(), -1, "SLADE3 Application Crash")
{
// Setup sizer
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
SetSizer(sizer);
// Add general crash method
string message = "SLADE3 has crashed unexpectedly. To help fix the problem that caused this crash,\nplease copy+paste the information from the window below to a text file, and email\nit to <[email protected]> along with a description of what you were\ndoing at the time of the crash. Sorry for the inconvenience.";
sizer->Add(new wxStaticText(this, -1, message), 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 4);
// Setup stack trace string
string trace = S_FMT("Version: %s\n", Global::version);
if (current_action.IsEmpty())
trace += "No current action\n";
else
trace += S_FMT("Current action: %s", current_action);
trace += "\n";
trace += st.getTraceString();
// Add stack trace text area
text_stack = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL);
text_stack->SetValue(trace);
text_stack->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
sizer->Add(text_stack, 1, wxEXPAND|wxALL, 4);
// Dump stack trace to a file (just in case)
wxFile file(appPath("slade3_crash.log", DIR_USER), wxFile::write);
file.Write(trace);
file.Close();
// Add standard 'OK' button
sizer->Add(CreateStdDialogButtonSizer(wxOK), 0, wxEXPAND|wxALL, 4);
// Setup layout
Layout();
SetInitialSize(wxSize(500, 500));
}