1. more warnings fixes in gtk/region.cpp and common/tbarsmpl.cpp

2. wxWindow::Create() always takes a wxValidator parameter, even if
   !wxUSE_VALIDATORS - it is just ignored then, tons of #if wxUSE_VALIDATORS
   removed


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-01-06 16:47:48 +00:00
parent a6fc8ae3c2
commit 674ac8b919
21 changed files with 71 additions and 141 deletions

View File

@@ -41,23 +41,9 @@ protected:
const wxPoint& pos,
const wxSize& size,
long style,
#if wxUSE_VALIDATORS
const wxValidator& validator,
#endif
const wxString& name);
// an overloaded version for the controls without validators
bool CreateControl(wxWindowBase *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
return CreateControl(parent, id, pos, size, style,
wxDefaultValidator, name);
}
// inherit colour and font settings from the parent window
void InheritAttributes();
};

View File

@@ -251,9 +251,7 @@ public:
const wxString &value = "",
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
int style = 0,
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
#endif
const wxString &name = "wxListTextCtrlText" );
void OnChar( wxKeyEvent &event );
void OnKillFocus( wxFocusEvent &event );
@@ -379,23 +377,25 @@ class WXDLLEXPORT wxListCtrl: public wxControl
{
public:
wxListCtrl();
wxListCtrl( wxWindow *parent, wxWindowID id = -1,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
#if wxUSE_VALIDATORS
long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
#endif
const wxString &name = "listctrl" )
wxListCtrl( wxWindow *parent,
wxWindowID id = -1,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString &name = "listctrl" )
{
Create(parent, id, pos, size, style, validator, name);
}
~wxListCtrl();
bool Create( wxWindow *parent, wxWindowID id = -1,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
#if wxUSE_VALIDATORS
long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
#endif
const wxString &name = "listctrl" );
bool Create( wxWindow *parent,
wxWindowID id = -1,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString &name = "listctrl" );
bool GetColumn( int col, wxListItem& item ) const;
bool SetColumn( int col, wxListItem& item );

View File

@@ -131,9 +131,7 @@ class WXDLLEXPORT wxTreeTextCtrl: public wxTextCtrl
const wxString &value = wxEmptyString,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
int style = 0,
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
#endif
const wxString &name = wxTextCtrlNameStr );
void OnChar( wxKeyEvent &event );
void OnKillFocus( wxFocusEvent &event );
@@ -156,9 +154,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
#if wxUSE_VALIDATORS
const wxValidator &validator = wxDefaultValidator,
#endif
const wxString& name = wxTreeCtrlNameStr)
{
Create(parent, id, pos, size, style, validator, name);
@@ -170,9 +166,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
#if wxUSE_VALIDATORS
const wxValidator &validator = wxDefaultValidator,
#endif
const wxString& name = wxTreeCtrlNameStr);
// accessors

View File

@@ -38,24 +38,16 @@ public:
wxControl(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
#endif
const wxString& name = wxControlNameStr)
{
Create(parent, id, pos, size, style,
#if wxUSE_VALIDATORS
validator,
#endif
name);
Create(parent, id, pos, size, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
#endif
const wxString& name = wxControlNameStr);
// this function will filter out '&' characters and will put the accelerator

View File

@@ -38,24 +38,16 @@ public:
wxControl(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
#endif
const wxString& name = wxControlNameStr)
{
Create(parent, id, pos, size, style,
#if wxUSE_VALIDATORS
validator,
#endif
name);
Create(parent, id, pos, size, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
#endif
const wxString& name = wxControlNameStr);
// this function will filter out '&' characters and will put the accelerator

View File

@@ -29,14 +29,6 @@ class WXDLLEXPORT wxControl: public wxWindow
public:
wxControl();
wxControl( wxWindow *parent,
wxWindowID id,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = wxControlNameStr );
#if wxUSE_VALIDATORS
wxControl( wxWindow *parent,
wxWindowID id,
const wxPoint &pos = wxDefaultPosition,
@@ -44,7 +36,7 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString &name = wxControlNameStr );
#endif
~wxControl();
// simulates the event, returns TRUE if the event was processed

View File

@@ -30,9 +30,7 @@ public:
wxControl(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
#endif
const wxString& name = wxControlNameStr)
{
Create(parent, id, pos, size, style, validator, name);
@@ -41,9 +39,7 @@ public:
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
#endif
const wxString& name = wxControlNameStr);
virtual ~wxControl();

View File

@@ -16,14 +16,17 @@
#pragma interface "validate.h"
#endif
#include "wx/event.h"
#if defined(wxUSE_VALIDATORS) && !wxUSE_VALIDATORS
// wxWindows is compiled without support for wxValidator
// wxWindows is compiled without support for wxValidator, but we still
// want to be able to pass wxDefaultValidator to the functions which take
// a wxValidator parameter to avoid using "#if wxUSE_VALIDATORS"
// everywhere
class WXDLLEXPORT wxValidator;
#define wxDefaultValidator (*((wxValidator *)NULL))
#else // wxUSE_VALIDATORS
#include "wx/event.h"
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxWindowBase;

View File

@@ -30,9 +30,7 @@
#include "wx/region.h"
#include "wx/utils.h"
#if wxUSE_VALIDATORS
#include "wx/validate.h" // defines wxDefaultValidator
#endif // wxUSE_VALIDATORS
#include "wx/validate.h" // for wxDefaultValidator (always include it)
#if wxUSE_ACCEL
#include "wx/accel.h"
@@ -121,10 +119,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
#endif // wxUSE_VALIDATORS
const wxString& name = wxPanelNameStr);
virtual ~wxWindowBase();

View File

@@ -75,6 +75,8 @@
#include "wx/dirdlg.h"
#include "wx/toolbar.h"
#include "wx/validate.h" // always include, even if !wxUSE_VALIDATORS
#if wxUSE_VALIDATORS
#include "wx/valtext.h"
#endif // wxUSE_VALIDATORS