style creation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-07-11 19:52:14 +00:00
parent 31222b7cfa
commit 47ac4f9ba1
2 changed files with 22 additions and 12 deletions

View File

@@ -564,6 +564,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
long style, long style,
const wxString& name ) const wxString& name )
{ {
OSStatus err = noErr ;
SetName(name); SetName(name);
m_windowStyle = style; m_windowStyle = style;
m_isShown = FALSE; m_isShown = FALSE;
@@ -623,7 +624,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
else else
{ {
if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) || if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) ||
HasFlag( wxSYSTEM_MENU ) ) HasFlag( wxCLOSE_BOX ) || HasFlag( wxSYSTEM_MENU ) )
{ {
wclass = kDocumentWindowClass ; wclass = kDocumentWindowClass ;
} }
@@ -637,16 +638,19 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
} }
} }
if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) ) if ( HasFlag( wxMINIMIZE_BOX ) )
{
attr |= kWindowCollapseBoxAttribute ;
}
if ( HasFlag( wxMAXIMIZE_BOX ) )
{ {
attr |= kWindowFullZoomAttribute ; attr |= kWindowFullZoomAttribute ;
attr |= kWindowCollapseBoxAttribute ;
} }
if ( HasFlag( wxRESIZE_BORDER ) ) if ( HasFlag( wxRESIZE_BORDER ) )
{ {
attr |= kWindowResizableAttribute ; attr |= kWindowResizableAttribute ;
} }
if ( HasFlag( wxSYSTEM_MENU ) ) if ( HasFlag( wxCLOSE_BOX) )
{ {
attr |= kWindowCloseBoxAttribute ; attr |= kWindowCloseBoxAttribute ;
} }
@@ -665,16 +669,17 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
customWindowDefSpec.defType = kWindowDefProcPtr; customWindowDefSpec.defType = kWindowDefProcPtr;
customWindowDefSpec.u.defProc = NewWindowDefUPP(wxShapedMacWindowDef); customWindowDefSpec.u.defProc = NewWindowDefUPP(wxShapedMacWindowDef);
::CreateCustomWindow( &customWindowDefSpec, wclass, err = ::CreateCustomWindow( &customWindowDefSpec, wclass,
attr, &theBoundsRect, attr, &theBoundsRect,
(WindowRef*) &m_macWindow); (WindowRef*) &m_macWindow);
} }
else else
#endif #endif
{ {
::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ; err = ::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
} }
wxCHECK_RET( err == noErr, wxT("Mac OS error when trying to create new window") );
wxAssociateWinWithMacWindow( m_macWindow , this ) ; wxAssociateWinWithMacWindow( m_macWindow , this ) ;
UMASetWTitle( (WindowRef)m_macWindow , title ) ; UMASetWTitle( (WindowRef)m_macWindow , title ) ;
::CreateRootControl( (WindowRef)m_macWindow , (ControlHandle*)&m_macRootControl ) ; ::CreateRootControl( (WindowRef)m_macWindow , (ControlHandle*)&m_macRootControl ) ;

View File

@@ -564,6 +564,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
long style, long style,
const wxString& name ) const wxString& name )
{ {
OSStatus err = noErr ;
SetName(name); SetName(name);
m_windowStyle = style; m_windowStyle = style;
m_isShown = FALSE; m_isShown = FALSE;
@@ -623,7 +624,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
else else
{ {
if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) || if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) ||
HasFlag( wxSYSTEM_MENU ) ) HasFlag( wxCLOSE_BOX ) || HasFlag( wxSYSTEM_MENU ) )
{ {
wclass = kDocumentWindowClass ; wclass = kDocumentWindowClass ;
} }
@@ -637,16 +638,19 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
} }
} }
if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) ) if ( HasFlag( wxMINIMIZE_BOX ) )
{
attr |= kWindowCollapseBoxAttribute ;
}
if ( HasFlag( wxMAXIMIZE_BOX ) )
{ {
attr |= kWindowFullZoomAttribute ; attr |= kWindowFullZoomAttribute ;
attr |= kWindowCollapseBoxAttribute ;
} }
if ( HasFlag( wxRESIZE_BORDER ) ) if ( HasFlag( wxRESIZE_BORDER ) )
{ {
attr |= kWindowResizableAttribute ; attr |= kWindowResizableAttribute ;
} }
if ( HasFlag( wxSYSTEM_MENU ) ) if ( HasFlag( wxCLOSE_BOX) )
{ {
attr |= kWindowCloseBoxAttribute ; attr |= kWindowCloseBoxAttribute ;
} }
@@ -665,16 +669,17 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
customWindowDefSpec.defType = kWindowDefProcPtr; customWindowDefSpec.defType = kWindowDefProcPtr;
customWindowDefSpec.u.defProc = NewWindowDefUPP(wxShapedMacWindowDef); customWindowDefSpec.u.defProc = NewWindowDefUPP(wxShapedMacWindowDef);
::CreateCustomWindow( &customWindowDefSpec, wclass, err = ::CreateCustomWindow( &customWindowDefSpec, wclass,
attr, &theBoundsRect, attr, &theBoundsRect,
(WindowRef*) &m_macWindow); (WindowRef*) &m_macWindow);
} }
else else
#endif #endif
{ {
::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ; err = ::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
} }
wxCHECK_RET( err == noErr, wxT("Mac OS error when trying to create new window") );
wxAssociateWinWithMacWindow( m_macWindow , this ) ; wxAssociateWinWithMacWindow( m_macWindow , this ) ;
UMASetWTitle( (WindowRef)m_macWindow , title ) ; UMASetWTitle( (WindowRef)m_macWindow , title ) ;
::CreateRootControl( (WindowRef)m_macWindow , (ControlHandle*)&m_macRootControl ) ; ::CreateRootControl( (WindowRef)m_macWindow , (ControlHandle*)&m_macRootControl ) ;