2 * Copyright 2001-2010, 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
10 * Stephan Aßmus <superstippi@gmx.de>
12 #ifndef FONT_SELECTION_VIEW_H
13 #define FONT_SELECTION_VIEW_H
28 class FontSelectionView
: public BHandler
{
30 FontSelectionView(const char* name
,
31 const char* label
, bool separateStyles
,
32 const BFont
* font
= NULL
);
33 virtual ~FontSelectionView();
35 void AttachedToLooper();
36 virtual void MessageReceived(BMessage
* message
);
38 void SetMessage(BMessage
* message
);
39 void SetTarget(BHandler
* target
);
41 void SetFont(const BFont
& font
, float size
);
42 void SetFont(const BFont
& font
);
43 void SetSize(float size
);
44 const BFont
& Font() const;
51 void UpdateFontsMenu();
53 BLayoutItem
* CreateSizesLabelLayoutItem();
54 BLayoutItem
* CreateSizesMenuBarLayoutItem();
56 BLayoutItem
* CreateFontsLabelLayoutItem();
57 BLayoutItem
* CreateFontsMenuBarLayoutItem();
59 BLayoutItem
* CreateStylesLabelLayoutItem();
60 BLayoutItem
* CreateStylesMenuBarLayoutItem();
62 BView
* PreviewBox() const;
67 BFont
_DefaultFont() const;
68 void _SelectCurrentFont(bool select
);
69 void _SelectCurrentSize(bool select
);
70 void _UpdateFontPreview();
71 void _BuildSizesMenu();
72 void _AddStylesToMenu(const BFont
& font
,
76 BMenuField
* fFontsMenuField
;
77 BMenuField
* fStylesMenuField
;
78 BMenuField
* fSizesMenuField
;
79 BPopUpMenu
* fFontsMenu
;
80 BPopUpMenu
* fStylesMenu
;
81 BPopUpMenu
* fSizesMenu
;
82 BStringView
* fPreviewText
;
91 #endif // FONT_SELECTION_VIEW_H