vdk 2.4.0
Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
VDKObject Class Reference

#include <vdkobj.h>

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

Public Member Functions

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 ()
 
virtual void SetFont (VDKFont *f)
 
VDKFontGetFont ()
 
void SetVisible (bool visible)
 
bool GetVisible ()
 
void SetCursor (VDKCursorType)
 
VDKCursorType GetCursor ()
 
virtual void SetForeground (VDKRgb color, GtkStateType state=GTK_STATE_NORMAL)
 
virtual void SetBackground (VDKRgb color, GtkStateType state=GTK_STATE_NORMAL)
 
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< VDKObject, VDKRgbNormalBackground
 
VDKReadWriteValueProp< VDKObject, VDKFont * > Font
 
SizeObjectProp Usize
 
VDKReadWriteValueProp< VDKObject, bool > Enabled
 
VDKReadWriteValueProp< VDKObject, VDKCursorType > Cursor
 
VDKReadWriteValueProp< VDKObject, bool > Visible
 

Protected Attributes

VDKObjectSignal s_clicked
 
GtkWidget * widget
 
GtkWidget * sigwid
 
VDKObjectparent
 

Friends

class VDKRawObject
 

Detailed Description

This class is the base class of a wide hierarchy, provides common functionalities to all derived classe

Constructor & Destructor Documentation

◆ VDKObject() [1/2]

VDKObject::VDKObject ( VDKForm owner = NULL)

Constructor, make an object that belongs to <owner> form.

◆ VDKObject() [2/2]

VDKObject::VDKObject ( VDKForm owner,
GtkWidget *  widget 
)

Contructor, makes an object instance from an already gtk+ created object.

◆ ~VDKObject()

VDKObject::~VDKObject ( )
virtual

Destructor

Member Function Documentation

◆ Add()

void VDKObject::Add ( VDKObject obj,
int  justify = l_justify,
int  expand = TRUE,
int  fill = TRUE,
int  padding = 0 
)
virtual

Add on abiect to the object.

Parameters
objthe object to be added
justifywhere the object wil be added, can be:
  • l_justify packed to end (appended)
  • r_justify packed to start (prepended)
expandif true object will expand
fillif true object will fill all available space
paddinghow many pixels are left around object

Reimplemented in VDKMenu, VDKToolbar, VDKNotebook, VDKPaned, VDKTable, VDKScrolled, VDKForm, VDKObjectContainer, VDKHandleBox, VDKFrame, VDKFixed, VDKEventBox, VDKBox, VDKRadioButtonGroup, and VDKMenubar.

◆ ConnectingWidget()

GtkWidget * VDKObject::ConnectingWidget ( )

Same as WrappedWidget().

◆ Destroy()

bool VDKObject::Destroy ( )

Explicitely destroy an object freeing associated memory.

Tip: never use delete operator otherwise garbage collection will fail and program probably will crash.

◆ Draw()

void VDKObject::Draw ( GdkRectangle *  area = NULL)

Draw an object

◆ EventConnect() [1/2]

int VDKObject::EventConnect ( char *  ,
bool(VDKObject::*)(VDKObject *, GdkEvent *)  ,
bool  after = false 
)
inline

Placeholder for subclasses, at this level does nothing. connects an <this>-event to a <this> method

Parameters
eventevent to be connected
methodclass method that answers to signal
after(default is false) if set to true connect signal in the "after" slot.

◆ EventConnect() [2/2]

int VDKObject::EventConnect ( VDKObject obj,
char *  event,
bool(VDKObject::*)(VDKObject *, GdkEvent *)  method,
bool  after = false 
)
inline

Placeholder for subclasses, at this level does nothing. connects an object-event to a <this> method

Parameters
objconnected object
eventevent to be connected
methodclass method that answers to signal
after(default is false) if set to true connect signal in the "after" slot.

◆ EventDisconnect()

bool VDKObject::EventDisconnect ( int  connection)
inline

disconnect this from connection

Parameters
connectionmust be achieved with a previous EventConnect() call

◆ GetBackground()

VDKRgb VDKObject::GetBackground ( GtkStateType  state = GTK_STATE_NORMAL)

Gets object background color

◆ GetCursor()

VDKCursorType VDKObject::GetCursor ( )
inline

Gets object assigned cursor

◆ GetFont()

VDKFont* VDKObject::GetFont ( )
inline

Gets object font

◆ GetForeground()

VDKRgb VDKObject::GetForeground ( GtkStateType  state = GTK_STATE_NORMAL)

Gets object foreground color

◆ GetVisible()

bool VDKObject::GetVisible ( )
inline

Returns object visibility

◆ GrabFocus()

void VDKObject::GrabFocus ( )

Grab the focus to itself

◆ isA()

virtual int VDKObject::isA ( )
inlinevirtual

returns an enum id (incomplete and not so useful)

Reimplemented in VDKForm, VDKBarChart, VDKScatteredChart, VDKLineChart, and VDKChart.

◆ Items()

ItemList& VDKObject::Items ( )
inline

Return contained objects list

◆ Owner()

VDKForm* VDKObject::Owner ( )
inline

Returns object owner form.

◆ Parent()

VDKObject* VDKObject::Parent ( VDKObject p = NULL)
inline

Sets object parenthood

◆ SetBackground()

void VDKObject::SetBackground ( VDKRgb  color,
GtkStateType  state = GTK_STATE_NORMAL 
)
virtual

Sets object background

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

Reimplemented in VDKComboEntry, VDKEntry, VDKCombo, VDKTextView, VDKEditor, VDKDrawingArea, VDKCustom, VDKSpinButton, VDKCanvas, and VDKDataBox.

◆ SetCursor()

void VDKObject::SetCursor ( VDKCursorType  curType)

Sets object assigned cursor

◆ SetFont()

void VDKObject::SetFont ( VDKFont f)
virtual

◆ SetForeground()

void VDKObject::SetForeground ( VDKRgb  color,
GtkStateType  state = GTK_STATE_NORMAL 
)
virtual

Sets object foreground

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

Reimplemented in VDKCustom, VDKAbstractButton, VDKTextView, VDKEditor, VDKComboEntry, VDKEntry, VDKDrawingArea, VDKCustomButton, VDKSpinButton, VDKCanvas, and VDKCheckButton.

◆ SetSize()

void VDKObject::SetSize ( int  w,
int  h 
)
inline

Sets object minimum size

Parameters
wwidth
hheight

◆ SetTip()

void VDKObject::SetTip ( char *  t)
virtual

Sets object tip.

Reimplemented in VDKTooltip.

◆ Setup()

virtual void VDKObject::Setup ( void  )
inlinevirtual

placeholder for subclasses. This method is called whenever an object is added to a container.

Reimplemented in VDKForm, VDKHLButton, VDKFileIconDialog, VDKFileChooser, VDKFileDialog, and VDKFileSel.

◆ SetUsize()

void VDKObject::SetUsize ( VDKPoint  s)
inline

Sets object minimum size

Parameters
s,aVDKPoint object

◆ SetVisible()

void VDKObject::SetVisible ( bool  visible)

Set object visibility

Parameters
visibleeither true or false

◆ SignalConnect() [1/2]

int VDKObject::SignalConnect ( char *  signal,
bool(VDKObject::*)(VDKObject *)  method,
bool  gtk = true,
bool  after = false 
)
inline

Placeholder for subclasses, at this level does nothing. Connects <this>-signal to a <this> method

Parameters
signalsignal to be connected
methodclass method that answers to signal
gtk(default is true) if you set this arg to false no real connection is made with gtk+ signal system and signal is handled internally by vdk. This allow to define and use your own signals without register them to gtk+
after(default is false) if set to true connect signal in the "after" slot, meaninigfull only if previous <gtk> arg is set to true.

◆ SignalConnect() [2/2]

int VDKObject::SignalConnect ( VDKObject obj,
char *  signal,
bool(VDKObject::*)(VDKObject *)  method,
bool  gtk = true,
bool  after = false 
)
inline

Placeholder for subclasses, at this level does nothing. Connects an object-signal to a <this> method

Parameters
objconnected object
signalsignal to be connected
methodclass method that answers to signal
gtk(default is true) if you set this arg to false no real connection is made with gtk+ signal system and signal is handled internally by vdk. This allow to define and use your own signals without register them to gtk+
after(default is false) if set to true connect signal in the "after" slot, meaninigfull only if previous <gtk> arg is set to true.

◆ SignalDisconnect()

bool VDKObject::SignalDisconnect ( int  connection)
inline

disconnect this from connection

Parameters
connectionmust be achieved with a previous SignalConnect() call

◆ SignalEmit() [1/2]

void VDKObject::SignalEmit ( char *  sig)

Emit a signal (dynamic tables)

Parameters
signal

◆ SignalEmit() [2/2]

void VDKObject::SignalEmit ( int  signal)

Emit a signal (static tables)

Parameters
signal

◆ SignalEmitParent() [1/2]

void VDKObject::SignalEmitParent ( char *  sig)

Emit a signal directly to parent (dynamic tables)

Parameters
signal

◆ SignalEmitParent() [2/2]

void VDKObject::SignalEmitParent ( int  signal)
inline

Emit a signal directly to parent (static tables)

Parameters
signal

◆ Widget()

GtkWidget * VDKObject::Widget ( )
virtual

Returns underlying GTK+ widget.

◆ WrappedWidget()

GtkWidget * VDKObject::WrappedWidget ( )

Returns underlying wrapped Gtk+ widget, useful in those cases when VDKObject is a composite one. Happens in many composite widgets, i.e a container with some inner widgets, that underlaying widget isn't which answers to signals. In this case the container is the <widget> and one of the inner widgets is the <sigwid>, wich is responsible to answers signal/event.You have to connect with the last one. An example is VDKText where Widget() return packing box not text itself. Tip: In doubt use always WrappedWidget() instead of Widget(), is always safer.

Member Data Documentation

◆ Cursor

VDKReadWriteValueProp<VDKObject,VDKCursorType> VDKObject::Cursor

Setting this property will set/get object cursor type.

◆ Enabled

VDKReadWriteValueProp<VDKObject,bool> VDKObject::Enabled

Setting this property will set/get object sensitivity.

◆ Font

VDKReadWriteValueProp<VDKObject,VDKFont*> VDKObject::Font

Setting this property will set the object font.

i.e.: obj->Font = new VDKFont(obj,"X-font-string-chock-full-o-dashes-goes-in-here");

◆ NormalBackground

VDKReadWriteValueProp<VDKObject,VDKRgb> VDKObject::NormalBackground

Setting one of these this properties will set/get object background color. Naming convention follows Gtk+ one. Example: form->NormalBackground = VDKRgb(255,0,0); (Tip: VDKRgb is a structure defined in vdkutils.h. Remember that some objects are transparent, so if you want to set the background color, you actually have to set the background color of the parent, VDKLabel is an example.

◆ parent

VDKObject* VDKObject::parent
protected

Object parent, where the signal flows if not stopped

◆ s_clicked

VDKObjectSignal VDKObject::s_clicked
protected

stock connected signal

◆ sigwid

GtkWidget* VDKObject::sigwid
protected

underlaying gtk+ widget widget and sigwid could be different, e.g into composite widget made of a container with some inner widget. See Widget() and WrappedWidget()

◆ Usize

SizeObjectProp VDKObject::Usize

Setting this property will set/get object minimum size.

◆ Visible

VDKReadWriteValueProp<VDKObject,bool> VDKObject::Visible

Setting this property will show/hide or get object visibility

◆ widget

GtkWidget* VDKObject::widget
protected

underlaying gtk+ widget


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