Getting borders working

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2007-11-13 14:27:26 +00:00
parent 6257c7261f
commit e50488546a
4 changed files with 10 additions and 6 deletions

View File

@@ -88,7 +88,7 @@ public:
const wxString &dir = wxDirDialogDefaultFolderStr, const wxString &dir = wxDirDialogDefaultFolderStr,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, long style = wxDIRCTRL_3D_INTERNAL,
const wxString& filter = wxEmptyString, const wxString& filter = wxEmptyString,
int defaultFilter = 0, int defaultFilter = 0,
const wxString& name = wxTreeCtrlNameStr ) const wxString& name = wxTreeCtrlNameStr )
@@ -101,7 +101,7 @@ public:
const wxString &dir = wxDirDialogDefaultFolderStr, const wxString &dir = wxDirDialogDefaultFolderStr,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, long style = wxDIRCTRL_3D_INTERNAL,
const wxString& filter = wxEmptyString, const wxString& filter = wxEmptyString,
int defaultFilter = 0, int defaultFilter = 0,
const wxString& name = wxTreeCtrlNameStr ); const wxString& name = wxTreeCtrlNameStr );

View File

@@ -562,8 +562,6 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
if ((style & wxDIRCTRL_3D_INTERNAL) == 0) if ((style & wxDIRCTRL_3D_INTERNAL) == 0)
treeStyle |= wxNO_BORDER; treeStyle |= wxNO_BORDER;
else
treeStyle |= wxBORDER_SUNKEN;
m_treeCtrl = CreateTreeCtrl(this, wxID_TREECTRL, m_treeCtrl = CreateTreeCtrl(this, wxID_TREECTRL,
wxPoint(0,0), GetClientSize(), treeStyle); wxPoint(0,0), GetClientSize(), treeStyle);

View File

@@ -303,7 +303,7 @@ GtkWidget* wxPizza::New(long windowStyle)
pizza->m_scroll_y = 0; pizza->m_scroll_y = 0;
pizza->m_is_scrollable = (windowStyle & (wxHSCROLL | wxVSCROLL)) != 0; pizza->m_is_scrollable = (windowStyle & (wxHSCROLL | wxVSCROLL)) != 0;
pizza->m_border_style = pizza->m_border_style =
int(windowStyle & (wxBORDER_SIMPLE | wxBORDER_RAISED | wxBORDER_SUNKEN)); int(windowStyle & wxBORDER_MASK);
gtk_fixed_set_has_window(GTK_FIXED(widget), true); gtk_fixed_set_has_window(GTK_FIXED(widget), true);
gtk_widget_add_events(widget, gtk_widget_add_events(widget,
GDK_EXPOSURE_MASK | GDK_EXPOSURE_MASK |

View File

@@ -2226,6 +2226,11 @@ bool wxWindowGTK::Create( wxWindow *parent,
long style, long style,
const wxString &name ) const wxString &name )
{ {
// Get default border
wxBorder border = GetBorder(style);
style &= ~wxBORDER_MASK;
style |= border;
if (!PreCreation( parent, pos, size ) || if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{ {
@@ -2233,6 +2238,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
return false; return false;
} }
m_wxwindow = wxPizza::New(m_windowStyle); m_wxwindow = wxPizza::New(m_windowStyle);
if (!HasFlag(wxHSCROLL) && !HasFlag(wxVSCROLL)) if (!HasFlag(wxHSCROLL) && !HasFlag(wxVSCROLL))
m_widget = m_wxwindow; m_widget = m_wxwindow;
@@ -2408,7 +2414,7 @@ void wxWindowGTK::PostCreation()
// border drawing // border drawing
#ifndef __WXUNIVERSAL__ #ifndef __WXUNIVERSAL__
if (HasFlag(wxBORDER_SIMPLE | wxBORDER_RAISED | wxBORDER_SUNKEN)) if (HasFlag(wxBORDER_SIMPLE | wxBORDER_RAISED | wxBORDER_SUNKEN | wxBORDER_THEME))
{ {
g_signal_connect(m_widget, "expose_event", g_signal_connect(m_widget, "expose_event",
G_CALLBACK(expose_event_border), this); G_CALLBACK(expose_event_border), this);