Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef INCLUDED_GPL_JARED_AIKSAURUSGTK_PICBUTTON_H
00022 #define INCLUDED_GPL_JARED_AIKSAURUSGTK_PICBUTTON_H
00023
00024 #include "ut_compiler.h"
00025
00026 #include <glib.h>
00027 ABI_W_NO_CONST_QUAL
00028 #include <gtk/gtk.h>
00029 ABI_W_POP
00030
00031 #include "AiksaurusGTK_strlist.h"
00032
00033 class AiksaurusGTK_menudata;
00034 class AiksaurusGTK_picbutton
00035 {
00036 private:
00037
00038
00039
00040 bool d_hashover;
00041 bool d_hasmenu;
00042 bool d_mouseover;
00043 bool d_menushowing;
00044 bool d_enabled;
00045
00046
00047
00048
00049 GtkWidget* d_window_ptr;
00050 GtkWidget* d_button_ptr;
00051 GtkWidget* d_pixmap_ptr;
00052
00053 int d_numVisible;
00054
00055 GtkWidget* d_menu_ptr;
00056 GtkWidget* d_menu_button_ptr;
00057 GdkPixbuf* d_menu_mask_ptr;
00058 GtkWidget* d_menu_pixmap_widget_ptr;
00059
00060 GCallback d_onclick_function;
00061 gpointer d_onclick_data;
00062
00063 AiksaurusGTK_menudata* d_menu_data_ptr;
00064 AiksaurusGTK_strlist* d_menu_options_ptr;
00065
00066
00067
00068 static void cbHover(GtkWidget* w, gpointer data);
00069 static void cbUnhover(GtkWidget* w, gpointer data);
00070 static void cbPopMenu(GtkWidget* w, gpointer data);
00071 static void cbPopupFunction(GtkMenu* menu, int* x, int* y, gboolean* notUsedBool, gpointer data);
00072 static void cbSelectionDone(GtkMenuShell* menushell, gpointer data);
00073 static void cbMenuActivate(GtkMenuItem* item, gpointer data);
00074
00075
00076
00077 void handleRelief();
00078 void hover();
00079 void unhover();
00080
00081
00082
00083
00084 void popMenu();
00085 void popupFunction(int* x, int* y);
00086 void selectionDone();
00087 void menuActivate(gpointer item);
00088
00089 void menuCreate();
00090
00091
00092
00093
00094 AiksaurusGTK_picbutton(const AiksaurusGTK_picbutton&);
00095 const AiksaurusGTK_picbutton& operator=(const AiksaurusGTK_picbutton&);
00096
00097
00098
00099 public:
00100
00101
00102
00103 AiksaurusGTK_picbutton(GtkWidget *window, const char** normal);
00104 AiksaurusGTK_picbutton(GtkWidget *window, const char* stock);
00105 ~AiksaurusGTK_picbutton();
00106
00107
00108
00109
00110 void setHoverPicture(const char** hover);
00111 void addMenu(const AiksaurusGTK_strlist& options, GCallback onClick, gpointer onClickData);
00112 void updateMenuOptions();
00113 void limitVisibleOptions(int numVisible);
00114
00115 void disable();
00116 void enable();
00117
00118 GtkWidget* getButton();
00119 GtkWidget* getMenuButton();
00120 };
00121
00122 #endif // INCLUDED_GPL_JARED_AIKSAURUSGTK_PICBUTTON_H