vdk 2.4.0
vdkcomboentry.h
00001 /*
00002  * ===========================
00003  * VDK Visual Develeopment Kit
00004  * Version 2.0.4
00005  * March 2004
00006  * ===========================
00007  *
00008  * Copyright (C) 1998 - 2004  Mario Motta
00009  * Developed by Mario Motta <mmotta@guest.net>
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Library General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Library General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Library General Public
00022  * License along with this library; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00024  * 02111-1307, USA.
00025  */
00026 
00027 #ifndef _vdkcomboentry_h_
00028 #define _vdkcomboentry_h_
00029 
00030 #ifdef HAVE_CONFIG_H
00031 #include <config.h>
00032 #endif
00033 
00034 #include <vdk/vdkobj.h>
00035 #include <vdk/value_sem_list.h>
00036 
00037 typedef VDKValueList<VDKString> StringList;
00038 typedef VDKValueListIterator<VDKString> StringListIterator;
00039 
00051 class VDKComboEntry: public VDKObject
00052 {
00053  protected:
00054   static int FocusOutEvent(GtkWidget *,  GdkEventFocus*, gpointer wid);
00055   static int FocusInEvent(GtkWidget *, GdkEventFocus*, gpointer wid);
00056   VDKObjectSignal s_activated, s_changed, s_selected;
00057  public:
00063   VDKComboEntry(VDKForm* owner, char** selections = NULL);
00064   virtual ~VDKComboEntry();  
00065 
00071   VDKReadWriteValueProp<VDKComboEntry,bool>  Editable;
00072   void SetEditable(bool flag)
00073     { gtk_entry_set_editable(GTK_ENTRY(GTK_BIN (widget)->child),flag); }
00078   VDKReadWriteValueProp<VDKComboEntry,int> Selected;
00079   int GetSelected()
00080     { return gtk_combo_box_get_active  (GTK_COMBO_BOX(widget)); }
00081   void SetSelected(int index)
00082     { gtk_combo_box_set_active  (GTK_COMBO_BOX(widget),index); }
00087   VDKReadWriteValueProp<VDKComboEntry,char*> Text;
00088   void SetText(char* text);
00089   char* GetText();
00090   // properties
00096   VDKReadWriteValueProp<VDKComboEntry,StringList*>  Selections;
00097   StringList* GetSelections(void);
00098   void SetSelections(StringList* selections);
00103   VDKReadWriteValueProp<VDKComboEntry,GtkListStore*> StoreModel;
00104   void SetStoreModel(GtkListStore* store_model);
00134   VDKReadWriteValueProp<VDKComboEntry,bool> Sorted;
00135   void SetSorted(bool flag);
00140   VDKReadWriteValueProp<VDKComboEntry,GtkSortType> SortingOrder;
00141   // overriden 
00142   virtual void SetBackground(VDKRgb rgb, GtkStateType state);
00143   virtual void SetForeground(VDKRgb rgb, GtkStateType state);
00144   virtual void SetFont(VDKFont* font);
00145 };
00146 
00147 #endif