00001 /* 00002 ClanGUI, copyrights by various people. Have a look in the CREDITS file. 00003 00004 This sourcecode is distributed using the Library GNU Public Licence, 00005 version 2 or (at your option) any later version. Please read LICENSE 00006 for details. 00007 */ 00008 00009 #ifndef header_menuitem_default 00010 #define header_menuitem_default 00011 00012 #include "API/GUI/menuitem.h" 00013 #include "API/GUI/stylemanager_default.h" 00014 #include "API/GUI/component_style.h" 00015 00016 class CL_Font; 00017 class CL_Surface; 00018 00019 class CL_MenuItem_Default : public CL_ComponentStyle 00020 { 00021 public: 00022 CL_MenuItem_Default( 00023 CL_MenuItem *menuitem, 00024 const CL_ComponentOptions &options, 00025 CL_StyleManager_Default *style); 00026 00027 virtual ~CL_MenuItem_Default(); 00028 00029 int calc_height(); 00030 int calc_width(); 00031 00032 int calc_text_width(); 00033 int calc_surface_check_width(); 00034 int calc_surface_icon_width(); 00035 int calc_surface_submenu_width(); 00036 00037 void set_surface_check_pos(int pos) { surface_check_pos = pos; } 00038 void set_surface_icon_pos(int pos) { surface_icon_pos = pos; } 00039 void set_surface_submenu_pos(int pos) { surface_submenu_pos = pos; } 00040 void set_text_pos(int pos) { text_pos = pos; } 00041 00042 void set_draw_style(bool filled); 00043 00044 void on_paint(); 00045 00046 private: 00047 CL_Slot slot_paint; 00048 00049 CL_MenuItem *menuitem; 00050 00051 bool draw_filled; 00052 bool draw_submenu_icon; 00053 00054 int surface_check_pos; 00055 int surface_icon_pos; 00056 int surface_submenu_pos; 00057 int text_pos; 00058 00059 CL_Font *font; 00060 00061 CL_Surface *sur_icon; 00062 CL_Surface *sur_checked; 00063 CL_Surface *sur_unchecked; 00064 CL_Surface *sur_submenu; 00065 00066 CL_StyleManager_Default *style; 00067 CL_ResourceManager *resources; 00068 }; 00069 00070 #endif
1.2.6 written by Dimitri van Heesch,
© 1997-2001