34 #include <wx/button.h>
35 #include <wx/textctrl.h>
36 #include <wx/filedlg.h>
37 #include <wx/msgdlg.h>
47 #define ID_SAVE_BTN wxID_HIGHEST + 1
48 #define ID_TEXT_CTRL wxID_HIGHEST + 2
65 wxPanel::Create(parent,
id, wxDefaultPosition, wxSize(0,0), 0);
96 wxBoxSizer *topSizer =
new wxBoxSizer(wxVERTICAL);
97 wxBoxSizer *barSizer =
new wxBoxSizer(wxHORIZONTAL);
99 topSizer->Add(barSizer, 0, wxALIGN_RIGHT);
101 wxTextCtrl *textCtrl=
new wxTextCtrl(
this,
ID_TEXT_CTRL, wxEmptyString,
102 wxDefaultPosition, wxDefaultSize,
103 wxTE_READONLY|wxTE_MULTILINE);
105 wxFont fixedFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
106 textCtrl->SetFont(fixedFont);
108 topSizer->Add(textCtrl, 1, wxEXPAND);
111 barSizer->Add(
new wxButton(
this,
ID_SAVE_BTN,
wxT(
"Save")), 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
118 wxFileDialog dialog(
this,
wxT(
"Save OpenGL Info"), wxEmptyString, wxEmptyString,
119 wxT(
"Text files (*.txt)|*.txt|All files (*.*)|*.*"),
120 wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
122 if (dialog.ShowModal() != wxID_OK)
125 wxTextCtrl *textCtrl= (wxTextCtrl*)FindWindow(
ID_TEXT_CTRL);
126 wxString
str = textCtrl->GetValue();
129 ostr <<
str.ToUTF8() << endl;
134 wxMessageDialog msgDialog(
this,
wxT(
"Failed to save file: ") + dialog.GetFilename(),
135 wxT(
"Error"), wxICON_ERROR|wxOK);
136 msgDialog.ShowModal();
static void DumpSystemInfo(CNcbiOstream &ostr)
Dump a text formatted report of the current system configuration.
bool Create(wxWindow *parent, wxWindowID id)
Creation.
void CreateControls()
Creates the controls and sizers.
CGlInfoDemoPanel()
Constructors.
void OnButtonSave(wxCommandEvent &event)
CGlInfoWindow(wxWindow *parent, wxWindowID id, wxTextCtrl *textCtrl)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
std::ofstream out("events_result.xml")
main entry point for tests
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
static const char * str(char *buf, int n)
wxString ToWxString(const string &s)