#include "wx/cmndata.h"
//-----------------------------------------------------------------------------
-// wxGenericFontButton: a button which brings up a wxColourDialog
+// wxGenericFontButton: a button which brings up a wxFontDialog
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericFontButton : public wxButton,
// user can override this to init font data in a different way
virtual void InitFontData();
- // returns the font data shown in wxColourDialog
- wxFontData *GetFontData() { return &ms_data; }
+ // returns the font data shown in wxFontDialog
+ wxFontData *GetFontData() { return &m_data; }
public:
void UpdateFont();
- // the colour data shown in wxColourPickerCtrlGeneric
- // controls. This member is static so that all colour pickers
- // in the program share the same set of custom colours.
- static wxFontData ms_data;
+ wxFontData m_data;
private:
DECLARE_DYNAMIC_CLASS(wxGenericFontButton)
// implementation
// ============================================================================
-wxFontData wxGenericFontButton::ms_data;
IMPLEMENT_DYNAMIC_CLASS(wxGenericFontButton, wxButton)
// ----------------------------------------------------------------------------
void wxGenericFontButton::InitFontData()
{
- ms_data.SetAllowSymbols(true);
- ms_data.SetColour(*wxBLACK);
- ms_data.EnableEffects(true);
+ m_data.SetAllowSymbols(true);
+ m_data.SetColour(*wxBLACK);
+ m_data.EnableEffects(true);
}
void wxGenericFontButton::OnButtonClick(wxCommandEvent& WXUNUSED(ev))
{
// update the wxFontData to be shown in the the dialog
- ms_data.SetInitialFont(m_selectedFont);
+ m_data.SetInitialFont(m_selectedFont);
// create the font dialog and display it
- wxFontDialog dlg(this, ms_data);
+ wxFontDialog dlg(this, m_data);
if (dlg.ShowModal() == wxID_OK)
{
- ms_data = dlg.GetFontData();
- SetSelectedFont(ms_data.GetChosenFont());
+ m_data = dlg.GetFontData();
+ SetSelectedFont(m_data.GetChosenFont());
// fire an event
wxFontPickerEvent event(this, GetId(), m_selectedFont);
if ( !m_selectedFont.Ok() )
return;
- SetForegroundColour(ms_data.GetColour());
+ SetForegroundColour(m_data.GetColour());
if (HasFlag(wxFNTP_USEFONT_FOR_LABEL))
{