xref: /haiku/src/apps/fontdemo/ControlView.h (revision 344180b745382739599785a821295dbf32a0e7ca)
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 <GroupView.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 BGroupView {
28 	public:
29 		ControlView();
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();
39 		void _AddDrawingModeMenu();
40 		void _UpdateFontmenus(bool setInitialfont = false);
41 		void _DeselectOldItems();
42 
43 		void _UpdateAndSendFamily(const BMessage* message);
44 		void _UpdateAndSendStyle(const BMessage* message);
45 
46 		BMessenger*		fMessenger;
47 		BMessageRunner*	fMessageRunner;
48 		BTextControl*	fTextControl;
49 		BMenuField*		fFontMenuField;
50 		BSlider*		fFontsizeSlider;
51 		BSlider*		fShearSlider;
52 		BSlider*		fRotationSlider;
53 		BSlider*		fSpacingSlider;
54 		BSlider*		fOutlineSlider;
55 		BCheckBox*		fAliasingCheckBox;
56 		BCheckBox*		fBoundingboxesCheckBox;
57 		BButton*		fCyclingFontButton;
58 		BMenu*			fFontFamilyMenu;
59 		BMenu*			fDrawingModeMenu;
60 		bool 			fCycleFonts;
61 		int32 			fFontStyleindex;
62 };
63 
64 #endif	// CONTROL_VIEW_H
65 
66