Removed crashes when not using themes.
Removed much flicker form tree ctrl and list ctrl. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -347,7 +347,7 @@ void wxFileCtrl::Update()
|
|||||||
{
|
{
|
||||||
InsertColumn( 0, _("Name"), wxLIST_FORMAT_LEFT, 130 );
|
InsertColumn( 0, _("Name"), wxLIST_FORMAT_LEFT, 130 );
|
||||||
InsertColumn( 1, _("Size"), wxLIST_FORMAT_LEFT, 60 );
|
InsertColumn( 1, _("Size"), wxLIST_FORMAT_LEFT, 60 );
|
||||||
InsertColumn( 2, _("Date"), wxLIST_FORMAT_LEFT, 70 );
|
InsertColumn( 2, _("Date"), wxLIST_FORMAT_LEFT, 65 );
|
||||||
InsertColumn( 3, _("Time"), wxLIST_FORMAT_LEFT, 50 );
|
InsertColumn( 3, _("Time"), wxLIST_FORMAT_LEFT, 50 );
|
||||||
InsertColumn( 4, _("Permissions"), wxLIST_FORMAT_LEFT, 120 );
|
InsertColumn( 4, _("Permissions"), wxLIST_FORMAT_LEFT, 120 );
|
||||||
}
|
}
|
||||||
@@ -397,9 +397,9 @@ void wxFileCtrl::Update()
|
|||||||
|
|
||||||
SortItems( ListCompare, 0 );
|
SortItems( ListCompare, 0 );
|
||||||
|
|
||||||
|
SetColumnWidth( 1, wxLIST_AUTOSIZE );
|
||||||
SetColumnWidth( 2, wxLIST_AUTOSIZE );
|
SetColumnWidth( 2, wxLIST_AUTOSIZE );
|
||||||
SetColumnWidth( 3, wxLIST_AUTOSIZE );
|
SetColumnWidth( 3, wxLIST_AUTOSIZE );
|
||||||
SetColumnWidth( 4, wxLIST_AUTOSIZE );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFileCtrl::SetWild( const wxString &wild )
|
void wxFileCtrl::SetWild( const wxString &wild )
|
||||||
|
@@ -1168,6 +1168,8 @@ wxListMainWindow::~wxListMainWindow()
|
|||||||
|
|
||||||
void wxListMainWindow::RefreshLine( wxListLineData *line )
|
void wxListMainWindow::RefreshLine( wxListLineData *line )
|
||||||
{
|
{
|
||||||
|
if (m_dirty) return;
|
||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
int w = 0;
|
int w = 0;
|
||||||
|
@@ -589,14 +589,12 @@ void wxTreeCtrl::SetIndent(unsigned int indent)
|
|||||||
{
|
{
|
||||||
m_indent = indent;
|
m_indent = indent;
|
||||||
m_dirty = TRUE;
|
m_dirty = TRUE;
|
||||||
Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTreeCtrl::SetSpacing(unsigned int spacing)
|
void wxTreeCtrl::SetSpacing(unsigned int spacing)
|
||||||
{
|
{
|
||||||
m_spacing = spacing;
|
m_spacing = spacing;
|
||||||
m_dirty = TRUE;
|
m_dirty = TRUE;
|
||||||
Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively)
|
size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively)
|
||||||
@@ -2160,6 +2158,8 @@ void wxTreeCtrl::CalculatePositions()
|
|||||||
|
|
||||||
void wxTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
|
void wxTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
|
||||||
{
|
{
|
||||||
|
if (m_dirty) return;
|
||||||
|
|
||||||
wxClientDC dc(this);
|
wxClientDC dc(this);
|
||||||
PrepareDC(dc);
|
PrepareDC(dc);
|
||||||
|
|
||||||
@@ -2180,6 +2180,8 @@ void wxTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
|
|||||||
|
|
||||||
void wxTreeCtrl::RefreshLine( wxGenericTreeItem *item )
|
void wxTreeCtrl::RefreshLine( wxGenericTreeItem *item )
|
||||||
{
|
{
|
||||||
|
if (m_dirty) return;
|
||||||
|
|
||||||
wxClientDC dc(this);
|
wxClientDC dc(this);
|
||||||
PrepareDC( dc );
|
PrepareDC( dc );
|
||||||
|
|
||||||
|
@@ -398,7 +398,16 @@ static GdkFont *GtkGetDefaultGuiFont()
|
|||||||
{
|
{
|
||||||
GtkWidget *widget = gtk_button_new();
|
GtkWidget *widget = gtk_button_new();
|
||||||
GtkStyle *def = gtk_rc_get_style( widget );
|
GtkStyle *def = gtk_rc_get_style( widget );
|
||||||
g_systemDefaultGuiFont = gdk_font_ref( def->font );
|
if (def)
|
||||||
|
{
|
||||||
|
g_systemDefaultGuiFont = gdk_font_ref( def->font );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
def = gtk_widget_get_default_style();
|
||||||
|
if (def)
|
||||||
|
g_systemDefaultGuiFont = gdk_font_ref( def->font );
|
||||||
|
}
|
||||||
gtk_widget_destroy( widget );
|
gtk_widget_destroy( widget );
|
||||||
}
|
}
|
||||||
return g_systemDefaultGuiFont;
|
return g_systemDefaultGuiFont;
|
||||||
@@ -428,7 +437,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const
|
|||||||
{
|
{
|
||||||
font = GtkGetDefaultGuiFont();
|
font = GtkGetDefaultGuiFont();
|
||||||
}
|
}
|
||||||
else
|
if (!font)
|
||||||
{
|
{
|
||||||
font = wxLoadQueryNearestFont( point_scale,
|
font = wxLoadQueryNearestFont( point_scale,
|
||||||
M_FONTDATA->m_family,
|
M_FONTDATA->m_family,
|
||||||
|
@@ -128,23 +128,29 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
|||||||
{
|
{
|
||||||
if (!g_systemHighlightColour)
|
if (!g_systemHighlightColour)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
g_systemHighlightColour =
|
|
||||||
new wxColour( 0 >> SHIFT,
|
|
||||||
0 >> SHIFT,
|
|
||||||
0x9c40 >> SHIFT );
|
|
||||||
*/
|
|
||||||
GtkWidget *widget = gtk_button_new();
|
GtkWidget *widget = gtk_button_new();
|
||||||
GtkStyle *def = gtk_rc_get_style( widget );
|
GtkStyle *def = gtk_rc_get_style( widget );
|
||||||
int red = def->bg[GTK_STATE_SELECTED].red;
|
if (!def)
|
||||||
int green = def->bg[GTK_STATE_SELECTED].green;
|
def = gtk_widget_get_default_style();
|
||||||
int blue = def->bg[GTK_STATE_SELECTED].blue;
|
if (def)
|
||||||
|
{
|
||||||
|
int red = def->bg[GTK_STATE_SELECTED].red;
|
||||||
|
int green = def->bg[GTK_STATE_SELECTED].green;
|
||||||
|
int blue = def->bg[GTK_STATE_SELECTED].blue;
|
||||||
|
g_systemHighlightColour =
|
||||||
|
new wxColour( red >> SHIFT,
|
||||||
|
green >> SHIFT,
|
||||||
|
blue >> SHIFT );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_systemHighlightColour =
|
||||||
|
new wxColour( 0 >> SHIFT,
|
||||||
|
0 >> SHIFT,
|
||||||
|
0x9c40 >> SHIFT );
|
||||||
|
}
|
||||||
gtk_widget_destroy( widget );
|
gtk_widget_destroy( widget );
|
||||||
|
|
||||||
g_systemHighlightColour =
|
|
||||||
new wxColour( red >> SHIFT,
|
|
||||||
green >> SHIFT,
|
|
||||||
blue >> SHIFT );
|
|
||||||
}
|
}
|
||||||
return *g_systemHighlightColour;
|
return *g_systemHighlightColour;
|
||||||
}
|
}
|
||||||
|
@@ -2962,7 +2962,12 @@ GtkStyle *wxWindow::GetWidgetStyle()
|
|||||||
{
|
{
|
||||||
if (m_widgetStyle) gtk_style_unref( m_widgetStyle );
|
if (m_widgetStyle) gtk_style_unref( m_widgetStyle );
|
||||||
|
|
||||||
m_widgetStyle = gtk_style_copy( gtk_rc_get_style( m_widget ) );
|
GtkStyle *def = gtk_rc_get_style( m_widget );
|
||||||
|
|
||||||
|
if (!def)
|
||||||
|
def = gtk_widget_get_default_style();
|
||||||
|
|
||||||
|
m_widgetStyle = gtk_style_copy( def );
|
||||||
|
|
||||||
return m_widgetStyle;
|
return m_widgetStyle;
|
||||||
}
|
}
|
||||||
|
@@ -398,7 +398,16 @@ static GdkFont *GtkGetDefaultGuiFont()
|
|||||||
{
|
{
|
||||||
GtkWidget *widget = gtk_button_new();
|
GtkWidget *widget = gtk_button_new();
|
||||||
GtkStyle *def = gtk_rc_get_style( widget );
|
GtkStyle *def = gtk_rc_get_style( widget );
|
||||||
g_systemDefaultGuiFont = gdk_font_ref( def->font );
|
if (def)
|
||||||
|
{
|
||||||
|
g_systemDefaultGuiFont = gdk_font_ref( def->font );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
def = gtk_widget_get_default_style();
|
||||||
|
if (def)
|
||||||
|
g_systemDefaultGuiFont = gdk_font_ref( def->font );
|
||||||
|
}
|
||||||
gtk_widget_destroy( widget );
|
gtk_widget_destroy( widget );
|
||||||
}
|
}
|
||||||
return g_systemDefaultGuiFont;
|
return g_systemDefaultGuiFont;
|
||||||
@@ -428,7 +437,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const
|
|||||||
{
|
{
|
||||||
font = GtkGetDefaultGuiFont();
|
font = GtkGetDefaultGuiFont();
|
||||||
}
|
}
|
||||||
else
|
if (!font)
|
||||||
{
|
{
|
||||||
font = wxLoadQueryNearestFont( point_scale,
|
font = wxLoadQueryNearestFont( point_scale,
|
||||||
M_FONTDATA->m_family,
|
M_FONTDATA->m_family,
|
||||||
|
@@ -128,23 +128,29 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
|||||||
{
|
{
|
||||||
if (!g_systemHighlightColour)
|
if (!g_systemHighlightColour)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
g_systemHighlightColour =
|
|
||||||
new wxColour( 0 >> SHIFT,
|
|
||||||
0 >> SHIFT,
|
|
||||||
0x9c40 >> SHIFT );
|
|
||||||
*/
|
|
||||||
GtkWidget *widget = gtk_button_new();
|
GtkWidget *widget = gtk_button_new();
|
||||||
GtkStyle *def = gtk_rc_get_style( widget );
|
GtkStyle *def = gtk_rc_get_style( widget );
|
||||||
int red = def->bg[GTK_STATE_SELECTED].red;
|
if (!def)
|
||||||
int green = def->bg[GTK_STATE_SELECTED].green;
|
def = gtk_widget_get_default_style();
|
||||||
int blue = def->bg[GTK_STATE_SELECTED].blue;
|
if (def)
|
||||||
|
{
|
||||||
|
int red = def->bg[GTK_STATE_SELECTED].red;
|
||||||
|
int green = def->bg[GTK_STATE_SELECTED].green;
|
||||||
|
int blue = def->bg[GTK_STATE_SELECTED].blue;
|
||||||
|
g_systemHighlightColour =
|
||||||
|
new wxColour( red >> SHIFT,
|
||||||
|
green >> SHIFT,
|
||||||
|
blue >> SHIFT );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_systemHighlightColour =
|
||||||
|
new wxColour( 0 >> SHIFT,
|
||||||
|
0 >> SHIFT,
|
||||||
|
0x9c40 >> SHIFT );
|
||||||
|
}
|
||||||
gtk_widget_destroy( widget );
|
gtk_widget_destroy( widget );
|
||||||
|
|
||||||
g_systemHighlightColour =
|
|
||||||
new wxColour( red >> SHIFT,
|
|
||||||
green >> SHIFT,
|
|
||||||
blue >> SHIFT );
|
|
||||||
}
|
}
|
||||||
return *g_systemHighlightColour;
|
return *g_systemHighlightColour;
|
||||||
}
|
}
|
||||||
|
@@ -2962,7 +2962,12 @@ GtkStyle *wxWindow::GetWidgetStyle()
|
|||||||
{
|
{
|
||||||
if (m_widgetStyle) gtk_style_unref( m_widgetStyle );
|
if (m_widgetStyle) gtk_style_unref( m_widgetStyle );
|
||||||
|
|
||||||
m_widgetStyle = gtk_style_copy( gtk_rc_get_style( m_widget ) );
|
GtkStyle *def = gtk_rc_get_style( m_widget );
|
||||||
|
|
||||||
|
if (!def)
|
||||||
|
def = gtk_widget_get_default_style();
|
||||||
|
|
||||||
|
m_widgetStyle = gtk_style_copy( def );
|
||||||
|
|
||||||
return m_widgetStyle;
|
return m_widgetStyle;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user