Difference between revisions of "Documentation/DevGuide/Basic/Check Box"
OOoWikiBot (Talk | contribs) m (FINAL VERSION FOR L10N) |
m |
||
Line 11: | Line 11: | ||
The property <code>State</code>, where 0 is not checked, 1 is checked, 2 is don't know, accesses and changes the state of a checkbox. The tri-state mode of a check box is enabled by setting the <code>TriState</code> property to True. A tri-state check box provides the additional state "don't know", that is used to give the user the option of setting or unsetting an option. | The property <code>State</code>, where 0 is not checked, 1 is checked, 2 is don't know, accesses and changes the state of a checkbox. The tri-state mode of a check box is enabled by setting the <code>TriState</code> property to True. A tri-state check box provides the additional state "don't know", that is used to give the user the option of setting or unsetting an option. | ||
− | + | <source lang="oobas"> | |
oCheckBoxModel = oDialog.Model.CheckBox3 | oCheckBoxModel = oDialog.Model.CheckBox3 | ||
oCheckBoxModel.TriState = True | oCheckBoxModel.TriState = True | ||
oCheckBoxModel.State = 2 | oCheckBoxModel.State = 2 | ||
− | + | </source> | |
The same result is achieved by using the <idl>com.sun.star.awt.XCheckBox</idl> interface: | The same result is achieved by using the <idl>com.sun.star.awt.XCheckBox</idl> interface: | ||
− | + | <source lang="oobas"> | |
oCheckBox = oDialog.getControl("CheckBox3") | oCheckBox = oDialog.getControl("CheckBox3") | ||
oCheckBox.enableTriState( True ) | oCheckBox.enableTriState( True ) | ||
oCheckBox.setState( 2 ) | oCheckBox.setState( 2 ) | ||
− | + | </source> | |
{{PDL1}} | {{PDL1}} | ||
[[Category:Documentation/Developer's Guide/Basic and Dialogs]] | [[Category:Documentation/Developer's Guide/Basic and Dialogs]] |
Revision as of 10:00, 22 October 2009
The check box control com.sun.star.awt.UnoControlCheckBox is used in groups to display multiple choices so that the user can select one or more choices. When a check box is selected it displays a check mark. Check boxes work independently of each other, thus different from option buttons. A user can select any number of check boxes at the same time.
The property State
, where 0 is not checked, 1 is checked, 2 is don't know, accesses and changes the state of a checkbox. The tri-state mode of a check box is enabled by setting the TriState
property to True. A tri-state check box provides the additional state "don't know", that is used to give the user the option of setting or unsetting an option.
oCheckBoxModel = oDialog.Model.CheckBox3 oCheckBoxModel.TriState = True oCheckBoxModel.State = 2
The same result is achieved by using the com.sun.star.awt.XCheckBox interface:
oCheckBox = oDialog.getControl("CheckBox3") oCheckBox.enableTriState( True ) oCheckBox.setState( 2 )
Content on this page is licensed under the Public Documentation License (PDL). |