• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

AiksaurusGTK_picbutton.h

Go to the documentation of this file.
00001 /*
00002  * AiksaurusGTK - A GTK interface to the AikSaurus library
00003  * Copyright (C) 2001 by Jared Davis
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00018  * 02111-1307, USA.
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     // Possible button states
00039 
00040         bool d_hashover;
00041         bool d_hasmenu;
00042         bool d_mouseover;
00043         bool d_menushowing;
00044         bool d_enabled;
00045 
00046 
00047     // Member Widgets
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     // Callback Functions
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     // Mouse Hovering Actions
00076 
00077         void handleRelief();
00078         void hover();
00079         void unhover();
00080 
00081 
00082     // Menu Activation and Deactivation
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     // Prevent Copying and Assignment
00093 
00094         AiksaurusGTK_picbutton(const AiksaurusGTK_picbutton&);
00095         const AiksaurusGTK_picbutton& operator=(const AiksaurusGTK_picbutton&);
00096 
00097 
00098 
00099     public:
00100 
00101     // Construction and Destruction
00102 
00103         AiksaurusGTK_picbutton(GtkWidget *window, const char** normal);
00104         AiksaurusGTK_picbutton(GtkWidget *window, const char* stock);
00105         ~AiksaurusGTK_picbutton();
00106 
00107 
00108     // Manipulation
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

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1