Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Implementing Checkboxes


4 replies to this topic

limke

limke
  • Members
  • 3 posts

Posted 12 November 2003 - 07:14

Environment: Windows Installer 2.0, Orca

I have a dialog that I'd like to display a install option using a checkbox. I have the check box displaying, but I cannot seem to figure how to implement the basic check/uncheck user interface behavior. i.e. when you click in the box, it shows checked, and when you click in the box (already having a check) it unchecks.

I have my CheckBox control in the Control table tied to a property USESQL. I can get to the box to check when the user clicks the box by having an entry in the ControlEvent table that sets the USESQL to 1 using a condition of USESQL (is not null). When I make the next logical entry in the ControlEvent table, set USESQL to {} (null) using a condition of Not USESQL, I have a problem.

When the CheckBox is clicked both events are evaluated. The CheckBox is checked, then the next event is evaluted and the CheckBox is unchecked. Seems like there should be an Exit command to prevent the second event from executing.



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 12 November 2003 - 12:59

You shouldn't have to enter anything in the ControlEvent table for this. A check box should automatically set resp. undefine its associated property.

limke

limke
  • Members
  • 3 posts

Posted 13 November 2003 - 03:47

I removed the entries from the ControlEvent table as suggested and it didn't check when clicked. So, I removed my USESQL property from the Checkbox table as well. I was using the CheckBox table incorrectly. I assigned the value as null for the property, thinking it would be used for the initial value.

I was thinking you had to code the behavior, so your advice was helpful to get me in the right direction.


Is it possible to enable an Edit control when the checkbox is checked? I can't figure out what event I should subscribe my Edit control to in the EventMapping table.


Thanks again

MSIB

MSIB
  • Members
  • 13 posts

Posted 13 November 2003 - 11:30

You shoud write ControlCondition Table for edit control :
Action Condition
Enable CHECKBOXVAR=1
Disable CHECKBOXVAR=NULL

where CHECKBOXVAR is variable assigned to checkbox


limke

limke
  • Members
  • 3 posts

Posted 13 November 2003 - 20:01

Perfect. Thank you.