vdk 2.4.0
Public Member Functions | Public Attributes | List of all members
VDKComboEntry Class Reference

Provides a simplified wrapper for gtkcombo_entry. More...

#include <vdkcomboentry.h>

Inheritance diagram for VDKComboEntry:
Inheritance graph
[legend]
Collaboration diagram for VDKComboEntry:
Collaboration graph
[legend]

Public Member Functions

 VDKComboEntry (VDKForm *owner, char **selections=NULL)
 
virtual void SetBackground (VDKRgb rgb, GtkStateType state)
 
virtual void SetForeground (VDKRgb rgb, GtkStateType state)
 
virtual void SetFont (VDKFont *font)
 
- Public Member Functions inherited from VDKObject
VDKRgb GetBackground (GtkStateType state=GTK_STATE_NORMAL)
 
VDKRgb GetForeground (GtkStateType state=GTK_STATE_NORMAL)
 
 VDKObject (VDKForm *owner=NULL)
 
 VDKObject (VDKForm *owner, GtkWidget *widget)
 
virtual ~VDKObject ()
 
bool Destroy ()
 
virtual int isA ()
 
VDKFormOwner ()
 
virtual GtkWidget * Widget ()
 
GtkWidget * ConnectingWidget ()
 
GtkWidget * WrappedWidget ()
 
VDKFontGetFont ()
 
void SetVisible (bool visible)
 
bool GetVisible ()
 
void SetCursor (VDKCursorType)
 
VDKCursorType GetCursor ()
 
void SetSize (int w, int h)
 
void SetUsize (VDKPoint s)
 
virtual void SetTip (char *)
 
virtual void Add (VDKObject *obj, int justify=l_justify, int expand=TRUE, int fill=TRUE, int padding=0)
 
ItemListItems ()
 
void Draw (GdkRectangle *area=NULL)
 
virtual void Setup ()
 
void SignalEmit (int signal)
 
void SignalEmit (char *sig)
 
void SignalEmitParent (int signal)
 
void SignalEmitParent (char *sig)
 
void GrabFocus ()
 
VDKObjectParent (VDKObject *p=NULL)
 
int SignalConnect (VDKObject *obj, char *signal, bool(VDKObject::*method)(VDKObject *), bool gtk=true, bool after=false)
 
int SignalConnect (char *signal, bool(VDKObject::*method)(VDKObject *), bool gtk=true, bool after=false)
 
bool SignalDisconnect (int connection)
 
int EventConnect (VDKObject *obj, char *event, bool(VDKObject::*method)(VDKObject *, GdkEvent *), bool after=false)
 
int EventConnect (char *, bool(VDKObject::*)(VDKObject *, GdkEvent *), bool after=false)
 
bool EventDisconnect (int connection)
 

Public Attributes

VDKReadWriteValueProp< VDKComboEntry, bool > Editable
 
VDKReadWriteValueProp< VDKComboEntry, int > Selected
 
VDKReadWriteValueProp< VDKComboEntry, char * > Text
 
VDKReadWriteValueProp< VDKComboEntry, StringList * > Selections
 
VDKReadWriteValueProp< VDKComboEntry, GtkListStore * > StoreModel
 
VDKReadWriteValueProp< VDKComboEntry, bool > Sorted
 
VDKReadWriteValueProp< VDKComboEntry, GtkSortType > SortingOrder
 
- Public Attributes inherited from VDKObject
VDKReadWriteValueProp< VDKObject, VDKRgbNormalBackground
 
VDKReadWriteValueProp< VDKObject, VDKFont * > Font
 
SizeObjectProp Usize
 
VDKReadWriteValueProp< VDKObject, bool > Enabled
 
VDKReadWriteValueProp< VDKObject, VDKCursorType > Cursor
 
VDKReadWriteValueProp< VDKObject, bool > Visible
 

Additional Inherited Members

- Protected Attributes inherited from VDKObject
VDKObjectSignal s_clicked
 
GtkWidget * widget
 
GtkWidget * sigwid
 
VDKObjectparent
 

Detailed Description

Provides a simplified wrapper for gtkcombo_entry.

Author
Mario Motta
Signals
  • activate_signal received when the Enter key is pressed in the Entry.
  • changed_signal received when text in Entry is changed. This happens when an item has been selected or unselected.
  • focus_in_signal received when Entry gets focus.
  • focus_out_signal received when Entry loses focus.

Constructor & Destructor Documentation

§ VDKComboEntry()

VDKComboEntry::VDKComboEntry ( VDKForm owner,
char **  selections = NULL 
)

Constructor

Parameters
ownerowner form
selectionsa NULL terminating string array

Member Function Documentation

§ SetBackground()

void VDKComboEntry::SetBackground ( VDKRgb  color,
GtkStateType  state 
)
virtual

Sets object background

Parameters
colora VDKRgb object
statecan be one of the gtk+ widget states

Reimplemented from VDKObject.

§ SetFont()

void VDKComboEntry::SetFont ( VDKFont f)
virtual

Sets object font

Reimplemented from VDKObject.

§ SetForeground()

void VDKComboEntry::SetForeground ( VDKRgb  color,
GtkStateType  state 
)
virtual

Sets object foreground

Parameters
colora VDKRgb object
statecan be one of the gtk+ widget states

Reimplemented from VDKObject.

Member Data Documentation

§ Editable

VDKReadWriteValueProp<VDKComboEntry,bool> VDKComboEntry::Editable

Same as Editable property in VDKEntry. Setting it to false allows you to provide a read-only list to select from, without the user being able to enter text.

§ Selected

VDKReadWriteValueProp<VDKComboEntry,int> VDKComboEntry::Selected

Sets/gets the index of the currently selected item in the dropdown list or -1 if no item is selected.

§ Selections

VDKReadWriteValueProp<VDKComboEntry,StringList*> VDKComboEntry::Selections

Sets/gets widget dropdown list.

  • setting a new string list overwrites if any
  • returned StringList should be deleted by user

§ Sorted

VDKReadWriteValueProp<VDKComboEntry,bool> VDKComboEntry::Sorted

Sets underlying GtkListStore model as sortable. Once the model has been sorted, it can't go back to the default state. A possible work around to this problem is here:

bool
SomeForm::ToggleSorting(VDKObject* sender)
{
static StringList *unsorted = NULL;
GtkListStore* store = comboboxentry->StoreModel;
// store unsorted dropdown list for later use
if(!unsorted)
unsorted = comboboxentry->Selections;
if(chbox->Checked)
comboboxentry->Sorted = true;
else
// since once sorted cannot revert to previous state
// we substitute store model with a new unsorted one
{
comboboxentry->Sorted = false;
GtkListStore* store = gtk_list_store_new (1, G_TYPE_STRING);
comboboxentry->StoreModel = store;
comboboxentry->Selections = unsorted;
}
comboboxentry->Selected = 0;
return true;
}

§ SortingOrder

VDKReadWriteValueProp<VDKComboEntry,GtkSortType> VDKComboEntry::SortingOrder

Sets/gets sorting order. Applicable only if Sorted property is true. can be either GTK_SORT_ASCENDING (default) or GTK_SORT_DESCENDING

§ StoreModel

VDKReadWriteValueProp<VDKComboEntry,GtkListStore*> VDKComboEntry::StoreModel

gets underlying GtkListStore model that can be accessed in order to manipulate widget dropdown list if needed.

§ Text

VDKReadWriteValueProp<VDKComboEntry,char*> VDKComboEntry::Text

Set/Get the text in the Entry

  • returned char* should be deleted by user

The documentation for this class was generated from the following files: