projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cgimagecreate from wxbitmap crashes 10.2 - turn off. Put in right click handler to...
[wxWidgets.git]
/
src
/
gtk1
/
tglbtn.cpp
diff --git
a/src/gtk1/tglbtn.cpp
b/src/gtk1/tglbtn.cpp
index 4d57e220cf5ecf7898cd670b518d70819daa73d8..973299339a186a84576fc5757faf54182bdc5f61 100644
(file)
--- a/
src/gtk1/tglbtn.cpp
+++ b/
src/gtk1/tglbtn.cpp
@@
-7,7
+7,7
@@
// Created: 08.02.01
// RCS-ID: $Id$
// Copyright: (c) 2000 Johnny C. Norris II
// Created: 08.02.01
// RCS-ID: $Id$
// Copyright: (c) 2000 Johnny C. Norris II
-// License:
Rocketeer licens
e
+// License:
wxWindows licenc
e
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
@@
-123,6
+123,7
@@
void wxToggleBitmapButton::SetLabel(const wxBitmap& label)
wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
m_bitmap = label;
wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
m_bitmap = label;
+ InvalidateBestSize();
OnSetBitmap();
}
OnSetBitmap();
}
@@
-159,11
+160,10
@@
bool wxToggleBitmapButton::Enable(bool enable /*=TRUE*/)
return TRUE;
}
return TRUE;
}
-void wxToggleBitmapButton::
ApplyWidgetStyle(
)
+void wxToggleBitmapButton::
DoApplyWidgetStyle(GtkRcStyle *style
)
{
{
- SetWidgetStyle();
- gtk_widget_set_style(m_widget, m_widgetStyle);
- gtk_widget_set_style(BUTTON_CHILD(m_widget), m_widgetStyle);
+ gtk_widget_modify_style(m_widget, style);
+ gtk_widget_modify_style(BUTTON_CHILD(m_widget), style);
}
bool wxToggleBitmapButton::IsOwnGtkWindow(GdkWindow *window)
}
bool wxToggleBitmapButton::IsOwnGtkWindow(GdkWindow *window)
@@
-193,7
+193,7
@@
void wxToggleBitmapButton::OnInternalIdle()
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
-// wxSize DoGetBestSize() const
+
// Get the "best" size for this control.
wxSize wxToggleBitmapButton::DoGetBestSize() const
{
// Get the "best" size for this control.
wxSize wxToggleBitmapButton::DoGetBestSize() const
{
@@
-205,8
+205,19
@@
wxSize wxToggleBitmapButton::DoGetBestSize() const
best.x = m_bitmap.GetWidth()+border;
best.y = m_bitmap.GetHeight()+border;
}
best.x = m_bitmap.GetWidth()+border;
best.y = m_bitmap.GetHeight()+border;
}
+ CacheBestSize(best);
return best;
}
return best;
}
+
+
+// static
+wxVisualAttributes
+wxToggleBitmapButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+ return GetDefaultAttributesFromGTKWidget(gtk_toggle_button_new);
+}
+
+
// ------------------------------------------------------------------------
// wxToggleButton
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// wxToggleButton
// ------------------------------------------------------------------------
@@
-290,11
+301,10
@@
bool wxToggleButton::Enable(bool enable /*=TRUE*/)
return TRUE;
}
return TRUE;
}
-void wxToggleButton::
ApplyWidgetStyle(
)
+void wxToggleButton::
DoApplyWidgetStyle(GtkRcStyle *style
)
{
{
- SetWidgetStyle();
- gtk_widget_set_style(m_widget, m_widgetStyle);
- gtk_widget_set_style(BUTTON_CHILD(m_widget), m_widgetStyle);
+ gtk_widget_modify_style(m_widget, style);
+ gtk_widget_modify_style(BUTTON_CHILD(m_widget), style);
}
bool wxToggleButton::IsOwnGtkWindow(GdkWindow *window)
}
bool wxToggleButton::IsOwnGtkWindow(GdkWindow *window)
@@
-324,7
+334,7
@@
void wxToggleButton::OnInternalIdle()
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
-// wxSize DoGetBestSize() const
+
// Get the "best" size for this control.
wxSize wxToggleButton::DoGetBestSize() const
{
// Get the "best" size for this control.
wxSize wxToggleButton::DoGetBestSize() const
{
@@
-335,8
+345,15
@@
wxSize wxToggleButton::DoGetBestSize() const
if (ret.x < 80) ret.x = 80;
}
if (ret.x < 80) ret.x = 80;
}
+ CacheBestSize(ret);
+ return ret;
+}
- return ret;
+// static
+wxVisualAttributes
+wxToggleButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+ return GetDefaultAttributesFromGTKWidget(gtk_toggle_button_new);
}
#endif // wxUSE_TOGGLEBTN
}
#endif // wxUSE_TOGGLEBTN