virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
virtual void SetBackgroundColour( const wxColour& col );
+ virtual bool SetBackgroundStyle(wxBackgroundStyle style);
virtual ControlPartCode HandleKey( SInt16 keyCode, SInt16 charCode, EventModifiers modifiers );
void SetActionProc( ControlActionUPP actionProc );
SInt32 GetViewSize() const;
virtual WXWidget GetWXWidget() const { return m_osxView; }
virtual void SetBackgroundColour(const wxColour&);
+ virtual bool SetBackgroundStyle(wxBackgroundStyle style);
virtual void GetContentArea( int &left , int &top , int &width , int &height ) const;
virtual void Move(int x, int y, int width, int height);
virtual WXWidget GetWXWidget() const = 0;
virtual void SetBackgroundColour( const wxColour& col ) = 0;
+ virtual bool SetBackgroundStyle(wxBackgroundStyle style) = 0;
// all coordinates in native parent widget relative coordinates
virtual void GetContentArea( int &left , int &top , int &width , int &height ) const = 0;
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
+ virtual bool SetBackgroundStyle(wxBackgroundStyle style);
+
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
void wxMacControl::Move(int x, int y, int width, int height)
{
+ UInt32 attr = 0 ;
+ GetWindowAttributes( GetControlOwner(m_controlRef) , &attr ) ;
+
HIRect hir = CGRectMake(x,y,width,height);
+ if ( !(attr & kWindowCompositingAttribute) )
+ {
+ HIRect parent;
+ HIViewGetFrame( HIViewGetSuperview(m_controlRef), &parent );
+ hir.origin.x += parent.origin.x;
+ hir.origin.y += parent.origin.y;
+ }
HIViewSetFrame ( m_controlRef , &hir );
}
GetControlBounds( m_controlRef , &r );
x = r.left;
y = r.top;
+
+ UInt32 attr = 0 ;
+ GetWindowAttributes( GetControlOwner(m_controlRef) , &attr ) ;
+
+ if ( !(attr & kWindowCompositingAttribute) )
+ {
+ HIRect parent;
+ HIViewGetFrame( HIViewGetSuperview(m_controlRef), &parent );
+ x -= parent.origin.x;
+ y -= parent.origin.y;
+ }
+
}
void wxMacControl::GetSize( int &width, int &height ) const
// HITextViewSetBackgroundColor( m_textView , color );
}
+bool wxMacControl::SetBackgroundStyle(wxBackgroundStyle style)
+{
+ if ( style != wxBG_STYLE_PAINT )
+ {
+ OSStatus err = HIViewChangeFeatures(m_controlRef , 0 , kHIViewIsOpaque);
+ verify_noerr( err );
+ }
+ else
+ {
+ OSStatus err = HIViewChangeFeatures(m_controlRef , kHIViewIsOpaque , 0);
+ verify_noerr( err );
+ }
+
+ return true ;
+}
+
void wxMacControl::SetRange( SInt32 minimum , SInt32 maximum )
{
::SetControl32BitMinimum( m_controlRef , minimum );
OffsetRect( r , (short) hiPoint.x , (short) hiPoint.y ) ;
}
}
-
+
void wxMacControl::GetBestRect( wxRect *rect ) const
{
short baselineoffset;
- (void)setAction:(SEL)aSelector;
- (void)setDoubleAction:(SEL)aSelector;
- (void)setBackgroundColor:(NSColor*)aColor;
+- (void)setOpaque:(BOOL)opaque;
- (void)setTextColor:(NSColor *)color;
- (void)setImagePosition:(NSCellImagePosition)aPosition;
@end
}
}
+bool wxWidgetCocoaImpl::SetBackgroundStyle( wxBackgroundStyle style )
+{
+ BOOL opaque = ( style == wxBG_STYLE_PAINT );
+
+ if ( [m_osxView respondsToSelector:@selector(setOpaque:) ] )
+ {
+ [m_osxView setOpaque: opaque];
+ }
+
+ return true ;
+}
+
void wxWidgetCocoaImpl::SetLabel( const wxString& title, wxFontEncoding encoding )
{
if ( [m_osxView respondsToSelector:@selector(setTitle:) ] )
wxWidgetCocoaImpl* c = NULL;
if ( now->IsNativeWindowWrapper() )
{
- c = new wxWidgetCocoaImpl( now, [tlw contentView], true );
+ NSView* cv = [tlw contentView];
+ c = new wxWidgetCocoaImpl( now, cv, true );
+ // increase ref count, because the impl destructor will decrement it again
+ CFRetain(cv);
+ if ( !now->IsShown() )
+ [cv setHidden:NO];
+
}
else
{
return retval;
}
+bool wxWindowMac::SetBackgroundStyle(wxBackgroundStyle style)
+{
+ if ( !wxWindowBase::SetBackgroundStyle(style) )
+ return false;
+
+ if ( m_peer )
+ m_peer->SetBackgroundStyle(style);
+ return true;
+}
+
bool wxWindowMac::SetBackgroundColour(const wxColour& col )
{
if (m_growBox)