Backported theme code to 2.2 branch.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -25,6 +25,11 @@
|
||||
#include "wx/generic/imaglist.h"
|
||||
#include "wx/dynarray.h"
|
||||
|
||||
#ifdef __WXGTK__
|
||||
#include <gtk/gtk.h>
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
#endif
|
||||
|
||||
#ifndef wxUSE_GENERIC_LIST_EXTENSIONS
|
||||
#define wxUSE_GENERIC_LIST_EXTENSIONS 1
|
||||
#endif
|
||||
@@ -730,6 +735,23 @@ void wxListLineData::CalculateSize( wxDC *dc, int spacing )
|
||||
m_bound_all.width = 0;
|
||||
m_bound_all.height = 0;
|
||||
wxNode *node = m_items.First();
|
||||
if (node)
|
||||
{
|
||||
wxListItemData *item = (wxListItemData*)node->Data();
|
||||
if (item->HasImage())
|
||||
{
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
m_owner->GetImageSize( item->GetImage(), w, h );
|
||||
m_bound_icon.width = w;
|
||||
m_bound_icon.height = h;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bound_icon.width = 0;
|
||||
m_bound_icon.height = 0;
|
||||
}
|
||||
}
|
||||
while (node)
|
||||
{
|
||||
wxListItemData *item = (wxListItemData*)node->Data();
|
||||
@@ -1173,6 +1195,15 @@ wxListHeaderWindow::~wxListHeaderWindow( void )
|
||||
|
||||
void wxListHeaderWindow::DoDrawRect( wxDC *dc, int x, int y, int w, int h )
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
GtkStateType state = GTK_STATE_NORMAL;
|
||||
if (!m_parent->IsEnabled()) state = GTK_STATE_INSENSITIVE;
|
||||
|
||||
x = dc->XLOG2DEV( x );
|
||||
|
||||
gtk_paint_box (m_wxwindow->style, GTK_PIZZA(m_wxwindow)->bin_window, state, GTK_SHADOW_OUT,
|
||||
(GdkRectangle*) NULL, m_wxwindow, "button", x-1, y-1, w+2, h+2);
|
||||
#else
|
||||
const int m_corner = 1;
|
||||
|
||||
dc->SetBrush( *wxTRANSPARENT_BRUSH );
|
||||
@@ -1192,6 +1223,7 @@ void wxListHeaderWindow::DoDrawRect( wxDC *dc, int x, int y, int w, int h )
|
||||
dc->DrawRectangle( x, y, 1, h ); // left (outer)
|
||||
dc->DrawLine( x, y+h-1, x+1, y+h-1 );
|
||||
dc->DrawLine( x+w-1, y, x+w-1, y+1 );
|
||||
#endif
|
||||
}
|
||||
|
||||
// shift the DC origin to match the position of the main window horz
|
||||
@@ -1231,7 +1263,8 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
|
||||
// do *not* use the listctrl colour for headers - one day we will have a
|
||||
// function to set it separately
|
||||
dc.SetTextForeground( *wxBLACK );
|
||||
// dc.SetTextForeground( *wxBLACK );
|
||||
dc.SetTextForeground(wxSystemSettings::GetSystemColour( wxSYS_COLOUR_WINDOWTEXT ));
|
||||
|
||||
int x = 1; // left of the header rect
|
||||
const int y = 1; // top
|
||||
@@ -2500,6 +2533,7 @@ void wxListMainWindow::SetItemState( long item, long state, long stateMask )
|
||||
UnfocusLine( m_current );
|
||||
m_current = line;
|
||||
FocusLine( m_current );
|
||||
if ((m_mode & wxLC_SINGLE_SEL) && oldCurrent) oldCurrent->Hilight( FALSE );
|
||||
RefreshLine( m_current );
|
||||
if (oldCurrent) RefreshLine( oldCurrent );
|
||||
}
|
||||
@@ -2915,7 +2949,7 @@ long wxListMainWindow::HitTest( int x, int y, int &flags )
|
||||
{
|
||||
wxListLineData *line = &m_lines[i];
|
||||
long ret = line->IsHit( x, y );
|
||||
if (ret & flags)
|
||||
if (ret) // & flags) // No: flags is output-only so may be garbage at this point
|
||||
{
|
||||
flags = (int)ret;
|
||||
return count;
|
||||
|
@@ -321,6 +321,33 @@ gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget), wxFrame *win )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "expose_event" of m_client
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindow *win )
|
||||
{
|
||||
GtkPizza *pizza = GTK_PIZZA(widget);
|
||||
|
||||
gtk_paint_flat_box (win->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_NONE, &gdk_event->area, win->m_widget, "base", 0, 0, -1, -1);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "draw" of m_client
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxWindow *win )
|
||||
{
|
||||
GtkPizza *pizza = GTK_PIZZA(widget);
|
||||
|
||||
gtk_paint_flat_box (win->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_NONE, rect, win->m_widget, "base", 0, 0, -1, -1);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFrame itself
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -394,6 +421,7 @@ void wxFrame::Init()
|
||||
m_menuBarDetached = FALSE;
|
||||
m_toolBarDetached = FALSE;
|
||||
m_insertInClientArea = TRUE;
|
||||
m_isFrame = TRUE;
|
||||
}
|
||||
|
||||
bool wxFrame::Create( wxWindow *parent,
|
||||
@@ -445,6 +473,13 @@ bool wxFrame::Create( wxWindow *parent,
|
||||
GTK_WIDGET_UNSET_FLAGS( m_mainWidget, GTK_CAN_FOCUS );
|
||||
gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget );
|
||||
|
||||
|
||||
/* for m_mainWidget themes */
|
||||
gtk_signal_connect( GTK_OBJECT(m_mainWidget), "expose_event",
|
||||
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
|
||||
gtk_signal_connect( GTK_OBJECT(m_mainWidget), "draw",
|
||||
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
debug_focus_in( m_mainWidget, wxT("wxFrame::m_mainWidget"), name );
|
||||
#endif
|
||||
|
@@ -297,7 +297,7 @@ wxMDIChildFrame::wxMDIChildFrame()
|
||||
{
|
||||
m_menuBar = (wxMenuBar *) NULL;
|
||||
m_page = (GtkNotebookPage *) NULL;
|
||||
m_isFrame = TRUE;
|
||||
m_isFrame = FALSE;
|
||||
}
|
||||
|
||||
wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
|
||||
@@ -307,7 +307,7 @@ wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
|
||||
{
|
||||
m_menuBar = (wxMenuBar *) NULL;
|
||||
m_page = (GtkNotebookPage *) NULL;
|
||||
m_isFrame = TRUE;
|
||||
m_isFrame = FALSE;
|
||||
Create( parent, id, title, wxDefaultPosition, size, style, name );
|
||||
}
|
||||
|
||||
|
@@ -69,6 +69,7 @@ wxColour *g_systemBtnHighlightColour = (wxColour *) NULL;
|
||||
wxColour *g_systemHighlightColour = (wxColour *) NULL;
|
||||
wxColour *g_systemHighlightTextColour = (wxColour *) NULL;
|
||||
wxColour *g_systemListBoxColour = (wxColour *) NULL;
|
||||
wxColour *g_systemBtnTextColour = (wxColour *) NULL;
|
||||
|
||||
wxFont *g_systemFont = (wxFont *) NULL;
|
||||
|
||||
@@ -82,6 +83,7 @@ void wxSystemSettings::Done()
|
||||
delete g_systemHighlightTextColour;
|
||||
delete g_systemListBoxColour;
|
||||
delete g_systemFont;
|
||||
delete g_systemBtnTextColour;
|
||||
}
|
||||
|
||||
wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
@@ -97,7 +99,36 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
case wxSYS_COLOUR_ACTIVEBORDER:
|
||||
case wxSYS_COLOUR_INACTIVEBORDER:
|
||||
case wxSYS_COLOUR_BTNFACE:
|
||||
case wxSYS_COLOUR_3DLIGHT:
|
||||
{
|
||||
if (!g_systemBtnFaceColour)
|
||||
{
|
||||
GtkWidget *widget = gtk_button_new();
|
||||
GtkStyle *def = gtk_rc_get_style( widget );
|
||||
if (!def)
|
||||
def = gtk_widget_get_default_style();
|
||||
if (def)
|
||||
{
|
||||
int red = def->bg[GTK_STATE_NORMAL].red;
|
||||
int green = def->bg[GTK_STATE_NORMAL].green;
|
||||
int blue = def->bg[GTK_STATE_NORMAL].blue;
|
||||
g_systemBtnFaceColour =
|
||||
new wxColour( red >> SHIFT,
|
||||
green >> SHIFT,
|
||||
blue >> SHIFT );
|
||||
}
|
||||
else
|
||||
{
|
||||
g_systemBtnFaceColour =
|
||||
new wxColour( 0 >> SHIFT,
|
||||
0 >> SHIFT,
|
||||
0x9c40 >> SHIFT );
|
||||
}
|
||||
gtk_widget_destroy( widget );
|
||||
|
||||
}
|
||||
return *g_systemBtnFaceColour;
|
||||
/*
|
||||
if (!g_systemBtnFaceColour)
|
||||
{
|
||||
g_systemBtnFaceColour =
|
||||
@@ -106,14 +137,29 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
0xd6d6 >> SHIFT );
|
||||
}
|
||||
return *g_systemBtnFaceColour;
|
||||
*/
|
||||
}
|
||||
case wxSYS_COLOUR_WINDOW:
|
||||
{
|
||||
return *wxWHITE;
|
||||
}
|
||||
case wxSYS_COLOUR_3DDKSHADOW:
|
||||
{
|
||||
return *wxBLACK;
|
||||
}
|
||||
case wxSYS_COLOUR_GRAYTEXT:
|
||||
case wxSYS_COLOUR_BTNSHADOW:
|
||||
//case wxSYS_COLOUR_3DSHADOW:
|
||||
{
|
||||
if (!g_systemBtnShadowColour)
|
||||
{
|
||||
wxColour faceColour(GetSystemColour(wxSYS_COLOUR_3DFACE));
|
||||
g_systemBtnShadowColour =
|
||||
new wxColour(faceColour.Red() * 0.666,
|
||||
faceColour.Green() * 0.666,
|
||||
faceColour.Blue() * 0.666);
|
||||
}
|
||||
/*
|
||||
if (!g_systemBtnShadowColour)
|
||||
{
|
||||
g_systemBtnShadowColour =
|
||||
@@ -121,10 +167,14 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
0x7530 >> SHIFT,
|
||||
0x7530 >> SHIFT );
|
||||
}
|
||||
*/
|
||||
return *g_systemBtnShadowColour;
|
||||
}
|
||||
case wxSYS_COLOUR_BTNHIGHLIGHT:
|
||||
case wxSYS_COLOUR_3DHIGHLIGHT:
|
||||
//case wxSYS_COLOUR_BTNHIGHLIGHT:
|
||||
{
|
||||
return * wxWHITE;
|
||||
/* I think this should normally be white (JACS 8/2000)
|
||||
if (!g_systemBtnHighlightColour)
|
||||
{
|
||||
g_systemBtnHighlightColour =
|
||||
@@ -133,6 +183,7 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
0xea60 >> SHIFT );
|
||||
}
|
||||
return *g_systemBtnHighlightColour;
|
||||
*/
|
||||
}
|
||||
case wxSYS_COLOUR_HIGHLIGHT:
|
||||
{
|
||||
@@ -195,7 +246,30 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
case wxSYS_COLOUR_BTNTEXT:
|
||||
case wxSYS_COLOUR_INFOTEXT:
|
||||
{
|
||||
return *wxBLACK;
|
||||
if (!g_systemBtnTextColour)
|
||||
{
|
||||
GtkWidget *widget = gtk_button_new();
|
||||
GtkStyle *def = gtk_rc_get_style( widget );
|
||||
if (!def)
|
||||
def = gtk_widget_get_default_style();
|
||||
if (def)
|
||||
{
|
||||
int red = def->fg[GTK_STATE_NORMAL].red;
|
||||
int green = def->fg[GTK_STATE_NORMAL].green;
|
||||
int blue = def->fg[GTK_STATE_NORMAL].blue;
|
||||
g_systemBtnTextColour =
|
||||
new wxColour( red >> SHIFT,
|
||||
green >> SHIFT,
|
||||
blue >> SHIFT );
|
||||
}
|
||||
else
|
||||
{
|
||||
g_systemBtnTextColour =
|
||||
new wxColour(0, 0, 0);
|
||||
}
|
||||
gtk_widget_destroy( widget );
|
||||
}
|
||||
return *g_systemBtnTextColour;
|
||||
}
|
||||
case wxSYS_COLOUR_HIGHLIGHTTEXT:
|
||||
{
|
||||
|
@@ -662,10 +662,46 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
|
||||
}
|
||||
*/
|
||||
|
||||
win->GetUpdateRegion().Union( gdk_event->area.x,
|
||||
gdk_event->area.y,
|
||||
gdk_event->area.width,
|
||||
gdk_event->area.height );
|
||||
GtkPizza *pizza = GTK_PIZZA (widget);
|
||||
|
||||
wxWindow *parent = win;
|
||||
if (win->IsTopLevel())
|
||||
{
|
||||
gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
parent = win->GetParent();
|
||||
if (parent)
|
||||
{
|
||||
if (parent->m_isFrame)
|
||||
{
|
||||
wxFrame *frame = (wxFrame*) parent;
|
||||
if (frame->GetStatusBar() == win)
|
||||
{
|
||||
gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (GTK_IS_NOTEBOOK(parent->m_widget))
|
||||
{
|
||||
while (parent && !parent->IsTopLevel())
|
||||
parent = parent->GetParent();
|
||||
|
||||
if (!parent) parent = win;
|
||||
|
||||
gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
win->GetUpdateRegion().Union( gdk_event->area.x,
|
||||
gdk_event->area.y,
|
||||
gdk_event->area.width,
|
||||
gdk_event->area.height );
|
||||
|
||||
if (gdk_event->count == 0)
|
||||
{
|
||||
@@ -685,8 +721,6 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
|
||||
paint *anything* because it will then be allowed to paint
|
||||
over the window-less widgets */
|
||||
|
||||
GtkPizza *pizza = GTK_PIZZA (widget);
|
||||
|
||||
GList *children = pizza->children;
|
||||
while (children)
|
||||
{
|
||||
|
@@ -321,6 +321,33 @@ gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget), wxFrame *win )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "expose_event" of m_client
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindow *win )
|
||||
{
|
||||
GtkPizza *pizza = GTK_PIZZA(widget);
|
||||
|
||||
gtk_paint_flat_box (win->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_NONE, &gdk_event->area, win->m_widget, "base", 0, 0, -1, -1);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "draw" of m_client
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxWindow *win )
|
||||
{
|
||||
GtkPizza *pizza = GTK_PIZZA(widget);
|
||||
|
||||
gtk_paint_flat_box (win->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_NONE, rect, win->m_widget, "base", 0, 0, -1, -1);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFrame itself
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -394,6 +421,7 @@ void wxFrame::Init()
|
||||
m_menuBarDetached = FALSE;
|
||||
m_toolBarDetached = FALSE;
|
||||
m_insertInClientArea = TRUE;
|
||||
m_isFrame = TRUE;
|
||||
}
|
||||
|
||||
bool wxFrame::Create( wxWindow *parent,
|
||||
@@ -445,6 +473,13 @@ bool wxFrame::Create( wxWindow *parent,
|
||||
GTK_WIDGET_UNSET_FLAGS( m_mainWidget, GTK_CAN_FOCUS );
|
||||
gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget );
|
||||
|
||||
|
||||
/* for m_mainWidget themes */
|
||||
gtk_signal_connect( GTK_OBJECT(m_mainWidget), "expose_event",
|
||||
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
|
||||
gtk_signal_connect( GTK_OBJECT(m_mainWidget), "draw",
|
||||
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
debug_focus_in( m_mainWidget, wxT("wxFrame::m_mainWidget"), name );
|
||||
#endif
|
||||
|
@@ -297,7 +297,7 @@ wxMDIChildFrame::wxMDIChildFrame()
|
||||
{
|
||||
m_menuBar = (wxMenuBar *) NULL;
|
||||
m_page = (GtkNotebookPage *) NULL;
|
||||
m_isFrame = TRUE;
|
||||
m_isFrame = FALSE;
|
||||
}
|
||||
|
||||
wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
|
||||
@@ -307,7 +307,7 @@ wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
|
||||
{
|
||||
m_menuBar = (wxMenuBar *) NULL;
|
||||
m_page = (GtkNotebookPage *) NULL;
|
||||
m_isFrame = TRUE;
|
||||
m_isFrame = FALSE;
|
||||
Create( parent, id, title, wxDefaultPosition, size, style, name );
|
||||
}
|
||||
|
||||
|
@@ -69,6 +69,7 @@ wxColour *g_systemBtnHighlightColour = (wxColour *) NULL;
|
||||
wxColour *g_systemHighlightColour = (wxColour *) NULL;
|
||||
wxColour *g_systemHighlightTextColour = (wxColour *) NULL;
|
||||
wxColour *g_systemListBoxColour = (wxColour *) NULL;
|
||||
wxColour *g_systemBtnTextColour = (wxColour *) NULL;
|
||||
|
||||
wxFont *g_systemFont = (wxFont *) NULL;
|
||||
|
||||
@@ -82,6 +83,7 @@ void wxSystemSettings::Done()
|
||||
delete g_systemHighlightTextColour;
|
||||
delete g_systemListBoxColour;
|
||||
delete g_systemFont;
|
||||
delete g_systemBtnTextColour;
|
||||
}
|
||||
|
||||
wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
@@ -97,7 +99,36 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
case wxSYS_COLOUR_ACTIVEBORDER:
|
||||
case wxSYS_COLOUR_INACTIVEBORDER:
|
||||
case wxSYS_COLOUR_BTNFACE:
|
||||
case wxSYS_COLOUR_3DLIGHT:
|
||||
{
|
||||
if (!g_systemBtnFaceColour)
|
||||
{
|
||||
GtkWidget *widget = gtk_button_new();
|
||||
GtkStyle *def = gtk_rc_get_style( widget );
|
||||
if (!def)
|
||||
def = gtk_widget_get_default_style();
|
||||
if (def)
|
||||
{
|
||||
int red = def->bg[GTK_STATE_NORMAL].red;
|
||||
int green = def->bg[GTK_STATE_NORMAL].green;
|
||||
int blue = def->bg[GTK_STATE_NORMAL].blue;
|
||||
g_systemBtnFaceColour =
|
||||
new wxColour( red >> SHIFT,
|
||||
green >> SHIFT,
|
||||
blue >> SHIFT );
|
||||
}
|
||||
else
|
||||
{
|
||||
g_systemBtnFaceColour =
|
||||
new wxColour( 0 >> SHIFT,
|
||||
0 >> SHIFT,
|
||||
0x9c40 >> SHIFT );
|
||||
}
|
||||
gtk_widget_destroy( widget );
|
||||
|
||||
}
|
||||
return *g_systemBtnFaceColour;
|
||||
/*
|
||||
if (!g_systemBtnFaceColour)
|
||||
{
|
||||
g_systemBtnFaceColour =
|
||||
@@ -106,14 +137,29 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
0xd6d6 >> SHIFT );
|
||||
}
|
||||
return *g_systemBtnFaceColour;
|
||||
*/
|
||||
}
|
||||
case wxSYS_COLOUR_WINDOW:
|
||||
{
|
||||
return *wxWHITE;
|
||||
}
|
||||
case wxSYS_COLOUR_3DDKSHADOW:
|
||||
{
|
||||
return *wxBLACK;
|
||||
}
|
||||
case wxSYS_COLOUR_GRAYTEXT:
|
||||
case wxSYS_COLOUR_BTNSHADOW:
|
||||
//case wxSYS_COLOUR_3DSHADOW:
|
||||
{
|
||||
if (!g_systemBtnShadowColour)
|
||||
{
|
||||
wxColour faceColour(GetSystemColour(wxSYS_COLOUR_3DFACE));
|
||||
g_systemBtnShadowColour =
|
||||
new wxColour(faceColour.Red() * 0.666,
|
||||
faceColour.Green() * 0.666,
|
||||
faceColour.Blue() * 0.666);
|
||||
}
|
||||
/*
|
||||
if (!g_systemBtnShadowColour)
|
||||
{
|
||||
g_systemBtnShadowColour =
|
||||
@@ -121,10 +167,14 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
0x7530 >> SHIFT,
|
||||
0x7530 >> SHIFT );
|
||||
}
|
||||
*/
|
||||
return *g_systemBtnShadowColour;
|
||||
}
|
||||
case wxSYS_COLOUR_BTNHIGHLIGHT:
|
||||
case wxSYS_COLOUR_3DHIGHLIGHT:
|
||||
//case wxSYS_COLOUR_BTNHIGHLIGHT:
|
||||
{
|
||||
return * wxWHITE;
|
||||
/* I think this should normally be white (JACS 8/2000)
|
||||
if (!g_systemBtnHighlightColour)
|
||||
{
|
||||
g_systemBtnHighlightColour =
|
||||
@@ -133,6 +183,7 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
0xea60 >> SHIFT );
|
||||
}
|
||||
return *g_systemBtnHighlightColour;
|
||||
*/
|
||||
}
|
||||
case wxSYS_COLOUR_HIGHLIGHT:
|
||||
{
|
||||
@@ -195,7 +246,30 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
||||
case wxSYS_COLOUR_BTNTEXT:
|
||||
case wxSYS_COLOUR_INFOTEXT:
|
||||
{
|
||||
return *wxBLACK;
|
||||
if (!g_systemBtnTextColour)
|
||||
{
|
||||
GtkWidget *widget = gtk_button_new();
|
||||
GtkStyle *def = gtk_rc_get_style( widget );
|
||||
if (!def)
|
||||
def = gtk_widget_get_default_style();
|
||||
if (def)
|
||||
{
|
||||
int red = def->fg[GTK_STATE_NORMAL].red;
|
||||
int green = def->fg[GTK_STATE_NORMAL].green;
|
||||
int blue = def->fg[GTK_STATE_NORMAL].blue;
|
||||
g_systemBtnTextColour =
|
||||
new wxColour( red >> SHIFT,
|
||||
green >> SHIFT,
|
||||
blue >> SHIFT );
|
||||
}
|
||||
else
|
||||
{
|
||||
g_systemBtnTextColour =
|
||||
new wxColour(0, 0, 0);
|
||||
}
|
||||
gtk_widget_destroy( widget );
|
||||
}
|
||||
return *g_systemBtnTextColour;
|
||||
}
|
||||
case wxSYS_COLOUR_HIGHLIGHTTEXT:
|
||||
{
|
||||
|
@@ -662,10 +662,46 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
|
||||
}
|
||||
*/
|
||||
|
||||
win->GetUpdateRegion().Union( gdk_event->area.x,
|
||||
gdk_event->area.y,
|
||||
gdk_event->area.width,
|
||||
gdk_event->area.height );
|
||||
GtkPizza *pizza = GTK_PIZZA (widget);
|
||||
|
||||
wxWindow *parent = win;
|
||||
if (win->IsTopLevel())
|
||||
{
|
||||
gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
parent = win->GetParent();
|
||||
if (parent)
|
||||
{
|
||||
if (parent->m_isFrame)
|
||||
{
|
||||
wxFrame *frame = (wxFrame*) parent;
|
||||
if (frame->GetStatusBar() == win)
|
||||
{
|
||||
gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (GTK_IS_NOTEBOOK(parent->m_widget))
|
||||
{
|
||||
while (parent && !parent->IsTopLevel())
|
||||
parent = parent->GetParent();
|
||||
|
||||
if (!parent) parent = win;
|
||||
|
||||
gtk_paint_flat_box (parent->m_widget->style, pizza->bin_window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_NONE, &gdk_event->area, parent->m_widget, "base", 0, 0, -1, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
win->GetUpdateRegion().Union( gdk_event->area.x,
|
||||
gdk_event->area.y,
|
||||
gdk_event->area.width,
|
||||
gdk_event->area.height );
|
||||
|
||||
if (gdk_event->count == 0)
|
||||
{
|
||||
@@ -685,8 +721,6 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
|
||||
paint *anything* because it will then be allowed to paint
|
||||
over the window-less widgets */
|
||||
|
||||
GtkPizza *pizza = GTK_PIZZA (widget);
|
||||
|
||||
GList *children = pizza->children;
|
||||
while (children)
|
||||
{
|
||||
|
Reference in New Issue
Block a user