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
00034 FLU_EXPORT int fl_Full_Find_In_Menu( const Fl_Menu_* menu, const char* fullname );
00035 inline int fl_Full_Find_In_Menu( const Fl_Menu_& menu, const char* fullname )
00036 { return fl_Full_Find_In_Menu( &menu, fullname ); }
00037
00038
00039
00040
00041 inline const Fl_Menu_Item *fl_Full_Find_Item_In_Menu( const Fl_Menu_* menu, const char* fullname )
00042 {
00043 int index = fl_Full_Find_In_Menu( menu, fullname );
00044 return (index != -1) ? &(((Fl_Menu_Item*)menu->menu())[index]) : 0;
00045 }
00046 inline const Fl_Menu_Item *fl_Full_Find_Item_In_Menu( const Fl_Menu_& menu, const char* fullname )
00047 { return fl_Full_Find_Item_In_Menu( &menu, fullname ); }
00048
00049
00050
00051
00052 FLU_EXPORT int fl_Find_In_Menu( const Fl_Menu_* menu, const char* name );
00053 inline int fl_Find_In_Menu( const Fl_Menu_& menu, const char* name )
00054 { return fl_Find_In_Menu( &menu, name ); }
00055
00056
00057 inline static void fl_Show_Window_Callback( Fl_Widget* w, void* arg )
00058 { ((Fl_Window*)arg)->show(); }
00059
00060
00061 inline static void fl_Hide_Window_Callback( Fl_Widget* w, void* arg )
00062 { ((Fl_Window*)arg)->hide(); }
00063
00064
00065
00066
00067
00068 inline static void fl_Hide_Window_And_Set_User_Data_Callback( Fl_Widget* w, void* arg )
00069 { ((Fl_Window*)arg)->user_data( w ); ((Fl_Window*)arg)->hide(); }
00070
00071
00072 inline static void fl_Get_Button_Value_Callback( Fl_Widget* w, void* arg )
00073 { *((int*)arg) = ((Fl_Button*)w)->value(); }
00074
00075
00076 inline static void fl_Get_Valuator_Value_Callback( Fl_Widget* w, void* arg )
00077 { *((float*)arg) = ((Fl_Valuator*)w)->value(); }
00078
00079 #endif