void wxAuiDefaultDockArt::DrawSash(wxDC& dc, wxWindow *window, int orientation, const wxRect& rect) { #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON wxUnusedVar(window); wxUnusedVar(orientation); HIRect splitterRect = CGRectMake( rect.x , rect.y , rect.width , rect.height ); CGContextRef cgContext ; wxGCDCImpl *impl = (wxGCDCImpl*) dc.GetImpl(); cgContext = (CGContextRef) impl->GetGraphicsContext()->GetNativeContext() ; HIThemeSplitterDrawInfo drawInfo ; drawInfo.version = 0 ; drawInfo.state = kThemeStateActive ; drawInfo.adornment = kHIThemeSplitterAdornmentNone ; HIThemeDrawPaneSplitter( &splitterRect , &drawInfo , cgContext , kHIThemeOrientationNormal ) ; #elif defined(__WXGTK__) // clear out the rectangle first dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(m_sash_brush); dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); #if 0 GdkRectangle gdk_rect; if (orientation == wxVERTICAL ) { gdk_rect.x = rect.x; gdk_rect.y = rect.y; gdk_rect.width = m_sash_size; gdk_rect.height = rect.height; } else { gdk_rect.x = rect.x; gdk_rect.y = rect.y; gdk_rect.width = rect.width; gdk_rect.height = m_sash_size; } #endif if (!window) return; if (!window->m_wxwindow) return; if (!gtk_widget_is_drawable(window->m_wxwindow)) return; gtk_paint_handle ( gtk_widget_get_style(window->m_wxwindow), window->GTKGetDrawingWindow(), // flags & wxCONTROL_CURRENT ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL, GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL /* no clipping */, window->m_wxwindow, "paned", rect.x, rect.y, rect.width, rect.height, (orientation == wxVERTICAL) ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL ); #else wxUnusedVar(window); wxUnusedVar(orientation); dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(m_sash_brush); dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); #endif }
void wxAuiDefaultDockArt::DrawSash(wxDC& dc, wxWindow *window, int orientation, const wxRect& rect) { #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON wxUnusedVar(window); wxUnusedVar(orientation); HIRect splitterRect = CGRectMake( rect.x , rect.y , rect.width , rect.height ); CGContextRef cgContext ; wxGCDCImpl *impl = (wxGCDCImpl*) dc.GetImpl(); cgContext = (CGContextRef) impl->GetGraphicsContext()->GetNativeContext() ; HIThemeSplitterDrawInfo drawInfo ; drawInfo.version = 0 ; drawInfo.state = kThemeStateActive ; drawInfo.adornment = kHIThemeSplitterAdornmentNone ; HIThemeDrawPaneSplitter( &splitterRect , &drawInfo , cgContext , kHIThemeOrientationNormal ) ; #elif defined(__WXGTK__) // clear out the rectangle first dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(m_sashBrush); dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); #if 0 GdkRectangle gdk_rect; if (orientation == wxVERTICAL ) { gdk_rect.x = rect.x; gdk_rect.y = rect.y; gdk_rect.width = m_sashSize; gdk_rect.height = rect.height; } else { gdk_rect.x = rect.x; gdk_rect.y = rect.y; gdk_rect.width = rect.width; gdk_rect.height = m_sashSize; } #endif if (!window) return; if (!window->m_wxwindow) return; if (!gtk_widget_is_drawable(window->m_wxwindow)) return; #ifdef __WXGTK3__ cairo_t* cr = static_cast<cairo_t*>(dc.GetGraphicsContext()->GetNativeContext()); // invert orientation for widget (horizontal GtkPaned has a vertical splitter) wxOrientation orient = orientation == wxVERTICAL ? wxHORIZONTAL : wxVERTICAL; GtkWidget* widget = wxGTKPrivate::GetSplitterWidget(orient); GtkStyleContext* sc = gtk_widget_get_style_context(widget); gtk_style_context_save(sc); gtk_style_context_add_class(sc, GTK_STYLE_CLASS_PANE_SEPARATOR); gtk_render_handle(sc, cr, rect.x, rect.y, rect.width, rect.height); gtk_style_context_restore(sc); #else gtk_paint_handle ( gtk_widget_get_style(window->m_wxwindow), window->GTKGetDrawingWindow(), // flags & wxCONTROL_CURRENT ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL, GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL /* no clipping */, window->m_wxwindow, "paned", rect.x, rect.y, rect.width, rect.height, (orientation == wxVERTICAL) ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL ); #endif // !__WXGTK3__ #else wxUnusedVar(window); wxUnusedVar(orientation); dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(m_sashBrush); dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); #endif }
void wxAuiDefaultDockArt::DrawSash(wxDC& dc, wxWindow *window, int orientation, const wxRect& rect) { #if defined(__WXMAC__) HIRect splitterRect = CGRectMake( rect.x , rect.y , rect.width , rect.height ); CGContextRef cgContext ; #if wxMAC_USE_CORE_GRAPHICS cgContext = (CGContextRef) dc.GetGraphicsContext()->GetNativeContext() ; #else Rect bounds ; GetPortBounds( (CGrafPtr) dc.m_macPort , &bounds ) ; QDBeginCGContext( (CGrafPtr) dc.m_macPort , &cgContext ) ; CGContextTranslateCTM( cgContext , 0 , bounds.bottom - bounds.top ) ; CGContextScaleCTM( cgContext , 1 , -1 ) ; if ( window ) { wxPoint origin = window->GetClientAreaOrigin(); int x, y; x = origin.x; y = origin.y; window->MacWindowToRootWindow( &x , &y ); CGContextTranslateCTM( cgContext, x, y); } #endif HIThemeSplitterDrawInfo drawInfo ; drawInfo.version = 0 ; drawInfo.state = kThemeStateActive ; drawInfo.adornment = kHIThemeSplitterAdornmentNone ; HIThemeDrawPaneSplitter( &splitterRect , &drawInfo , cgContext , kHIThemeOrientationNormal ) ; #if wxMAC_USE_CORE_GRAPHICS #else QDEndCGContext( (CGrafPtr) dc.m_macPort , &cgContext ) ; #endif #elif defined(__WXGTK__) // clear out the rectangle first dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(m_sash_brush); dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); GdkRectangle gdk_rect; if (orientation == wxVERTICAL ) { gdk_rect.x = rect.x; gdk_rect.y = rect.y; gdk_rect.width = m_sash_size; gdk_rect.height = rect.height; } else { gdk_rect.x = rect.x; gdk_rect.y = rect.y; gdk_rect.width = rect.width; gdk_rect.height = m_sash_size; } if (!window) return; if (!window->m_wxwindow) return; if (!GTK_PIZZA(window->m_wxwindow)->bin_window) return; gtk_paint_handle ( window->m_wxwindow->style, GTK_PIZZA(window->m_wxwindow)->bin_window, // flags & wxCONTROL_CURRENT ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL, GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL /* no clipping */, window->m_wxwindow, "paned", rect.x, rect.y, rect.width, rect.height, (orientation == wxVERTICAL) ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL ); #else wxUnusedVar(window); wxUnusedVar(orientation); dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(m_sash_brush); dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); #endif }