1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2002-06-28 20:46:11 -04:00
|
|
|
// Name: wx/generic/fontdlgg.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose: wxGenericFontDialog
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2005-05-04 14:57:50 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-06-17 12:22:36 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2002-06-28 20:46:11 -04:00
|
|
|
#ifndef _WX_GENERIC_FONTDLGG_H
|
|
|
|
#define _WX_GENERIC_FONTDLGG_H
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-01-26 12:20:50 -05:00
|
|
|
#include "wx/defs.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#include "wx/gdicmn.h"
|
|
|
|
#include "wx/font.h"
|
|
|
|
#include "wx/dialog.h"
|
|
|
|
#include "wx/cmndata.h"
|
|
|
|
|
2006-03-02 07:57:30 -05:00
|
|
|
#ifdef __WXWINCE__
|
|
|
|
#define USE_SPINCTRL_FOR_POINT_SIZE 1
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
|
2006-03-02 07:57:30 -05:00
|
|
|
#else
|
|
|
|
#define USE_SPINCTRL_FOR_POINT_SIZE 0
|
|
|
|
#endif
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
/*
|
|
|
|
* FONT DIALOG
|
|
|
|
*/
|
2004-06-17 12:22:36 -04:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxChoice;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxText;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxFontPreviewer;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2002-06-28 20:46:11 -04:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxID_FONT_UNDERLINE = 3000,
|
|
|
|
wxID_FONT_STYLE,
|
|
|
|
wxID_FONT_WEIGHT,
|
|
|
|
wxID_FONT_FAMILY,
|
|
|
|
wxID_FONT_COLOUR,
|
|
|
|
wxID_FONT_SIZE
|
|
|
|
};
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxGenericFontDialog : public wxFontDialogBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
2002-06-28 20:46:11 -04:00
|
|
|
public:
|
|
|
|
wxGenericFontDialog() { Init(); }
|
2006-05-23 07:16:47 -04:00
|
|
|
wxGenericFontDialog(wxWindow *parent)
|
|
|
|
: wxFontDialogBase(parent) { Init(); }
|
2002-06-28 20:46:11 -04:00
|
|
|
wxGenericFontDialog(wxWindow *parent, const wxFontData& data)
|
|
|
|
: wxFontDialogBase(parent, data) { Init(); }
|
|
|
|
virtual ~wxGenericFontDialog();
|
|
|
|
|
|
|
|
virtual int ShowModal();
|
|
|
|
|
2006-03-30 09:04:17 -05:00
|
|
|
#if WXWIN_COMPATIBILITY_2_6
|
2002-06-28 20:46:11 -04:00
|
|
|
// deprecated, for backwards compatibility only
|
2006-03-30 09:04:17 -05:00
|
|
|
wxDEPRECATED( wxGenericFontDialog(wxWindow *parent, const wxFontData *data) );
|
|
|
|
#endif // WXWIN_COMPATIBILITY_2_6
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2002-06-28 20:46:11 -04:00
|
|
|
// Internal functions
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2002-06-28 20:46:11 -04:00
|
|
|
virtual void CreateWidgets();
|
|
|
|
virtual void InitializeFont();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2002-06-28 20:46:11 -04:00
|
|
|
void OnChangeFont(wxCommandEvent& event);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-03-02 07:57:30 -05:00
|
|
|
#if USE_SPINCTRL_FOR_POINT_SIZE
|
|
|
|
void OnChangeSize(wxSpinEvent& event);
|
|
|
|
#endif
|
|
|
|
|
2002-06-28 20:46:11 -04:00
|
|
|
protected:
|
2006-03-07 13:54:41 -05:00
|
|
|
|
|
|
|
virtual bool DoCreate(wxWindow *parent);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2002-06-28 20:46:11 -04:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-03-07 13:54:41 -05:00
|
|
|
void DoChangeFont();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-03-07 13:54:41 -05:00
|
|
|
wxFont m_dialogFont;
|
2002-06-28 20:46:11 -04:00
|
|
|
|
2006-03-07 13:54:41 -05:00
|
|
|
wxChoice *m_familyChoice;
|
|
|
|
wxChoice *m_styleChoice;
|
|
|
|
wxChoice *m_weightChoice;
|
|
|
|
wxChoice *m_colourChoice;
|
|
|
|
wxCheckBox *m_underLineCheckBox;
|
2006-03-02 07:57:30 -05:00
|
|
|
|
|
|
|
#if !USE_SPINCTRL_FOR_POINT_SIZE
|
2006-03-07 13:54:41 -05:00
|
|
|
wxChoice *m_pointSizeChoice;
|
2006-03-02 07:57:30 -05:00
|
|
|
#endif
|
2002-06-28 20:46:11 -04:00
|
|
|
|
|
|
|
wxFontPreviewer *m_previewer;
|
|
|
|
bool m_useEvents;
|
|
|
|
|
|
|
|
// static bool fontDialogCancelled;
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2006-03-30 09:04:17 -05:00
|
|
|
#if WXWIN_COMPATIBILITY_2_6
|
|
|
|
// deprecated, for backwards compatibility only
|
|
|
|
inline wxGenericFontDialog::wxGenericFontDialog(wxWindow *parent, const wxFontData *data)
|
|
|
|
:wxFontDialogBase(parent) { Init(); InitFontData(data); Create(parent); }
|
|
|
|
#endif // WXWIN_COMPATIBILITY_2_6
|
|
|
|
|
2002-06-28 20:46:11 -04:00
|
|
|
#endif // _WX_GENERIC_FONTDLGG_H
|