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 xpopup.h 22 * 23 * Prototypes for xpop-up menus 24 */ 25 26 #ifndef FL_XPOPUP_H 27 #define FL_XPOPUP_H 28 29 30 #define FL_MAXPUPI 128 /* max item each pup */ 31 #define FL_PUP_PADH 4 /* space between each items */ 32 33 typedef void ( * FL_PUP_ENTERCB )( int, void * ); /* call back prototype */ 34 typedef void ( * FL_PUP_LEAVECB )( int, void * ); /* call back prototype */ 35 36 FL_EXPORT int fl_setpup_entries( int nm, 37 FL_PUP_ENTRY * entries ); 38 39 FL_EXPORT int fl_newpup( Window win ); 40 41 FL_EXPORT int fl_defpup( Window win, 42 const char * str, 43 ... ); 44 45 FL_EXPORT int fl_addtopup( int n, 46 const char * str, 47 ... ); 48 49 FL_EXPORT int fl_setpup_mode( int nm, 50 int ni, 51 unsigned int mode ); 52 53 FL_EXPORT void fl_freepup( int n ); 54 55 FL_EXPORT int fl_dopup( int n ); 56 57 58 FL_EXPORT Cursor fl_setpup_default_cursor( int cursor ); 59 60 FL_EXPORT void fl_setpup_default_color( FL_COLOR fg, 61 FL_COLOR bg ); 62 63 FL_EXPORT void fl_setpup_default_pup_checked_color( FL_COLOR col ); 64 65 FL_EXPORT int fl_setpup_default_fontsize( int size ); 66 67 FL_EXPORT int fl_setpup_default_fontstyle( int style ); 68 69 #define fl_setpup_fontsize fl_setpup_default_fontsize 70 #define fl_setpup_fontstyle fl_setpup_default_fontstyle 71 #define fl_setpup_color fl_setpup_default_color 72 #define fl_setpup_default_checkcolor fl_setpup_default_pup_checked_color 73 #define fl_setpup_checkcolor fl_setpup_default_pup_checked_color 74 75 FL_EXPORT int fl_setpup_default_bw( int bw ); 76 77 FL_EXPORT void fl_setpup_shortcut( int nm, 78 int ni, 79 const char * sc ); 80 81 FL_EXPORT void fl_setpup_position( int x, 82 int y ); 83 84 FL_EXPORT void fl_setpup_align_bottom( void ); 85 86 FL_EXPORT void fl_setpup_selection( int nm, 87 int ni ); 88 89 FL_EXPORT void fl_setpup_shadow( int n, 90 int y ); 91 92 FL_EXPORT void fl_setpup_softedge( int n, 93 int y ); 94 95 FL_EXPORT void fl_setpup_bw( int n, 96 int bw ); 97 98 FL_EXPORT void fl_setpup_title( int nm, 99 const char * title ); 100 101 FL_EXPORT void fl_setpup_title_f( int nm, 102 const char * fmt, 103 ... ); 104 105 FL_EXPORT FL_PUP_ENTERCB fl_setpup_entercb( int nm, 106 FL_PUP_ENTERCB cb, 107 void * data ); 108 109 FL_EXPORT FL_PUP_LEAVECB fl_setpup_leavecb( int nm, 110 FL_PUP_LEAVECB cb, 111 void * data ); 112 113 FL_EXPORT void fl_setpup_pad( int n, 114 int padw, 115 int padh ); 116 117 FL_EXPORT Cursor fl_setpup_cursor( int nm, 118 int cursor ); 119 120 FL_EXPORT int fl_setpup_maxpup( int n ); 121 122 FL_EXPORT unsigned int fl_getpup_mode( int nm, 123 int ni ); 124 125 FL_EXPORT const char * fl_getpup_text( int nm, 126 int ni ); 127 128 FL_EXPORT void fl_showpup( int n ); 129 130 FL_EXPORT void fl_hidepup( int n ); 131 132 FL_EXPORT int fl_getpup_items( int n ); 133 134 FL_EXPORT int fl_current_pup( void ); 135 136 #define fl_setpup_hotkey fl_setpup_shortcut 137 138 FL_EXPORT FL_PUP_CB fl_setpup_itemcb( int nm, 139 int ni, 140 FL_PUP_CB cb ); 141 142 FL_EXPORT FL_PUP_CB fl_setpup_menucb( int nm, 143 FL_PUP_CB cb ); 144 145 FL_EXPORT void fl_setpup_submenu( int m, 146 int i, 147 int subm ); 148 149 #define fl_setpup fl_setpup_mode 150 151 #endif /* ! defined FL_XPOPUP_H */ 152