};
BEGIN_EVENT_TABLE(wxLogDialog, wxDialog)
- EVT_BUTTON(wxID_CANCEL, wxLogDialog::OnOk)
+ EVT_BUTTON(wxID_OK, wxLogDialog::OnOk)
EVT_BUTTON(wxID_MORE, wxLogDialog::OnDetails)
#if wxUSE_FILE
EVT_BUTTON(wxID_SAVE, wxLogDialog::OnSave)
wxBoxSizer *sizerButtons = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *sizerAll = new wxBoxSizer(wxHORIZONTAL);
- // this "Ok" button has wxID_CANCEL id - not very logical, but this allows
- // to close the log dialog with <Esc> which wouldn't work otherwise (as it
- // translates into click on cancel button)
-
- // FIXME: use stock button here!
- wxButton *btnOk = new wxButton(this, wxID_CANCEL, _("OK"));
+ wxButton *btnOk = new wxButton(this, wxID_OK);
sizerButtons->Add(btnOk, 0, wxCENTRE | wxBOTTOM, MARGIN/2);
m_btnDetails = new wxButton(this, wxID_MORE, ms_details + EXPAND_SUFFIX);
sizerButtons->Add(m_btnDetails, 0, wxCENTRE | wxTOP, MARGIN/2 - 1);
btnOk->SetFocus();
- // this can't happen any more as we don't use this dialog in this case
-#if 0
- if ( count == 1 )
- {
- // no details... it's easier to disable a button than to change the
- // dialog layout depending on whether we have details or not
- m_btnDetails->Disable();
- }
-#endif // 0
-
Centre();
}
BEGIN_EVENT_TABLE(wxTipDialog, wxDialog)
EVT_BUTTON(wxID_NEXT_TIP, wxTipDialog::OnNextTip)
+ EVT_BUTTON(wxID_CLOSE, wxTipDialog::OnCancel)
END_EVENT_TABLE()
wxTipDialog::wxTipDialog(wxWindow *parent,
// smart phones does not support or do not waste space for wxButtons
#ifndef __SMARTPHONE__
- // FIXME: use stock wxID_CLOSE button here!
- wxButton *btnClose = new wxButton(this, wxID_CANCEL, _("Close"));
+ wxButton *btnClose = new wxButton(this, wxID_CLOSE);
#endif
m_checkbox = new wxCheckBox(this, wxID_ANY, _("&Show tips at startup"));
// smart phones does not support or do not waste space for wxButtons
#ifdef __SMARTPHONE__
SetRightMenu(wxID_NEXT_TIP, _("Next"));
- SetLeftMenu(wxID_CANCEL, _("Close"));
+ SetLeftMenu(wxID_CLOSE);
#else
bottom->Add( 10,10,1 );
bottom->Add( btnNext, 0, wxCENTER | wxLEFT, wxLARGESMALL(10,0) );
#include "wx/msw/wince/resources.h"
+#include "wx/stockitem.h"
+
wxTopLevelWindowMSW::ButtonMenu::ButtonMenu()
{
m_id = wxID_ANY;
{
m_assigned = true;
m_id = id;
- m_label = label;
+ if(label.empty() && wxIsStockID(id))
+ m_label = wxGetStockLabel(id);
+ else
+ m_label = label;
m_menu = subMenu;
}
// changed by the time the OnInternalIdle function is called, so 'state'
// may be meaningless.
int state = 0;
- if ( wxIsShiftDown() )
+ if ( wxIsShiftDown() )
state |= MK_SHIFT;
if ( wxIsCtrlDown() )
state |= MK_CONTROL;
case VK_ESCAPE:
{
#if wxUSE_BUTTON
- wxButton *btn = wxDynamicCast(FindWindow(wxID_CANCEL),
- wxButton);
+ wxButton *btn = wxDynamicCast(FindWindow(wxID_CANCEL),wxButton);
+
+ // our own wxLogDialog should react to Esc
+ // without Cancel button but this is a private class
+ // so let's try recognize it by content
+ #if wxUSE_LOG_DIALOG
+ if ( !btn &&
+ wxDynamicCast(this,wxDialog) &&
+ FindWindow(wxID_MORE) &&
+ FindWindow(wxID_OK) &&
+ !FindWindow(wxID_CANCEL) &&
+ GetTitle().MakeLower().StartsWith(wxTheApp->GetAppName().c_str())
+ )
+ btn = wxDynamicCast(FindWindow(wxID_OK),wxButton);
+ #endif // wxUSE_LOG_DIALOG
if ( btn && btn->IsEnabled() )
{
// if we do have a cancel button, do press it
bProcess = false;
}
// FIXME: this should be handled by
- // wxNavigationKeyEvent handler and not here!!
+ // wxNavigationKeyEvent handler and not here!
else
{
#if wxUSE_BUTTON
const wxValidator& validator,
const wxString& name)
{
+ // remember about stock IDs
return false;
}