Removed lots of OnClose functions; doc'ed OnCloseWindow better;
MM_... -> wxMM_... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -57,7 +57,7 @@ wxDC::wxDC()
|
||||
m_scaleX = 1.0;
|
||||
m_scaleY = 1.0;
|
||||
|
||||
m_mappingMode = MM_TEXT;
|
||||
m_mappingMode = wxMM_TEXT;
|
||||
m_needComputeScaleX = FALSE; /* not used yet */
|
||||
m_needComputeScaleY = FALSE; /* not used yet */
|
||||
|
||||
@@ -217,25 +217,25 @@ void wxDC::SetMapMode( int mode )
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case MM_TWIPS:
|
||||
case wxMM_TWIPS:
|
||||
SetLogicalScale( twips2mm*m_mm_to_pix_x, twips2mm*m_mm_to_pix_y );
|
||||
break;
|
||||
case MM_POINTS:
|
||||
case wxMM_POINTS:
|
||||
SetLogicalScale( pt2mm*m_mm_to_pix_x, pt2mm*m_mm_to_pix_y );
|
||||
break;
|
||||
case MM_METRIC:
|
||||
case wxMM_METRIC:
|
||||
SetLogicalScale( m_mm_to_pix_x, m_mm_to_pix_y );
|
||||
break;
|
||||
case MM_LOMETRIC:
|
||||
case wxMM_LOMETRIC:
|
||||
SetLogicalScale( m_mm_to_pix_x/10.0, m_mm_to_pix_y/10.0 );
|
||||
break;
|
||||
default:
|
||||
case MM_TEXT:
|
||||
case wxMM_TEXT:
|
||||
SetLogicalScale( 1.0, 1.0 );
|
||||
break;
|
||||
}
|
||||
/* we don't do this mega optimisation
|
||||
if (mode != MM_TEXT)
|
||||
if (mode != wxMM_TEXT)
|
||||
{
|
||||
m_needComputeScaleX = TRUE;
|
||||
m_needComputeScaleY = TRUE;
|
||||
|
@@ -219,14 +219,25 @@ void wxDialog::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||
|
||||
void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
||||
{
|
||||
// We'll send a Cancel message by default,
|
||||
// which may close the dialog.
|
||||
// Check for looping if the Cancel event handler calls Close().
|
||||
|
||||
// Note that if a cancel button and handler aren't present in the dialog,
|
||||
// nothing will happen when you close the dialog via the window manager, or
|
||||
// via Close().
|
||||
// We wouldn't want to destroy the dialog by default, since the dialog may have been
|
||||
// created on the stack.
|
||||
// However, this does mean that calling dialog->Close() won't delete the dialog
|
||||
// unless the handler for wxID_CANCEL does so. So use Destroy() if you want to be
|
||||
// sure to destroy the dialog.
|
||||
// The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog.
|
||||
|
||||
static wxList closing;
|
||||
|
||||
if (closing.Member(this))
|
||||
return; // no loops
|
||||
|
||||
if ( event.GetVeto() )
|
||||
return;
|
||||
|
||||
closing.Append(this);
|
||||
|
||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
|
@@ -478,8 +478,8 @@ void wxFrame::OnInternalIdle()
|
||||
void wxFrame::OnCloseWindow( wxCloseEvent& event )
|
||||
{
|
||||
// close the window if it wasn't vetoed by the application
|
||||
if ( !event.GetVeto() )
|
||||
Destroy();
|
||||
// if ( !event.GetVeto() ) // No, this isn't the interpretation of GetVeto.
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
|
||||
|
Reference in New Issue
Block a user