00001 00002 // 00003 // MenuItem.h 00004 // 00005 // Supported menu items. 00006 // 00008 #ifndef MENUITEM_H 00009 #define MENUITEM_H 00010 00011 #include "Genesis.h" 00012 #include "Text.h" 00013 00014 #define MENU_MAXSTRINGSIZE 64 00015 00016 00017 #ifdef __cplusplus 00018 extern "C" { 00019 #endif 00020 00021 00023 // Supported menu items. 00025 typedef enum 00026 { 00027 Menu_ItemText = 0, 00028 Menu_ItemGraphic, 00029 Menu_ItemSlider, 00030 Menu_ItemField, 00031 Menu_ItemString, 00032 Menu_ItemToggle, 00033 Menu_ItemChecked 00034 } Menu_ItemType; 00035 00036 00038 // Text menu item. 00040 typedef struct 00041 { 00042 char *Text; // text 00043 int32 TextLength; // length of text 00044 FontType NormalFont; // regular font 00045 FontType SelectFont; // selected font 00046 00047 } MenuItemText_T; 00048 00049 00051 // Slider menu item. 00053 typedef struct 00054 { 00055 char *Text; // text 00056 int32 TextLength; // length of text 00057 FontType NormalFont; // regular font 00058 FontType SelectFont; // selected font 00059 geBitmap *Range; // slider range art 00060 geBitmap *Bar; // slider bar art 00061 int32 Slack; // amount of dead pixels in slider range art 00062 float Percent; // what percentage slider is at 00063 float Increment; // increment amount 00064 00065 } MenuItemSlider_T; 00066 00067 00069 // Field menu item. 00071 typedef struct 00072 { 00073 char *FieldName; // field name text 00074 int32 FieldNameLength; // length of field name text 00075 char FieldTextData[MENU_MAXSTRINGSIZE]; // data text 00076 int32 FieldTextDataLength; // length of data text 00077 FontType NormalFont; // regular font 00078 FontType SelectFont; // selected font 00079 geBoolean AwaitingChange; // field is awaiting input flag 00080 00081 } MenuItemField_T; 00082 00083 00085 // String menu item. 00087 typedef struct 00088 { 00089 char *StringLabel; // string label text 00090 int32 StringLabelLength; // length of string label text 00091 char StringData[MENU_MAXSTRINGSIZE]; // string data text 00092 int32 StringDataLength; // length of string data text 00093 FontType NormalFont; // regular font 00094 FontType SelectFont; // selected font 00095 geBoolean AwaitingInput; // string is awaiting input flag 00096 00097 } MenuItemString_T; 00098 00099 00101 // Graphic menu item. 00103 typedef struct 00104 { 00105 geBitmap *Art; // graphic art 00106 int32 x, y; // graphic location 00107 00108 } MenuItemGraphic_T; 00109 00110 00112 // Toggle menu item. 00114 typedef struct 00115 { 00116 char *ToggleLabel; // toggle label text 00117 int32 ToggleLabelLength; // length of toggle label text 00118 char ToggleData1[MENU_MAXSTRINGSIZE]; // toggle data text 00119 int32 ToggleData1Length; // length of toggle data text 00120 char ToggleData2[MENU_MAXSTRINGSIZE]; // toggle data text 00121 int32 ToggleData2Length; // length of toggle data text 00122 FontType NormalFont; // regular font 00123 FontType SelectFont; // selected font 00124 int32 ActiveItem; // currently active item 00125 00126 } MenuItemToggle_T; 00127 00129 // Checked menu item. 00131 #define MENUITEM_MAX_CHECKED_LABEL (100) 00132 typedef struct 00133 { 00134 char Label[MENUITEM_MAX_CHECKED_LABEL]; // label text 00135 int32 LabelLength; // length of label text 00136 FontType NormalFont; // regular font 00137 FontType SelectFont; // selected font 00138 int32 ActiveItem; // currently active item 00139 int32 LabelPosition; // left edge of label text ('check' is to the left) 00140 int32 UserData; // misc data. 00141 } MenuItemChecked_T; 00142 00143 00144 00145 #ifdef __cplusplus 00146 } 00147 #endif 00148 00149 #endif
1.3.2