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

This class provides an unified wrapper for almost all kind of GtkButton. More...

#include <vdkcustombutton.h>

Inheritance diagram for VDKCustomButton:
VDKObject VDKNotCopyAble VDKHLButton

Public Member Functions

 VDKCustomButton (VDKForm *owner, const char *label, unsigned int type=VDK_CBUTTON_UNTOGGLED|VDK_CBUTTON_NORMAL)
 
 VDKCustomButton (VDKForm *owner, const char *pixfile, const char *label, unsigned int type=VDK_CBUTTON_UNTOGGLED|VDK_CBUTTON_NORMAL, GtkPositionType position=GTK_POS_RIGHT)
 
 VDKCustomButton (VDKForm *owner, const char **pixdata, const char *label, unsigned int type=VDK_CBUTTON_UNTOGGLED|VDK_CBUTTON_NORMAL, GtkPositionType position=GTK_POS_RIGHT)
 
void SetComboMenu (VDKMenu *menu)
 
virtual void SetForeground (VDKRgb color, GtkStateType state=GTK_STATE_NORMAL)
 
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 ()
 
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

VDKReadOnlyValueProp
< VDKCustomButton, VDKBox * > 
ButtonBox
 
VDKReadOnlyValueProp
< VDKCustomButton, VDKLabel * > 
Label
 
VDKReadOnlyValueProp
< VDKCustomButton, VDKImage * > 
Pixmap
 
VDKReadWriteValueProp
< VDKCustomButton, const char * > 
Caption
 
VDKReadWriteValueProp
< VDKCustomButton, bool > 
CaptionWrap
 
- Public Attributes inherited from VDKObject
VDKReadWriteValueProp
< VDKObject, VDKRgb
NormalBackground
 
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

This class provides an unified wrapper for almost all kind of GtkButton.

Signals
  • clicked signal, emitted when user clicks over button
  • enter_signal, emitted when mouse goes over button
  • leave_signal. emitted when mouse leaves button
Examples
In ./testvdk/testvdk.cc

Constructor & Destructor Documentation

VDKCustomButton::VDKCustomButton ( VDKForm owner,
const char *  label,
unsigned int  type = VDK_CBUTTON_UNTOGGLED | VDK_CBUTTON_NORMAL 
)

Constructor, makes a labeled button

Parameters
owner
label
type
type and toggle
<type> arg is used to determine if the button is toggled and if it is a combo button or not
  • toggled can be VDK_CBUTTON_TOGGLED or VDK_CBUTTON_UNTOGGLED
  • type can be: VDK_CBUTTON_NORMAL or VDK_CBUTTON_COMBO
  • toggled and type can be or'ed togheter except that VDK_CBUTTON_TOGGLED | VDK_CBUTTON_COMBO does not produce a combo toggled button.
accelerators
custom button support accelerators, setting an underline into button label makes an accelerator.
VDKCustomButton *button = new VDKCustomButton(this,"_A button");
this makes that a clicked or toggled signal will be emitted using alt+a keystroke.
VDKCustomButton::VDKCustomButton ( VDKForm owner,
const char *  pixfile,
const char *  label,
unsigned int  type = VDK_CBUTTON_UNTOGGLED | VDK_CBUTTON_NORMAL,
GtkPositionType  position = GTK_POS_RIGHT 
)

Constructor, makes a pixmapped button.

Parameters
pixfile
label
type
position,refersto label position into button box
VDKCustomButton::VDKCustomButton ( VDKForm owner,
const char **  pixdata,
const char *  label,
unsigned int  type = VDK_CBUTTON_UNTOGGLED | VDK_CBUTTON_NORMAL,
GtkPositionType  position = GTK_POS_RIGHT 
)

Constructor, same as above but using pixdata instead a pix file.

Member Function Documentation

void VDKCustomButton::SetComboMenu ( VDKMenu menu)

Sets a menu into combo button.

Meaningless if button isn't a combo button

virtual void VDKCustomButton::SetFont ( VDKFont f)
inlinevirtual

Sets object font

Reimplemented from VDKObject.

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

Sets object foreground

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

Reimplemented from VDKObject.

Member Data Documentation

VDKReadOnlyValueProp<VDKCustomButton, VDKBox*> VDKCustomButton::ButtonBox

<read-only> Permits to access embedded VDKBox that already contains a VDKLabel and probably a VDKImage

VDKReadWriteValueProp<VDKCustomButton, const char*> VDKCustomButton::Caption

Permits to change button caption

VDKReadWriteValueProp<VDKCustomButton, bool> VDKCustomButton::CaptionWrap

Permits to change button caption wrap

VDKReadOnlyValueProp<VDKCustomButton, VDKLabel*> VDKCustomButton::Label

<read-only> Permits to access embedded VDKLabel

VDKLabel* label = button->Label;
if(label)
{
label->Text = "new text";
label->Justify = GTK_JUSTIFY_RIGHT;
}
VDKReadOnlyValueProp<VDKCustomButton, VDKImage*> VDKCustomButton::Pixmap

<read-only> Permits to access embedded VDKImage


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