User Tools

Site Tools


checkbox

CheckBox (QCheckBox)

www.kbasic.com_images_checkbox.jpg

The Qt documentation in C++ of this class can be read here: http://doc.trolltech.com/4.3/qcheckbox.html

A control for the form object, provides a checkbox with a text label.

It can be switched on (checked) or off (unchecked).

If you would like to have a group of CheckBoxes, use the Group property and set all CheckBoxes to the same group.

Most important

Methods None
Properties Value , Icon , Caption
Events OnEvent

Please read the control class overview Control as well.

METHODS

Not implemented yet:

void setTristate ( bool y = true )

bool isTristate () const

void setCheckState ( Qt::CheckState state )

Unchecked, PartiallyChecked, Checked

QCheckBox::checkState ()

PROPERTIES

Value

Property Value As Boolean (ReadWrite)


OldValue

Property OldValue As Boolean (ReadOnly)


Key

Property Key As String (ReadOnly)

Holds the information, which key press would raise the event connected to this Control, e.g. Ctrl+O. The strings “Ctrl”, “Shift”, “Alt” and “Meta” are recognized.

Example

Shift+L
Alt+U
Alt+Shift+U
Ctrl+Alt+C

Icon

Property Icon As String (ReadWrite)

An icon can be an absolute path to an image file (png, jpg,…) like c:\myfolder\myimage.png or can be an relative path to the current project like myimage.png (which is present in the current project directory). Relative paths are recommended.

Might be a String containing binary data. See the binary project example for using.

Example

Dim c As CheckBox
c = Control("CheckBox0") ' CheckBox0 is declared in this form
c.Icon = "tux.jpg" ' relative path. File exists in current project directory

See also Caption


Caption

Property Caption As String (ReadWrite)

Holds the text to be displayed on the Control.

Example

Dim c As CheckBox
c = Control("CheckBox0") ' CheckBox0 is declared in this form
c.Caption = "Hello World!"

See also Icon


Text

Property Text As String (ReadWrite)

Same as Caption. Provided for easy-use.


EVENTS

OnEvent

Sub OnEvent()

This event is raised, whenever the user presses the Control, either by mouse or key.

Example

Sub CheckBox0_OnEvent()
  Print "CheckBox0 pressed"
End Sub

checkbox.txt · Last modified: 2013/06/04 13:55 by berndnoetscher