2 * Copyright 2001-2009, Haiku.
3 * Distributed under the terms of the MIT License.
7 * DarkWyrm <bpmagic@columbus.rr.com>
8 * Axel Dörfler, axeld@pinc-software.de
9 * Philippe Saint-Pierre, stpere@gmail.com
11 #ifndef FONT_SELECTION_VIEW_H
12 #define FONT_SELECTION_VIEW_H
23 static const int32 kMsgSetFamily
= 'fmly';
24 static const int32 kMsgSetStyle
= 'styl';
25 static const int32 kMsgSetSize
= 'size';
28 class FontSelectionView
: public BView
{
30 FontSelectionView(const char* name
,
32 const BFont
* font
= NULL
);
33 virtual ~FontSelectionView();
35 virtual void MessageReceived(BMessage
* message
);
37 void SetTarget(BHandler
* messageTarget
);
44 void UpdateFontsMenu();
46 BLayoutItem
* CreateSizesLabelLayoutItem();
47 BLayoutItem
* CreateSizesMenuBarLayoutItem();
49 BLayoutItem
* CreateFontsLabelLayoutItem();
50 BLayoutItem
* CreateFontsMenuBarLayoutItem();
52 BView
* GetPreviewBox();
55 void _SelectCurrentFont(bool select
);
56 void _SelectCurrentSize(bool select
);
57 void _UpdateFontPreview();
58 void _UpdateSystemFont();
59 void _BuildSizesMenu();
62 BHandler
* fMessageTarget
;
64 BMenuField
* fFontsMenuField
;
65 BMenuField
* fSizesMenuField
;
66 BPopUpMenu
* fFontsMenu
;
67 BPopUpMenu
* fSizesMenu
;
70 BStringView
* fPreviewText
;
74 float fMaxFontNameWidth
;
77 #endif // FONT_SELECTION_VIEW_H