cleanup - reformat

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36750 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Surovell
2006-01-07 06:01:50 +00:00
parent e45a688549
commit efb064f747

View File

@@ -19,10 +19,11 @@
#include "wx/mac/uma.h" #include "wx/mac/uma.h"
// Lists to keep track of windows, so we can disable/enable them // Lists to keep track of windows, so we can disable/enable them
// for modal dialogs // for modal dialogs
wxList wxModalDialogs; wxList wxModalDialogs;
//wxList wxModelessWindows; // Frames and modeless dialogs
extern wxList wxPendingDelete; extern wxList wxPendingDelete;
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow) IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
@@ -39,49 +40,56 @@ BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
EVT_CLOSE(wxDialog::OnCloseWindow) EVT_CLOSE(wxDialog::OnCloseWindow)
END_EVENT_TABLE() END_EVENT_TABLE()
void wxDialog::Init() void wxDialog::Init()
{ {
m_isModalStyle = false; m_isModalStyle = false;
} }
bool wxDialog::Create(wxWindow *parent, wxWindowID id, bool wxDialog::Create( wxWindow *parent,
const wxString& title, wxWindowID id,
const wxPoint& pos, const wxString& title,
const wxSize& size, const wxPoint& pos,
long style, const wxSize& size,
const wxString& name) long style,
const wxString& name )
{ {
SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG); SetExtraStyle( GetExtraStyle() | wxTOPLEVEL_EX_DIALOG );
// All dialogs should really have this style // All dialogs should really have this style...
style |= wxTAB_TRAVERSAL; style |= wxTAB_TRAVERSAL;
if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style & ~(wxYES|wxOK|wxNO /*|wxCANCEL*/) , name) ) // ...but not these styles
style &= ~(wxYES | wxOK | wxNO); // | wxCANCEL
if ( !wxTopLevelWindow::Create( parent, id, title, pos, size, style, name ) )
return false; return false;
HIViewRef growBoxRef = 0 ; HIViewRef growBoxRef = 0 ;
OSStatus err = HIViewFindByID( HIViewGetRoot( (WindowRef) m_macWindow ) , kHIViewWindowGrowBoxID , &growBoxRef ); OSStatus err = HIViewFindByID( HIViewGetRoot( (WindowRef)m_macWindow ), kHIViewWindowGrowBoxID, &growBoxRef );
if ( err == noErr && growBoxRef != 0 ) if ( err == noErr && growBoxRef != 0 )
HIGrowBoxViewSetTransparent( growBoxRef , true ) ; HIGrowBoxViewSetTransparent( growBoxRef, true ) ;
return true; return true;
} }
void wxDialog::SetModal(bool flag) void wxDialog::SetModal( bool flag )
{ {
if ( flag ) if ( flag )
{ {
m_isModalStyle = true; m_isModalStyle = true;
wxModelessWindows.DeleteObject(this); wxModelessWindows.DeleteObject( this );
#if TARGET_CARBON #if TARGET_CARBON
SetWindowModality( (WindowRef) MacGetWindowRef() , kWindowModalityAppModal , NULL ) ; SetWindowModality( (WindowRef)MacGetWindowRef(), kWindowModalityAppModal, NULL ) ;
#endif #endif
} }
else else
{ {
m_isModalStyle = false; m_isModalStyle = false;
wxModelessWindows.Append(this); wxModelessWindows.Append( this );
} }
} }
@@ -106,6 +114,7 @@ void wxDialog::OnCharHook(wxKeyEvent& event)
return; return;
} }
// We didn't process this event. // We didn't process this event.
event.Skip(); event.Skip();
} }
@@ -125,16 +134,12 @@ bool wxDialog::IsModalShowing() const
bool wxDialog::Show(bool show) bool wxDialog::Show(bool show)
{ {
if ( !wxDialogBase::Show(show) ) if ( !wxDialogBase::Show(show) )
{
// nothing to do // nothing to do
return false; return false;
}
if ( show ) if ( show )
{
// usually will result in TransferDataToWindow() being called // usually will result in TransferDataToWindow() being called
InitDialog(); InitDialog();
}
if ( m_isModalStyle ) if ( m_isModalStyle )
{ {
@@ -159,7 +164,7 @@ extern bool s_macIsInModalLoop ;
void wxDialog::DoShowModal() void wxDialog::DoShowModal()
{ {
wxCHECK_RET( !IsModalShowing(), _T("DoShowModal() called twice") ); wxCHECK_RET( !IsModalShowing(), wxT("DoShowModal() called twice") );
wxModalDialogs.Append(this); wxModalDialogs.Append(this);
@@ -172,6 +177,7 @@ void wxDialog::DoShowModal()
bool formerModal = s_macIsInModalLoop ; bool formerModal = s_macIsInModalLoop ;
s_macIsInModalLoop = true ; s_macIsInModalLoop = true ;
#endif #endif
while ( IsModalShowing() ) while ( IsModalShowing() )
{ {
wxTheApp->MacDoOneEvent() ; wxTheApp->MacDoOneEvent() ;
@@ -194,6 +200,7 @@ int wxDialog::ShowModal()
SetModal(true); SetModal(true);
Show(true); Show(true);
return GetReturnCode(); return GetReturnCode();
} }