1 /* 2 * Copyright 2001-2010, Haiku, Inc. 3 * Copyright 2003-2004 Kian Duffy, myob@users.sourceforge.net 4 * Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai. 5 * All rights reserved. Distributed under the terms of the MIT license. 6 */ 7 #ifndef APPEARANCE_PREF_VIEW_H 8 #define APPEARANCE_PREF_VIEW_H 9 10 11 #include <GroupView.h> 12 #include <Messenger.h> 13 #include <String.h> 14 15 16 static const uint32 MSG_HALF_FONT_CHANGED = 'mchf'; 17 static const uint32 MSG_HALF_SIZE_CHANGED = 'mchs'; 18 static const uint32 MSG_FULL_FONT_CHANGED = 'mcff'; 19 static const uint32 MSG_FULL_SIZE_CHANGED = 'mcfs'; 20 static const uint32 MSG_COLOR_FIELD_CHANGED = 'mccf'; 21 static const uint32 MSG_COLOR_CHANGED = 'mcbc'; 22 static const uint32 MSG_COLOR_SCHEMA_CHANGED = 'mccs'; 23 24 static const uint32 MSG_TAB_TITLE_SETTING_CHANGED = 'mtts'; 25 static const uint32 MSG_WINDOW_TITLE_SETTING_CHANGED = 'mwts'; 26 static const uint32 MSG_BLINK_CURSOR_CHANGED = 'mbcc'; 27 static const uint32 MSG_WARN_ON_EXIT_CHANGED = 'mwec'; 28 static const uint32 MSG_COLS_CHANGED = 'mccl'; 29 static const uint32 MSG_ROWS_CHANGED = 'mcrw'; 30 static const uint32 MSG_HISTORY_CHANGED = 'mhst'; 31 32 static const uint32 MSG_PREF_MODIFIED = 'mpmo'; 33 34 35 struct color_schema; 36 class BCheckBox; 37 class BColorControl; 38 class BMenu; 39 class BMenuField; 40 class BPopUpMenu; 41 class BTextControl; 42 43 44 class AppearancePrefView : public BGroupView { 45 public: 46 AppearancePrefView(const char* name, 47 const BMessenger &messenger); 48 49 virtual void Revert(); 50 virtual void MessageReceived(BMessage* message); 51 virtual void AttachedToWindow(); 52 53 virtual void GetPreferredSize(float* _width, 54 float* _height); 55 56 private: 57 void _EnableCustomColors(bool enable); 58 59 void _ChangeColorSchema(color_schema* schema); 60 void _SetCurrentColorSchema(BMenuField* field); 61 62 static BMenu* _MakeFontMenu(uint32 command, 63 const char* defaultFamily, 64 const char* defaultStyle); 65 static BMenu* _MakeSizeMenu(uint32 command, 66 uint8 defaultSize); 67 68 static BPopUpMenu* _MakeMenu(uint32 msg, const char** items, 69 const char* defaultItem); 70 71 static BPopUpMenu* _MakeColorSchemaMenu(uint32 msg, 72 const color_schema** schemas, 73 const color_schema* defaultItemName); 74 75 BCheckBox* fBlinkCursor; 76 BCheckBox* fWarnOnExit; 77 BMenuField* fFont; 78 BMenuField* fFontSize; 79 80 BMenuField* fColorSchemaField; 81 BMenuField* fColorField; 82 BColorControl* fColorControl; 83 84 BTextControl* fTabTitle; 85 BTextControl* fWindowTitle; 86 87 BMessenger fTerminalMessenger; 88 }; 89 90 91 #endif // APPEARANCE_PREF_VIEW_H 92