1 /* 2 * This file is part of the XForms library package. 3 * 4 * XForms is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU Lesser General Public License as 6 * published by the Free Software Foundation; either version 2.1, or 7 * (at your option) any later version. 8 * 9 * XForms is distributed in the hope that it will be useful, but 10 * WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public License 15 * along with XForms. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 /********************** crop here for forms.h **********************/ 19 20 /** 21 * \file choice.h 22 * 23 */ 24 25 #ifndef FL_CHOICE_H 26 #define FL_CHOICE_H 27 28 29 typedef enum { 30 FL_NORMAL_CHOICE, 31 FL_NORMAL_CHOICE2, 32 FL_DROPLIST_CHOICE, 33 FL_BROWSER_CHOICE 34 } FL_CHOICE_TYPE; 35 36 #define FL_SIMPLE_CHOICE FL_NORMAL_CHOICE 37 38 /***** Defaults *****/ 39 40 #define FL_CHOICE_BOXTYPE FL_ROUNDED_BOX 41 #define FL_CHOICE_COL1 FL_COL1 42 #define FL_CHOICE_COL2 FL_LCOL 43 #define FL_CHOICE_LCOL FL_LCOL 44 #define FL_CHOICE_ALIGN FL_ALIGN_LEFT 45 46 /***** Others *****/ 47 48 #define FL_CHOICE_MCOL FL_MCOL 49 #define FL_CHOICE_MAXITEMS 128 50 51 /***** Routines *****/ 52 53 FL_EXPORT FL_OBJECT * fl_create_choice( int type, 54 FL_Coord x, 55 FL_Coord y, 56 FL_Coord w, 57 FL_Coord h, 58 const char * label ); 59 60 FL_EXPORT FL_OBJECT * fl_add_choice( int type, 61 FL_Coord x, 62 FL_Coord y, 63 FL_Coord w, 64 FL_Coord h, 65 const char * label ); 66 67 FL_EXPORT void fl_clear_choice( FL_OBJECT * ob ); 68 69 FL_EXPORT int fl_addto_choice( FL_OBJECT * ob, 70 const char * str ); 71 72 FL_EXPORT int fl_addto_choice_f( FL_OBJECT * ob, 73 const char * fmt, 74 ... ); 75 76 FL_EXPORT void fl_replace_choice( FL_OBJECT * ob, 77 int numb, 78 const char * str ); 79 80 FL_EXPORT void fl_replace_choice_f( FL_OBJECT * ob, 81 int numb, 82 const char * fmt, 83 ... ); 84 85 FL_EXPORT void fl_delete_choice( FL_OBJECT * ob, 86 int numb ); 87 88 FL_EXPORT void fl_set_choice( FL_OBJECT * ob, 89 int choice ); 90 91 FL_EXPORT void fl_set_choice_text( FL_OBJECT * ob, 92 const char * txt ); 93 94 FL_EXPORT void fl_set_choice_text_f( FL_OBJECT * ob, 95 const char * fmt, 96 ... ); 97 98 FL_EXPORT int fl_get_choice( FL_OBJECT * ob ); 99 100 FL_EXPORT const char * fl_get_choice_item_text( FL_OBJECT * ob, 101 int n ); 102 103 FL_EXPORT int fl_get_choice_maxitems( FL_OBJECT * ob ); 104 105 FL_EXPORT const char * fl_get_choice_text( FL_OBJECT * ob ); 106 107 FL_EXPORT void fl_set_choice_fontsize( FL_OBJECT * ob, 108 int size ); 109 110 FL_EXPORT void fl_set_choice_fontstyle( FL_OBJECT * ob, 111 int style ); 112 113 FL_EXPORT void fl_set_choice_align( FL_OBJECT * ob, 114 int align ); 115 116 FL_EXPORT int fl_get_choice_item_mode( FL_OBJECT * ob, 117 int item ); 118 119 FL_EXPORT void fl_set_choice_item_mode( FL_OBJECT * ob, 120 int item, 121 unsigned int mode ); 122 123 FL_EXPORT void fl_set_choice_item_shortcut( FL_OBJECT * ob, 124 int item, 125 const char * sc ); 126 127 FL_EXPORT int fl_set_choice_entries( FL_OBJECT * ob, 128 FL_PUP_ENTRY * ent ); 129 130 FL_EXPORT int fl_set_choice_notitle( FL_OBJECT * ob, 131 int n ); 132 133 FL_EXPORT int fl_set_choice_align_bottom( FL_OBJECT * ob, 134 int n ); 135 136 #endif /* ! defined FL_CHOICE_H */ 137