use wxNullFont instead of *wxNORMAL_FONT as default parameter for wxFontPickerCtrl/Widget, this fixes compilation with gcc 2.95 and possibly other old compilers

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-11-03 21:54:13 +00:00
parent 322f55e8d0
commit 305329c2f1
7 changed files with 14 additions and 11 deletions

View File

@@ -64,7 +64,7 @@ user's input is valid, i.e. recognizable). }
\func{}{wxFontPickerCtrl}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxFont\& }{font = *wxNORMAL\_FONT},\rtfsp
\param{const wxFont\& }{font = wxNullFont},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxFNTP\_DEFAULT\_STYLE},\rtfsp
@@ -79,7 +79,7 @@ all the parameters.
\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxFont\& }{font = *wxNORMAL\_FONT},\rtfsp
\param{const wxFont\& }{font = wxNullFont},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxFNTP\_DEFAULT\_STYLE},\rtfsp
@@ -92,7 +92,8 @@ all the parameters.
\docparam{id}{The identifier for the control.}
\docparam{font}{The initial font shown in the control.}
\docparam{font}{The initial font shown in the control. The default
\texttt{wxNORMAL\_FONT} value means to use the default font.}
\docparam{pos}{Initial position.}

View File

@@ -107,7 +107,7 @@ public:
wxFontPickerCtrl(wxWindow *parent,
wxWindowID id,
const wxFont& initial = *wxNORMAL_FONT,
const wxFont& initial = wxNullFont,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFNTP_DEFAULT_STYLE,
@@ -121,7 +121,7 @@ public:
bool Create(wxWindow *parent,
wxWindowID id,
const wxFont& initial = *wxNORMAL_FONT,
const wxFont& initial = wxNullFont,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFNTP_DEFAULT_STYLE,

View File

@@ -29,7 +29,7 @@ public:
wxGenericFontButton() {}
wxGenericFontButton(wxWindow *parent,
wxWindowID id,
const wxFont &initial = *wxNORMAL_FONT,
const wxFont &initial = wxNullFont,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFONTBTN_DEFAULT_STYLE,

View File

@@ -27,7 +27,7 @@ public:
wxFontButton() {}
wxFontButton(wxWindow *parent,
wxWindowID id,
const wxFont& initial = *wxNORMAL_FONT,
const wxFont& initial = wxNullFont,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFONTBTN_DEFAULT_STYLE,
@@ -44,7 +44,7 @@ public: // overrides
bool Create(wxWindow *parent,
wxWindowID id,
const wxFont& initial = *wxNORMAL_FONT,
const wxFont& initial = wxNullFont,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFONTBTN_DEFAULT_STYLE,

View File

@@ -58,7 +58,9 @@ bool wxFontPickerCtrl::Create( wxWindow *parent, wxWindowID id,
long style, const wxValidator& validator,
const wxString &name )
{
if (!wxPickerBase::CreateBase(parent, id, Font2String(initial),
if (!wxPickerBase::CreateBase(parent, id,
Font2String(initial.IsOk() ? initial
: *wxNORMAL_FONT),
pos, size, style, validator, name))
return false;

View File

@@ -64,7 +64,7 @@ bool wxGenericFontButton::Create( wxWindow *parent, wxWindowID id,
wxCommandEventHandler(wxGenericFontButton::OnButtonClick),
NULL, this);
m_selectedFont = initial;
m_selectedFont = initial.IsOk() ? initial : *wxNORMAL_FONT;
UpdateFont();
InitFontData();

View File

@@ -73,7 +73,7 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id,
m_widget = gtk_font_button_new();
// set initial font
m_selectedFont = initial;
m_selectedFont = initial.IsOk() ? initial : *wxNORMAL_FONT;
UpdateFont();
// honour the fontbutton styles