xref: /haiku/src/apps/fontdemo/ControlView.h (revision 2f470aec1c92ce6917b8a903e343795dc77af41f)
1 /*
2  * Copyright 2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Mikael Konradson, mikael.konradson@gmail.com
7  */
8 #ifndef CONTROL_VIEW_H
9 #define CONTROL_VIEW_H
10 
11 
12 #include <View.h>
13 
14 
15 class BButton;
16 class BCheckBox;
17 class BHandler;
18 class BLooper;
19 class BMenu;
20 class BMenuField;
21 class BMessageRunner;
22 class BMessenger;
23 class BSlider;
24 class BTextControl;
25 
26 
27 class ControlView : public BView {
28 	public:
29 		ControlView(BRect rect);
30 		virtual ~ControlView();
31 
32 		virtual void AttachedToWindow();
33 		virtual void Draw(BRect updateRect);
34 		virtual void MessageReceived(BMessage* message);
35 		void SetTarget(BHandler* handler);
36 
37 	private:
38 		void _AddFontMenu(BRect rect);
39 		void _UpdateFontmenus(bool setInitialfont = false);
40 		void _DeselectOldItems();
41 
42 		void _UpdateAndSendFamily(const BMessage* message);
43 		void _UpdateAndSendStyle(const BMessage* message);
44 
45 		BMessenger*		fMessenger;
46 		BMessageRunner*	fMessageRunner;
47 		BTextControl*	fTextControl;
48 		BMenuField*		fFontMenuField;
49 		BSlider*		fFontsizeSlider;
50 		BSlider*		fShearSlider;
51 		BSlider*		fRotationSlider;
52 		BSlider*		fSpacingSlider;
53 		BSlider*		fOutlineSlider;
54 		BCheckBox*		fAliasingCheckBox;
55 		BCheckBox*		fBoundingboxesCheckBox;
56 		BButton*		fCyclingFontButton;
57 		BMenu*			fFontFamilyMenu;
58 		BMenu*			fDrawingModeMenu;
59 		bool 			fCycleFonts;
60 		int32 			fFontStyleindex;
61 };
62 
63 #endif	// CONTROL_VIEW_H
64 
65