checkbutton.h

00001 /*
00002  * ===========================
00003  * VDK Visual Develeopment Kit
00004  * Version 0.4
00005  * October 1998
00006  * ===========================
00007  *
00008  * Copyright (C) 1998, Mario Motta
00009  * Developed by Mario Motta <mmotta@guest.net>
00010  *
00011  * Modify by Salmaso Raffaele <r.salmaso@flashnet.it> 10 Jan 1999
00012  * added 2 property: Caption and CaptionWrap
00013  * added new constructor option: tooltip
00014  *
00015  * This library is free software; you can redistribute it and/or
00016  * modify it under the terms of the GNU Library General Public
00017  * License as published by the Free Software Foundation; either
00018  * version 2 of the License, or (at your option) any later version.
00019  *
00020  * This library is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00023  * Library General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU Library General Public
00026  * License along with this library; if not, write to the Free Software
00027  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00028  * 02111-1307, USA.
00029  */
00030 
00031 #ifndef CHECKBUTTON_H
00032 #define CHECKBUTTON_H
00033 #include <vdk/abstract_button.h>
00034 #include <vdk/vdkprops.h>
00035 #include <vdk/tooltips.h>
00036 
00037 class VDKForm;
00044 class VDKCheckButton: public VDKAbstractButton
00045 {
00046   VDKTooltip* tooltip;
00047 protected:
00048   int connectId;
00049   static void ToggleEvent(GtkWidget *wid, gpointer obj);
00050 public:
00051   // properties
00056   VDKReadWriteValueProp<VDKCheckButton,bool> Checked;
00060   VDKReadWriteValueProp<VDKCheckButton, char*> Caption;
00064   VDKReadWriteValueProp<VDKCheckButton, bool> CaptionWrap;
00071   VDKCheckButton(VDKForm* owner,char* label = (char*) NULL, char* tip = 0);
00072   virtual ~VDKCheckButton() {}
00076   void Toggle() { Checked = Checked ? false : true; }
00077   void SetChecked(bool flag) 
00078     { gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(widget),flag);}
00079   bool GetChecked()
00080     { return GTK_TOGGLE_BUTTON(widget)->active ? true : false; }
00081 
00082   void SetCaption (char* str);
00083   char* GetCaption ();
00084   void SetCaptionWrap (bool flag);
00085   bool GetCaptionWrap ();
00086 
00087   virtual void SetForeground(VDKRgb color, GtkStateType state);
00088   virtual void SetFont(VDKFont* font);
00089 #ifdef USE_SIGCPLUSPLUS
00090  public:
00095   VDKSignal1<void, bool> OnButtonToggled;
00096 #endif  
00097 };
00098 
00099 #endif

Generated on Fri Nov 10 15:11:22 2006 for vdk 2.4.0 by  doxygen 1.5.1