+void wxWindowMac::MacCreateRealWindow( const wxString& title,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style,
+ const wxString& name )
+{
+ SetName(name);
+ m_windowStyle = style;
+ m_isShown = FALSE;
+
+ // create frame.
+
+ Rect theBoundsRect;
+
+ m_x = (int)pos.x;
+ m_y = (int)pos.y;
+ if ( m_y < 50 )
+ m_y = 50 ;
+ if ( m_x < 20 )
+ m_x = 20 ;
+
+ m_width = size.x;
+ if (m_width == -1)
+ m_width = 20;
+ m_height = size.y;
+ if (m_height == -1)
+ m_height = 20;
+
+ m_macWindowData = new MacWindowData() ;
+
+ ::SetRect(&theBoundsRect, m_x, m_y , m_x + m_width, m_y + m_height);
+
+ // translate the window attributes in the appropriate window class and attributes
+
+ WindowClass wclass = 0;
+ WindowAttributes attr = kWindowNoAttributes ;
+
+ if ( HasFlag(wxTINY_CAPTION_HORIZ) || HasFlag(wxTINY_CAPTION_VERT) )
+ {
+ wclass = kFloatingWindowClass ;
+ if ( HasFlag(wxTINY_CAPTION_VERT) )
+ {
+ attr |= kWindowSideTitlebarAttribute ;
+ }
+ }
+ else if ( HasFlag( wxCAPTION ) )
+ {
+ if ( HasFlag( wxDIALOG_MODAL ) )
+ {
+ wclass = kMovableModalWindowClass ;
+ }
+ else
+ {
+ wclass = kDocumentWindowClass ;
+ }
+ }
+ else
+ {
+ wclass = kModalWindowClass ;
+ }
+
+ if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) )
+ {
+ attr |= kWindowFullZoomAttribute ;
+ attr |= kWindowCollapseBoxAttribute ;
+ }
+ if ( HasFlag( wxRESIZE_BORDER ) )
+ {
+ attr |= kWindowResizableAttribute ;
+ }
+ if ( HasFlag( wxSYSTEM_MENU ) )
+ {
+ attr |= kWindowCloseBoxAttribute ;
+ }
+
+ ::CreateNewWindow( wclass , attr , &theBoundsRect , &m_macWindowData->m_macWindow ) ;
+ wxAssociateWinWithMacWindow( m_macWindowData->m_macWindow , this ) ;
+ wxString label ;
+ if( wxApp::s_macDefaultEncodingIsPC )
+ label = wxMacMakeMacStringFromPC( title ) ;
+ else
+ label = title ;
+ UMASetWTitleC( m_macWindowData->m_macWindow , label ) ;
+ ::CreateRootControl( m_macWindowData->m_macWindow , &m_macWindowData->m_macRootControl ) ;
+
+ m_macWindowData->m_macFocus = NULL ;
+ m_macWindowData->m_macHasReceivedFirstActivate = true ;
+}
+
+void wxWindowMac::MacPaint( wxPaintEvent &event )
+{
+}
+
+void wxWindowMac::MacPaintBorders( )
+{
+ if( m_macWindowData )
+ return ;
+
+ RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ;
+ RGBColor black = { 0x0000, 0x0000 , 0x0000 } ;
+ RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ;
+ RGBColor shadow = { 0x4444, 0x4444 , 0x4444 } ;
+ PenNormal() ;
+
+ if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) )
+ {
+ bool sunken = HasFlag( wxSUNKEN_BORDER ) ;
+ RGBForeColor( &face );
+ MoveTo( 0 , m_height - 2 );
+ LineTo( 0 , 0 );
+ LineTo( m_width - 2 , 0 );
+
+ MoveTo( 2 , m_height - 3 );
+ LineTo( m_width - 3 , m_height - 3 );
+ LineTo( m_width - 3 , 2 );
+
+ RGBForeColor( sunken ? &face : &black );
+ MoveTo( 0 , m_height - 1 );
+ LineTo( m_width - 1 , m_height - 1 );
+ LineTo( m_width - 1 , 0 );
+
+ RGBForeColor( sunken ? &shadow : &white );
+ MoveTo( 1 , m_height - 3 );
+ LineTo( 1, 1 );
+ LineTo( m_width - 3 , 1 );
+
+ RGBForeColor( sunken ? &white : &shadow );
+ MoveTo( 1 , m_height - 2 );
+ LineTo( m_width - 2 , m_height - 2 );
+ LineTo( m_width - 2 , 1 );
+
+ RGBForeColor( sunken ? &black : &face );
+ MoveTo( 2 , m_height - 4 );
+ LineTo( 2 , 2 );
+ LineTo( m_width - 4 , 2 );
+ }
+ else if (HasFlag(wxSIMPLE_BORDER))
+ {
+ Rect rect = { 0 , 0 , m_height , m_width } ;
+ RGBForeColor( &black ) ;
+ FrameRect( &rect ) ;
+ }
+}
+