From a48cb41599e10e00ac10892bf659a96477b34e9b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 15 Apr 2005 19:41:32 +0000 Subject: [PATCH] Patch #1183952, Create to return bool git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/stc/stc.h | 8 ++++---- contrib/src/stc/stc.cpp | 20 +++++++++++--------- contrib/src/stc/stc.cpp.in | 20 +++++++++++--------- contrib/src/stc/stc.h.in | 8 ++++---- include/wx/stc/stc.h | 8 ++++---- src/stc/stc.cpp | 20 +++++++++++--------- src/stc/stc.cpp.in | 20 +++++++++++--------- src/stc/stc.h.in | 8 ++++---- 8 files changed, 60 insertions(+), 52 deletions(-) diff --git a/contrib/include/wx/stc/stc.h b/contrib/include/wx/stc/stc.h index b636753aa5..fd5179eee7 100644 --- a/contrib/include/wx/stc/stc.h +++ b/contrib/include/wx/stc/stc.h @@ -1507,10 +1507,10 @@ public: #endif - void Create(wxWindow *parent, wxWindowID id=wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxSTCNameStr); + bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, long style = 0, + const wxString& name = wxSTCNameStr); //---------------------------------------------------------------------- diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index ed561d51cd..f0e0d86213 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -150,19 +150,20 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent, } -void wxStyledTextCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) +bool wxStyledTextCtrl::Create(wxWindow *parent, + wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) { #ifdef __WXMAC__ style |= wxVSCROLL | wxHSCROLL; #endif - wxControl::Create(parent, id, pos, size, - style | wxWANTS_CHARS | wxCLIP_CHILDREN, - wxDefaultValidator, name); + if (!wxControl::Create(parent, id, pos, size, + style | wxWANTS_CHARS | wxCLIP_CHILDREN, + wxDefaultValidator, name)) + return false; #ifdef LINK_LEXERS Scintilla_LinkLexers(); @@ -181,6 +182,7 @@ void wxStyledTextCtrl::Create(wxWindow *parent, // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); + return true; } diff --git a/contrib/src/stc/stc.cpp.in b/contrib/src/stc/stc.cpp.in index 17143cf678..a96666ae4f 100644 --- a/contrib/src/stc/stc.cpp.in +++ b/contrib/src/stc/stc.cpp.in @@ -150,19 +150,20 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent, } -void wxStyledTextCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) +bool wxStyledTextCtrl::Create(wxWindow *parent, + wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) { #ifdef __WXMAC__ style |= wxVSCROLL | wxHSCROLL; #endif - wxControl::Create(parent, id, pos, size, - style | wxWANTS_CHARS | wxCLIP_CHILDREN, - wxDefaultValidator, name); + if (!wxControl::Create(parent, id, pos, size, + style | wxWANTS_CHARS | wxCLIP_CHILDREN, + wxDefaultValidator, name)) + return false; #ifdef LINK_LEXERS Scintilla_LinkLexers(); @@ -181,6 +182,7 @@ void wxStyledTextCtrl::Create(wxWindow *parent, // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); + return true; } diff --git a/contrib/src/stc/stc.h.in b/contrib/src/stc/stc.h.in index 6fd444087a..370fa887fd 100644 --- a/contrib/src/stc/stc.h.in +++ b/contrib/src/stc/stc.h.in @@ -102,10 +102,10 @@ public: #endif - void Create(wxWindow *parent, wxWindowID id=wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxSTCNameStr); + bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, long style = 0, + const wxString& name = wxSTCNameStr); //---------------------------------------------------------------------- diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index b636753aa5..fd5179eee7 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -1507,10 +1507,10 @@ public: #endif - void Create(wxWindow *parent, wxWindowID id=wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxSTCNameStr); + bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, long style = 0, + const wxString& name = wxSTCNameStr); //---------------------------------------------------------------------- diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index ed561d51cd..f0e0d86213 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -150,19 +150,20 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent, } -void wxStyledTextCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) +bool wxStyledTextCtrl::Create(wxWindow *parent, + wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) { #ifdef __WXMAC__ style |= wxVSCROLL | wxHSCROLL; #endif - wxControl::Create(parent, id, pos, size, - style | wxWANTS_CHARS | wxCLIP_CHILDREN, - wxDefaultValidator, name); + if (!wxControl::Create(parent, id, pos, size, + style | wxWANTS_CHARS | wxCLIP_CHILDREN, + wxDefaultValidator, name)) + return false; #ifdef LINK_LEXERS Scintilla_LinkLexers(); @@ -181,6 +182,7 @@ void wxStyledTextCtrl::Create(wxWindow *parent, // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); + return true; } diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 17143cf678..a96666ae4f 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -150,19 +150,20 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent, } -void wxStyledTextCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) +bool wxStyledTextCtrl::Create(wxWindow *parent, + wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) { #ifdef __WXMAC__ style |= wxVSCROLL | wxHSCROLL; #endif - wxControl::Create(parent, id, pos, size, - style | wxWANTS_CHARS | wxCLIP_CHILDREN, - wxDefaultValidator, name); + if (!wxControl::Create(parent, id, pos, size, + style | wxWANTS_CHARS | wxCLIP_CHILDREN, + wxDefaultValidator, name)) + return false; #ifdef LINK_LEXERS Scintilla_LinkLexers(); @@ -181,6 +182,7 @@ void wxStyledTextCtrl::Create(wxWindow *parent, // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); + return true; } diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index 6fd444087a..370fa887fd 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -102,10 +102,10 @@ public: #endif - void Create(wxWindow *parent, wxWindowID id=wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxSTCNameStr); + bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, long style = 0, + const wxString& name = wxSTCNameStr); //---------------------------------------------------------------------- -- 2.47.2