Type: info
         Title: ::svt::ControlDependencyManager and friends
     Posted by: [EMAIL PROTECTED]
      Affected: -
Effective from: CWS dba22ui


*Summary*
--------
+ svtools/dialogcontrolling.hxx
namespace svt:
+ IWindowOperator
+ IWindowEventFilter
+ DialogController
+ ControlDependencyManager
+ ControlDependencyManager::enableOnRadioCheck( ... )
+ ControlDependencyManager::enableOnCheckMark( ... )
+ (others)

*Description*
-------------
svtools/dialogcontrolling provides an extensible framework for
managing dependencies between controls/windows in a dialog (or any
other parent window).

As an example, consider a dialog with a check box and an edit field,
where the latter should be enabled if and only if the former is marked.
Normally, you would
- DECL_LINK a method in your class
- in your constructor, set this method as ToggleHandler at the checkbox
- IMPL_LINK the method, asking for the current state of the checkbox,
  and enabling the edit field accordingly
- do this for all such inter-control dependencies in your dialog

With a ControlDependencyManager, you can reach the same if you
- add a member "ControlDependencyManager m_aDepManager" to
  your dialog class.
- add a call
    m_aDepManager.enableOnCheckMark( <checkbox>, <editfield> )
  to your dialog's constructor
- do the previous step for all such inter-control dependencies in your
dialog

There exist multiple versions of enableOnCheckMark, taking multiple
dependent windows.
Also, there exist multiple methods
  enableOnRadioCheck( RadioButton&, Window&, ... )
which do similar things for radio buttons.


The ControlDependencyManager internally holds a list of
DialogController instances. A DialogController listens for events
fired by a primary control, filters those evens using a provided
IWindowEventFilter, and then operates on one or more dependent
windows, using a IWindowOperator.
This way, you can in theory implement nearly arbitrary inter-control
dependencies. Multiple primary controls (i.e. a dependency where
multiple controls determine the state of one or more dependent
windows) are not specified, but this could be done if needed.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to