MCPcopy Create free account
hub / github.com/GollyGang/ready / MonospaceMessageBox

Method MonospaceMessageBox

src/gui/dialogs.cpp:28–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26// -----------------------------------------------------------------------------
27
28MonospaceMessageBox::MonospaceMessageBox(const wxString& message, const wxString& title, const wxArtID& icon)
29 : wxDialog(NULL,wxID_ANY,title,wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
30{
31 wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
32 #ifdef __WXMAC__
33 // need bigger font on Mac, and need to specify facename to get Monaco instead of Courier
34 wxFont font(12, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("Monaco"));
35 #else
36 wxFont font(10, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, _T("Monospace"), wxFONTENCODING_DEFAULT);
37 #endif
38 wxTextCtrl *text = new wxTextCtrl(this,wxID_ANY,message,wxDefaultPosition,wxDefaultSize,
39 wxTE_MULTILINE|wxTE_READONLY|wxTE_DONTWRAP);
40 text->SetFont(font);
41 text->SetMinSize(wxSize(800,500));
42 #ifdef __WXMAC__
43 // nicer to use white bg on Mac
44 text->SetBackgroundColour(*wxWHITE);
45 #else
46 text->SetBackgroundColour(this->GetBackgroundColour());
47 #endif
48 text->SetForegroundColour(*wxBLACK);
49 this->SetIcon(wxArtProvider::GetIcon(icon));
50 vbox->Add(text,wxSizerFlags(1).Expand().DoubleBorder());
51 vbox->Add(this->CreateButtonSizer(wxOK),wxSizerFlags(0).Expand().DoubleBorder());
52 this->SetSizerAndFit(vbox);
53 this->ShowModal();
54}
55
56// =============================================================================
57

Callers

nothing calls this directly

Calls 1

AddMethod · 0.80

Tested by

no test coverage detected