m_canvasFont = *wxNORMAL_FONT;
// Create the main frame window
- MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) _T("wxWindows dialogs example"), wxPoint(20, 20), wxSize(400, 300));
+ MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWindows dialogs example"), wxPoint(20, 20), wxSize(400, 300));
// Make a menubar
wxMenu *file_menu = new wxMenu;
void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event))
{
- wxString pwd = wxGetPasswordFromUser("Enter password:",
+ wxString pwd = wxGetPasswordFromUser(_T("Enter password:"),
_T("Password entry dialog"),
"",
this);
static wxString s_extDef;
wxString path = wxFileSelector(
_T("Select the file to load"),
- _T("_T("), _T(")"),
+ _T(""), _T(""),
s_extDef,
_T("Waveform (*.wav)|*.wav|Plain text (*.txt)|*.txt|All files (*.*)|*.*"),
wxCHANGE_DIR,
void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
{
wxFileDialog dialog(this, _T("Testing open multiple file dialog"),
- "_T(", ")", wxFileSelectorDefaultWildcardStr,
+ _T(""), _T(""), wxFileSelectorDefaultWildcardStr,
wxMULTIPLE);
if (dialog.ShowModal() == wxID_OK)
void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
{
- wxFileDialog dialog(this, _T("Testing save file dialog"), "_T(", ")myletter.txt",
- _T("Text files (*.txt)|*.txt|Document files (*.doc)|*.doc"),
- wxSAVE|wxOVERWRITE_PROMPT);
+ wxFileDialog dialog(this,
+ _T("Testing save file dialog"),
+ _T(""),
+ _T("myletter.txt"),
+ _T("Text files (*.txt)|*.txt|Document files (*.doc)|*.doc"),
+ wxSAVE|wxOVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_OK)
{
s_index = rand() % 5;
}
- wxTipProvider *tipProvider = wxCreateFileTipProvider("tips.txt", s_index);
+ wxTipProvider *tipProvider = wxCreateFileTipProvider(_T("tips.txt"), s_index);
bool showAtStartup = wxShowTip(this, tipProvider);
if ( showAtStartup )
{
- wxMessageBox("Will show tips on startup_T(", ")Tips dialog",
+ wxMessageBox(_T("Will show tips on startup"), _T("Tips dialog"),
wxOK | wxICON_INFORMATION, this);
}
{
static const int max = 10;
- wxProgressDialog dialog("Progress dialog example",
+ wxProgressDialog dialog(_T("Progress dialog example"),
_T("An informative message"),
max, // range
this, // parent
wxPD_CAN_ABORT |
wxPD_APP_MODAL |
+ // wxPD_AUTO_HIDE | -- try this as well
wxPD_ELAPSED_TIME |
wxPD_ESTIMATED_TIME |
wxPD_REMAINING_TIME);
{
wxString str;
str << (flags & wxFR_DOWN ? _T("down") : _T("up")) << _T(", ")
- << (flags & wxFR_WHOLEWORD ? _T("whole words only, ") : "")
- << (flags & wxFR_MATCHCASE ? "_T(" : ")not ")
+ << (flags & wxFR_WHOLEWORD ? _T("whole words only, ") : _T(""))
+ << (flags & wxFR_MATCHCASE ? _T("") : _T("not "))
<< _T("case sensitive");
return str;
{
wxFindReplaceDialog *dlg = event.GetDialog();
+ int idMenu;
const wxChar *txt;
if ( dlg == m_dlgFind )
{
txt = _T("Find");
+ idMenu = DIALOGS_FIND;
m_dlgFind = NULL;
}
else if ( dlg == m_dlgReplace )
{
txt = _T("Replace");
+ idMenu = DIALOGS_REPLACE;
m_dlgReplace = NULL;
}
else
{
txt = _T("Unknown");
+ idMenu = -1;
- wxFAIL_MSG( _T("unexecpted event") );
+ wxFAIL_MSG( _T("unexpected event") );
}
- wxLogMessage(wxT("%s dialog is being closed."), txt),
+ wxLogMessage(wxT("%s dialog is being closed."), txt);
+
+ if ( idMenu != -1 )
+ {
+ GetMenuBar()->Check(idMenu, FALSE);
+ }
dlg->Destroy();
}
void MyModelessDialog::OnButton(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox("Button pressed in modeless dialog_T(", ")Info",
+ wxMessageBox(_T("Button pressed in modeless dialog"), _T("Info"),
wxOK | wxICON_INFORMATION, this);
}
{
if ( event.CanVeto() )
{
- wxMessageBox("Use the menu item to close this dialog",
+ wxMessageBox(_T("Use the menu item to close this dialog"),
_T("Modeless dialog"),
wxOK | wxICON_INFORMATION, this);
// ----------------------------------------------------------------------------
MyModalDialog::MyModalDialog(wxWindow *parent)
- : wxDialog(parent, -1, wxString("Modal dialog"))
+ : wxDialog(parent, -1, wxString(_T("Modal dialog")))
{
wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);