00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _FLU_HELPERS_H
00017 #define _FLU_HELPERS_H
00018
00019 #include <FL/Fl.H>
00020 #include <FL/Fl_Window.H>
00021 #include <FL/Fl_Button.H>
00022 #include <FL/Fl_Valuator.H>
00023 #include <FL/Fl_Menu_.H>
00024 #include <FL/Fl_Menu_Item.H>
00025 #include "FLU/Flu_Enumerations.h"
00026
00027
00028 inline static void fl_exit()
00029 { while( Fl::first_window() ) Fl::first_window()->hide(); }
00030
00031
00032
00033 FLU_EXPORT void fl_Set_Menu_Item_Active_State( Fl_Menu_* menu, const char* fullname, bool active );
00034
00035
00036
00037
00038 FLU_EXPORT int fl_Full_Find_In_Menu( const Fl_Menu_* menu, const char* fullname );
00039 inline int fl_Full_Find_In_Menu( const Fl_Menu_& menu, const char* fullname )
00040 { return fl_Full_Find_In_Menu( &menu, fullname ); }
00041
00042
00043
00044
00045 inline const Fl_Menu_Item *fl_Full_Find_Item_In_Menu( const Fl_Menu_* menu, const char* fullname )
00046 {
00047 int index = fl_Full_Find_In_Menu( menu, fullname );
00048 return (index != -1) ? &(((Fl_Menu_Item*)menu->menu())[index]) : 0;
00049 }
00050 inline const Fl_Menu_Item *fl_Full_Find_Item_In_Menu( const Fl_Menu_& menu, const char* fullname )
00051 { return fl_Full_Find_Item_In_Menu( &menu, fullname ); }
00052
00053
00054
00055
00056 FLU_EXPORT int fl_Find_In_Menu( const Fl_Menu_* menu, const char* name );
00057 inline int fl_Find_In_Menu( const Fl_Menu_& menu, const char* name )
00058 { return fl_Find_In_Menu( &menu, name ); }
00059
00060
00061 inline static void fl_Show_Window_Callback( Fl_Widget* w, void* arg )
00062 { ((Fl_Window*)arg)->show(); }
00063
00064
00065 inline static void fl_Hide_Window_Callback( Fl_Widget* w, void* arg )
00066 { ((Fl_Window*)arg)->hide(); }
00067
00068
00069 inline static void fl_Activate_On_Value_Callback( Fl_Widget* w, void *arg )
00070 { if( ((Fl_Button*)w)->value() ) ((Fl_Widget*)arg)->activate(); else ((Fl_Widget*)arg)->deactivate(); }
00071
00072
00073
00074
00075
00076 inline static void fl_Hide_Window_And_Set_User_Data_Callback( Fl_Widget* w, void* arg )
00077 { ((Fl_Window*)arg)->user_data( w ); ((Fl_Window*)arg)->hide(); }
00078
00079
00080 inline static void fl_Get_Button_Value_Callback( Fl_Widget* w, void* arg )
00081 { *((int*)arg) = ((Fl_Button*)w)->value(); }
00082
00083
00084 inline static void fl_Get_Valuator_Value_Callback( Fl_Widget* w, void* arg )
00085 { *((float*)arg) = ((Fl_Valuator*)w)->value(); }
00086
00087 #endif