centralized the handling of border styles; added borders support for wxListBox and support of other kinds of borders (patch 1448088)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -203,6 +203,7 @@ wxGTK:
|
|||||||
- Fixed problems with CJK input method.
|
- Fixed problems with CJK input method.
|
||||||
- Implemented ScrollLines/Pages() for all windows (Paul Cornett).
|
- Implemented ScrollLines/Pages() for all windows (Paul Cornett).
|
||||||
- Support underlined fonts in wxTextCtrl.
|
- Support underlined fonts in wxTextCtrl.
|
||||||
|
- Support all border styles; wxListBox honours the borders now
|
||||||
|
|
||||||
wxMac:
|
wxMac:
|
||||||
|
|
||||||
|
@@ -277,6 +277,9 @@ protected:
|
|||||||
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
|
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
|
||||||
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
|
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||||
|
|
||||||
|
// sets the border of a given GtkScrolledWindow from a wx style
|
||||||
|
static void GtkScrolledWindowSetBorder(GtkWidget* w, int style);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// GtkAdjustment to be used by Scroll{Lines,Pages}
|
// GtkAdjustment to be used by Scroll{Lines,Pages}
|
||||||
void SetVScrollAdjustment(GtkAdjustment* adj);
|
void SetVScrollAdjustment(GtkAdjustment* adj);
|
||||||
|
@@ -1407,7 +1407,8 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_widget = gtk_scrolled_window_new (NULL, NULL);
|
m_widget = gtk_scrolled_window_new (NULL, NULL);
|
||||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (m_widget), GTK_SHADOW_IN);
|
|
||||||
|
GtkScrolledWindowSetBorder(m_widget, style);
|
||||||
|
|
||||||
m_treeview = gtk_tree_view_new();
|
m_treeview = gtk_tree_view_new();
|
||||||
gtk_container_add (GTK_CONTAINER (m_widget), m_treeview);
|
gtk_container_add (GTK_CONTAINER (m_widget), m_treeview);
|
||||||
|
@@ -467,6 +467,9 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
|
|||||||
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
|
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
GtkScrolledWindowSetBorder(m_widget, style);
|
||||||
|
|
||||||
m_treeview = GTK_TREE_VIEW( gtk_tree_view_new( ) );
|
m_treeview = GTK_TREE_VIEW( gtk_tree_view_new( ) );
|
||||||
|
|
||||||
//wxListBox doesn't have a header :)
|
//wxListBox doesn't have a header :)
|
||||||
|
@@ -600,8 +600,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
|||||||
|
|
||||||
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), wrap );
|
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), wrap );
|
||||||
|
|
||||||
if (!HasFlag(wxNO_BORDER))
|
GtkScrolledWindowSetBorder(m_widget, style);
|
||||||
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(m_widget), GTK_SHADOW_IN );
|
|
||||||
|
|
||||||
gtk_widget_add_events( GTK_WIDGET(m_text), GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK );
|
gtk_widget_add_events( GTK_WIDGET(m_text), GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK );
|
||||||
|
|
||||||
|
@@ -4334,6 +4334,29 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
|||||||
m_clipPaintRegion = false;
|
m_clipPaintRegion = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindowGTK::GtkScrolledWindowSetBorder(GtkWidget* w, int wxstyle)
|
||||||
|
{
|
||||||
|
//RN: Note that static controls usually have no border on gtk, so maybe
|
||||||
|
//it makes sense to treat that as simply no border at the wx level
|
||||||
|
//as well...
|
||||||
|
if (!(wxstyle & wxNO_BORDER) && !(wxstyle & wxBORDER_STATIC))
|
||||||
|
{
|
||||||
|
GtkShadowType gtkstyle;
|
||||||
|
|
||||||
|
if(wxstyle & wxBORDER_RAISED)
|
||||||
|
gtkstyle = GTK_SHADOW_OUT;
|
||||||
|
else if (wxstyle & wxBORDER_SUNKEN)
|
||||||
|
gtkstyle = GTK_SHADOW_IN;
|
||||||
|
else if (wxstyle & wxBORDER_DOUBLE)
|
||||||
|
gtkstyle = GTK_SHADOW_ETCHED_IN;
|
||||||
|
else //default
|
||||||
|
gtkstyle = GTK_SHADOW_IN;
|
||||||
|
|
||||||
|
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(w),
|
||||||
|
gtkstyle );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void wxWindowGTK::SetWindowStyleFlag( long style )
|
void wxWindowGTK::SetWindowStyleFlag( long style )
|
||||||
{
|
{
|
||||||
// Updates the internal variable. NB: Now m_windowStyle bits carry the _new_ style values already
|
// Updates the internal variable. NB: Now m_windowStyle bits carry the _new_ style values already
|
||||||
|
Reference in New Issue
Block a user