00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef ENTRY_H
00028 #define ENTRY_H
00029
00030 #include <vdk/vdkobj.h>
00031 #include <vdk/vdkprops.h>
00032 #include <vdk/vdkstring.h>
00033
00034
00046 class VDKEntry: public VDKObject
00047 {
00048 static int FocusOutEvent(GtkWidget *w,
00049 GdkEventFocus *event,
00050 gpointer wid);
00051 static int FocusInEvent(GtkWidget *w,
00052 GdkEventFocus *event,
00053 gpointer wid);
00054 VDKString buffer;
00055 protected:
00056 int changeConnect;
00057 VDKObjectSignal s_activated, s_changed;
00058 public:
00059
00069 VDKReadWriteValueProp<VDKEntry,char*> Text;
00073 VDKReadWriteValueProp<VDKEntry,bool> Editable;
00079 VDKReadWriteValueProp<VDKEntry,bool> Hidden;
00080
00081 VDKEntry(VDKForm* owner,int maxLen = 0, char* def = (char*) NULL);
00082 virtual ~VDKEntry();
00083 void SetText(char* text);
00084
00085 char* GetText();
00086 void SetEditable(bool flag)
00087 { gtk_entry_set_editable(GTK_ENTRY(widget),flag); }
00088 bool GetEditable() { return Editable; }
00089 virtual void SetBackground(VDKRgb rgb, GtkStateType state);
00090 virtual void SetForeground(VDKRgb rgb, GtkStateType state);
00091 virtual void SetFont(VDKFont* font);
00092 void SetHidden(bool flag)
00093 { gtk_entry_set_visibility(GTK_ENTRY(widget), ! flag) ; }
00094 bool GetHidden()
00095 { return ! Hidden; }
00096 };
00097 #endif