]>
git.saurik.com Git - wxWidgets.git/blob - src/common/fontdata.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/fontdata.cpp
3 // Author: Julian Smart
4 // Copyright: (c) Julian Smart
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
14 #if wxUSE_FONTDLG || wxUSE_FONTPICKERCTRL
16 #include "wx/fontdata.h"
18 IMPLEMENT_DYNAMIC_CLASS(wxFontData
, wxObject
)
20 wxFontData::wxFontData()
23 m_allowSymbols
= true;
24 m_enableEffects
= true;
28 m_encoding
= wxFONTENCODING_SYSTEM
;
31 wxFontData::~wxFontData()
35 wxFontData::wxFontData(const wxFontData
& data
)
37 m_fontColour(data
.m_fontColour
),
38 m_showHelp(data
.m_showHelp
),
39 m_allowSymbols(data
.m_allowSymbols
),
40 m_enableEffects(data
.m_enableEffects
),
41 m_initialFont(data
.m_initialFont
),
42 m_chosenFont(data
.m_chosenFont
),
43 m_minSize(data
.m_minSize
),
44 m_maxSize(data
.m_maxSize
),
45 m_encoding(data
.m_encoding
),
46 m_encodingInfo(data
.m_encodingInfo
)
50 wxFontData
& wxFontData::operator=(const wxFontData
& data
)
54 wxObject::operator=(data
);
55 m_fontColour
= data
.m_fontColour
;
56 m_showHelp
= data
.m_showHelp
;
57 m_allowSymbols
= data
.m_allowSymbols
;
58 m_enableEffects
= data
.m_enableEffects
;
59 m_initialFont
= data
.m_initialFont
;
60 m_chosenFont
= data
.m_chosenFont
;
61 m_minSize
= data
.m_minSize
;
62 m_maxSize
= data
.m_maxSize
;
63 m_encoding
= data
.m_encoding
;
64 m_encodingInfo
= data
.m_encodingInfo
;
68 #endif // wxUSE_FONTDLG || wxUSE_FONTPICKERCTRL
72 #include "wx/fontdlg.h"
74 wxFont
wxGetFontFromUser(wxWindow
*parent
, const wxFont
& fontInit
, const wxString
& caption
)
77 if ( fontInit
.IsOk() )
79 data
.SetInitialFont(fontInit
);
83 wxFontDialog
dialog(parent
, data
);
85 dialog
.SetTitle(caption
);
86 if ( dialog
.ShowModal() == wxID_OK
)
88 fontRet
= dialog
.GetFontData().GetChosenFont();
90 //else: leave it invalid
94 #endif // wxUSE_FONTDLG