示例#1
0
void wxStatusBarGeneric::OnPaint(wxPaintEvent& WXUNUSED(event) )
{
    wxPaintDC dc(this);

    dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
#ifdef __WXGTK20__
    // Draw grip first
    if (HasFlag( wxST_SIZEGRIP ))
    {
        int width, height;
        GetClientSize(&width, &height);

        if (GetLayoutDirection() == wxLayout_RightToLeft)
        {
            gtk_paint_resize_grip( m_widget->style,
                               GTK_PIZZA(m_wxwindow)->bin_window,
                               (GtkStateType) GTK_WIDGET_STATE (m_widget),
                               NULL,
                               m_widget,
                               "statusbar",
                               GDK_WINDOW_EDGE_SOUTH_WEST,
                               2, 2, height-2, height-4 );
        }
        else
        {
            gtk_paint_resize_grip( m_widget->style,
                               GTK_PIZZA(m_wxwindow)->bin_window,
                               (GtkStateType) GTK_WIDGET_STATE (m_widget),
                               NULL,
                               m_widget,
                               "statusbar",
                               GDK_WINDOW_EDGE_SOUTH_EAST,
                               width-height-2, 2, height-2, height-4 );
        }
    }
#endif

    if (GetFont().Ok())
        dc.SetFont(GetFont());

    dc.SetBackgroundMode(wxTRANSPARENT);

#ifdef __WXPM__
    wxColour vColor;

    vColor = wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR);
    ::WinFillRect(dc.m_hPS, &dc.m_vRclPaint, vColor.GetPixel());
#endif

    for (int i = 0; i < m_nFields; i ++)
        DrawField(dc, i);
}
示例#2
0
void wxStatusBarGeneric::OnPaint(wxPaintEvent& WXUNUSED(event) )
{
    wxPaintDC dc(this);

#ifdef __WXGTK20__
    // Draw grip first
    if ( ShowsSizeGrip() )
    {
        const wxRect& rc = GetSizeGripRect();
        GdkWindowEdge edge =
            GetLayoutDirection() == wxLayout_RightToLeft ? GDK_WINDOW_EDGE_SOUTH_WEST :
                                                           GDK_WINDOW_EDGE_SOUTH_EAST;
        gtk_paint_resize_grip(gtk_widget_get_style(m_widget),
                            GTKGetDrawingWindow(),
                            gtk_widget_get_state(m_widget),
                            NULL,
                            m_widget,
                            "statusbar",
                            edge,
                            rc.x, rc.y, rc.width, rc.height );
    }
#endif // __WXGTK20__

    if (GetFont().IsOk())
        dc.SetFont(GetFont());

    // compute char height only once for all panes:
    int textHeight = dc.GetCharHeight();

    dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
    for (size_t i = 0; i < m_panes.GetCount(); i ++)
        DrawField(dc, i, textHeight);
}
示例#3
0
static void
run_functions (Test *test)
{
    GtkStyle *style = styles[test->style];
    
    if (test->function & FUNCTION_ARROW)
        gtk_paint_arrow (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, test->arrow_type, test->fill, 0, 0, 10, 10);

    if (test->function & FUNCTION_BOX)
        gtk_paint_box (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10);

    if (test->function & FUNCTION_SHADOW)
        gtk_paint_shadow (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10);

    if (test->function & FUNCTION_BOX_GAP)
        gtk_paint_box_gap (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10, test->gap_side, 0, 100);

    if (test->function & FUNCTION_SHADOW_GAP)
        gtk_paint_shadow_gap (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10, test->gap_side, 0, 100);


    if (test->function & FUNCTION_CHECK)
        gtk_paint_check (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10);
        
    if (test->function & FUNCTION_EXPANDER)
        gtk_paint_expander (style, window->window, test->state, NULL, widgets[test->widget], test->detail, 10, 10, test->expander_style);

    if (test->function & FUNCTION_EXTENSION)
        gtk_paint_extension (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10, test->gap_side);

    if (test->function & FUNCTION_FLAT_BOX)
        gtk_paint_flat_box (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10);

    if (test->function & FUNCTION_FOCUS)
        gtk_paint_focus (style, window->window, test->state, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10);

    if (test->function & FUNCTION_HANDLE)
        gtk_paint_handle (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10, test->orientation);

    if (test->function & FUNCTION_OPTION)
        gtk_paint_option (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10);

    if (test->function & FUNCTION_RESIZE_GRIP)
        gtk_paint_resize_grip (style, window->window, test->state, NULL, widgets[test->widget], test->detail, test->edge, 0, 0, 10, 10);

    if (test->function & FUNCTION_SLIDER)
        gtk_paint_slider (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10, test->orientation);

    if (test->function & FUNCTION_TAB)
        gtk_paint_tab (style, window->window, test->state, test->shadow, NULL, widgets[test->widget], test->detail, 0, 0, 10, 10);


    if (test->function & FUNCTION_HLINE)
        gtk_paint_hline (style, window->window, test->state, NULL, widgets[test->widget], test->detail, 1, 10, 4);

    if (test->function & FUNCTION_VLINE)
        gtk_paint_vline (style, window->window, test->state, NULL, widgets[test->widget], test->detail, 1, 10, 4);
}
示例#4
0
void wxStatusBarGeneric::OnPaint(wxPaintEvent& WXUNUSED(event) )
{
    wxPaintDC dc(this);

#ifdef __WXGTK20__
    // Draw grip first
    if ( ShowsSizeGrip() )
    {
        const wxRect& rc = GetSizeGripRect();
#ifdef __WXGTK3__
        GtkWidget* toplevel = gtk_widget_get_toplevel(m_widget);
        GdkRectangle rect;
        if (toplevel && (!gtk_window_get_resize_grip_area(GTK_WINDOW(toplevel), &rect) ||
            rect.width == 0 || rect.height == 0))
        {
            GtkStyleContext* sc = gtk_widget_get_style_context(toplevel);
            gtk_style_context_save(sc);
            gtk_style_context_add_class(sc, GTK_STYLE_CLASS_GRIP);
            GtkJunctionSides sides = GTK_JUNCTION_CORNER_BOTTOMRIGHT;
            if (GetLayoutDirection() == wxLayout_RightToLeft)
                sides = GTK_JUNCTION_CORNER_BOTTOMLEFT;
            gtk_style_context_set_junction_sides(sc, sides);
            gtk_render_handle(sc,
                static_cast<cairo_t*>(dc.GetImpl()->GetCairoContext()),
                rc.x, rc.y, rc.width, rc.height);
            gtk_style_context_restore(sc);
        }
#else
        GdkWindowEdge edge =
            GetLayoutDirection() == wxLayout_RightToLeft ? GDK_WINDOW_EDGE_SOUTH_WEST :
                                                           GDK_WINDOW_EDGE_SOUTH_EAST;
        gtk_paint_resize_grip(gtk_widget_get_style(m_widget),
                            GTKGetDrawingWindow(),
                            gtk_widget_get_state(m_widget),
                            NULL,
                            m_widget,
                            "statusbar",
                            edge,
                            rc.x, rc.y, rc.width, rc.height );
#endif
    }
#endif // __WXGTK20__

    if (GetFont().IsOk())
        dc.SetFont(GetFont());

    // compute char height only once for all panes:
    int textHeight = dc.GetCharHeight();

    dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
    for (size_t i = 0; i < m_panes.GetCount(); i ++)
        DrawField(dc, i, textHeight);
}
示例#5
0
static VALUE
style_paint_resize_grip(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE area, VALUE widget, VALUE detail, VALUE edge, VALUE x, VALUE y, VALUE width, VALUE height)
{
    gtk_paint_resize_grip(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)),
                          RVAL2STATE(state_type), RVAL2REC(area),
                          GTK_WIDGET(RVAL2GOBJ(widget)), 
                          NIL_P(detail) ? NULL : RVAL2CSTR(detail),
                          RVAL2GENUM(edge, GDK_TYPE_WINDOW_EDGE), 
                          NUM2INT(x), NUM2INT(y), 
                          NUM2INT(width), NUM2INT(height));
    return self;
}
示例#6
0
void wxStatusBarGeneric::OnPaint(wxPaintEvent& WXUNUSED(event) )
{
    wxPaintDC dc(this);

#ifdef __WXGTK20__
    // Draw grip first
    if ( ShowsSizeGrip() )
    {
        const wxRect& rc = GetSizeGripRect();
#ifdef __WXGTK3__
        GtkWidget* toplevel = gtk_widget_get_toplevel(m_widget);
        GdkRectangle rect;
        wxGCC_WARNING_SUPPRESS(deprecated-declarations)
        if (toplevel && (!gtk_window_get_resize_grip_area(GTK_WINDOW(toplevel), &rect) ||
            rect.width == 0 || rect.height == 0))
        wxGCC_WARNING_RESTORE()
        {
            GtkStyleContext* sc = gtk_widget_get_style_context(toplevel);
            gtk_style_context_save(sc);
            gtk_style_context_add_class(sc, GTK_STYLE_CLASS_GRIP);
            GtkJunctionSides sides = GTK_JUNCTION_CORNER_BOTTOMRIGHT;
            if (GetLayoutDirection() == wxLayout_RightToLeft)
                sides = GTK_JUNCTION_CORNER_BOTTOMLEFT;
            gtk_style_context_set_junction_sides(sc, sides);
            gtk_render_handle(sc,
                static_cast<cairo_t*>(dc.GetImpl()->GetCairoContext()),
                rc.x, rc.y, rc.width, rc.height);
            gtk_style_context_restore(sc);
        }
#else
        GdkWindowEdge edge =
            GetLayoutDirection() == wxLayout_RightToLeft ? GDK_WINDOW_EDGE_SOUTH_WEST :
                                                           GDK_WINDOW_EDGE_SOUTH_EAST;
        gtk_paint_resize_grip(gtk_widget_get_style(m_widget),
                            GTKGetDrawingWindow(),
                            gtk_widget_get_state(m_widget),
                            NULL,
                            m_widget,
                            "statusbar",
                            edge,
                            rc.x, rc.y, rc.width, rc.height );
#endif
    }