vdk 2.4.0
entry.h
1 /*
2  * ===========================
3  * VDK Visual Develeopment Kit
4  * Version 0.4
5  * October 1998
6  * ===========================
7  *
8  * Copyright (C) 1998, Mario Motta
9  * Developed by Mario Motta <mmotta@guest.net>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  * 02111-1307, USA.
25  */
26 
27 #ifndef ENTRY_H
28 #define ENTRY_H
29 
30 #include <vdk/vdkobj.h>
31 #include <vdk/vdkprops.h>
32 #include <vdk/vdkstring.h>
33 //#include <string.h>
34 
46 class VDKEntry: public VDKObject
47 {
48  static int FocusOutEvent(GtkWidget *w,
49  GdkEventFocus *event,
50  gpointer wid);
51  static int FocusInEvent(GtkWidget *w,
52  GdkEventFocus *event,
53  gpointer wid);
54  VDKString buffer;
55  protected:
56  int changeConnect;
57  VDKObjectSignal s_activated, s_changed;
58 public:
59  // properties
69  VDKReadWriteValueProp<VDKEntry,char*> Text;
73  VDKReadWriteValueProp<VDKEntry,bool> Editable;
79  VDKReadWriteValueProp<VDKEntry,bool> Hidden;
80  //
81  VDKEntry(VDKForm* owner,int maxLen = 0, char* def = (char*) NULL);
82 
83  virtual ~VDKEntry();
88  void SetCompletion(char** completion_list);
93  void AddCompletionItem(char* completion_item);
98  void RemoveCompletionItem(char* completion_item);
99  /*
100  */
101  void SetText(char* text);
102  char* GetText();
103  void SetEditable(bool flag)
104  { gtk_entry_set_editable(GTK_ENTRY(widget),flag); }
105  bool GetEditable() { return Editable; }
106  virtual void SetBackground(VDKRgb rgb, GtkStateType state);
107  virtual void SetForeground(VDKRgb rgb, GtkStateType state);
108  virtual void SetFont(VDKFont* font);
109  void SetHidden(bool flag)
110  { gtk_entry_set_visibility(GTK_ENTRY(widget), ! flag) ; }
111  bool GetHidden()
112  { return ! Hidden; }
113 };
114 #endif
This class provides a gtkentry wrapper.
Definition: entry.h:47
void RemoveCompletionItem(char *completion_item)
Definition: entry.cc:257
VDKReadWriteValueProp< VDKEntry, char * > Text
Definition: entry.h:69
VDKReadWriteValueProp< VDKEntry, bool > Editable
Definition: entry.h:73
VDKReadWriteValueProp< VDKEntry, bool > Hidden
Definition: entry.h:79
virtual void SetForeground(VDKRgb rgb, GtkStateType state)
Definition: entry.cc:168
void AddCompletionItem(char *completion_item)
Definition: entry.cc:240
virtual void SetFont(VDKFont *font)
Definition: entry.cc:185
void SetCompletion(char **completion_list)
Definition: entry.cc:215
virtual void SetBackground(VDKRgb rgb, GtkStateType state)
Definition: entry.cc:153
Provides a raw font.
Definition: vdkfont.h:38
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:69
Definition: vdkobj.h:141
GtkWidget * widget
Definition: vdkobj.h:241
Provides a simple RGB color structure.
Definition: vdkutils.h:38
Implements famous cont referenced string objects.
Definition: vdkstring.h:46
Definition: vdkobj.h:62