wxWindow* wx = (wxWindow*) wxFindControlFromMacControl( iControl ) ;
if ( wx != NULL )
{
- /*
const wxBrush &brush = wx->MacGetBackgroundBrush() ;
if ( brush.Ok() )
{
-
wxDC::MacSetupBackgroundForCurrentPort( brush ) ;
- */
- // this clipping is only needed for non HIView
RgnHandle clip = NewRgn() ;
int x = 0 , y = 0;
DisposeRgn( clip ) ;
status = noErr ;
- /*
}
else if ( wx->MacIsUserPane() )
{
// setup of our parent ourselves
status = SetUpControlBackground( (ControlRef) wx->GetParent()->GetHandle() , iDepth , iIsColor ) ;
}
- */
}
}
break ;
#if !TARGET_API_MAC_OSX
// eventually we can fix some clipping issues be reactivating this hook
//if ( m_macIsUserPane )
- // SetControlColorProc( *m_peer , wxMacSetupControlBackgroundUPP ) ;
+ // SetControlColorProc( m_peer->GetControlRef() , wxMacSetupControlBackgroundUPP ) ;
#endif
m_peer->SetTitle( wxStripMenuCodes(m_label) ) ;
{
// only under OSX the visibility of the TLW is taken into account
#if TARGET_API_MAC_OSX
- return m_peer->IsVisible();
-#else
+ if ( m_peer && m_peer->Ok() )
+ return m_peer->IsVisible();
+#endif
wxWindow* win = this ;
while( win->IsShown() )
{
} ;
return false ;
-#endif
}
bool wxWindowMac::MacIsReallyEnabled()
void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect)
{
+ if ( m_peer == NULL )
+ return ;
+
#if TARGET_API_MAC_OSX
if ( rect == NULL )
m_peer->SetNeedsDisplay( true ) ;
void wxWindowMac::OnEraseBackground(wxEraseEvent& event)
{
+#if TARGET_API_MAC_OSX
if ( m_macBackgroundBrush.Ok() == false || m_macBackgroundBrush.GetStyle() == wxTRANSPARENT )
{
event.Skip() ;
}
else
+#endif
event.GetDC()->Clear() ;
}
int major,minor;
wxGetOsVersion( &major, &minor );
- RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ;
- RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ;
-
RGBColor darkShadow = { 0x0000, 0x0000 , 0x0000 } ;
RGBColor lightShadow = { 0x4444, 0x4444 , 0x4444 } ;
// OS X has lighter border edges than classic:
InsetRect( &rect , border , border );
DrawThemeEditTextFrame(&rect,IsEnabled() ? kThemeStateActive : kThemeStateInactive) ;
#else
+ RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ;
+ RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ;
+
bool sunken = HasFlag( wxSUNKEN_BORDER ) ;
RGBForeColor( &face );
MoveTo( left + 0 , top + h - 2 );
{
wxASSERT_MSG( m_vScrollBar == NULL && m_hScrollBar == NULL , wxT("attempt to create window twice") ) ;
+#if 0
+
bool hasBoth = ( style & wxVSCROLL ) && ( style & wxHSCROLL ) ;
int adjust = hasBoth ? MAC_SCROLLBAR_SIZE - 1: 0 ;
int width, height ;
{
m_hScrollBar->Show(false) ;
}
+#else
+ if ( style & ( wxVSCROLL | wxHSCROLL ) )
+ {
+ bool hasBoth = ( style & wxVSCROLL ) && ( style & wxHSCROLL ) ;
+ int adjust = hasBoth ? MAC_SCROLLBAR_SIZE - 1: 0 ;
+ int width, height ;
+ GetClientSize( &width , &height ) ;
+
+ wxPoint vPoint(width-MAC_SCROLLBAR_SIZE, 0) ;
+ wxSize vSize(MAC_SCROLLBAR_SIZE, height - adjust) ;
+ wxPoint hPoint(0 , height-MAC_SCROLLBAR_SIZE ) ;
+ wxSize hSize( width - adjust, MAC_SCROLLBAR_SIZE) ;
+
+
+ if ( style & wxVSCROLL )
+ {
+ m_vScrollBar = new wxScrollBar(this, wxWINDOW_VSCROLL, vPoint,
+ vSize , wxVERTICAL);
+ }
+
+ if ( style & wxHSCROLL )
+ {
+ m_hScrollBar = new wxScrollBar(this, wxWINDOW_HSCROLL, hPoint,
+ hSize , wxHORIZONTAL);
+ }
+ }
+#endif
+
// because the create does not take into account the client area origin
MacRepositionScrollBars() ; // we might have a real position shift
void wxWindowMac::MacRepositionScrollBars()
{
+ if ( !m_hScrollBar && !m_vScrollBar )
+ return ;
+
bool hasBoth = ( m_hScrollBar && m_hScrollBar->IsShown()) && ( m_vScrollBar && m_vScrollBar->IsShown()) ;
int adjust = hasBoth ? MAC_SCROLLBAR_SIZE - 1 : 0 ;