Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#46 closed Feature request (fixed)

Disable elements in settings pane

Reported by: Sören Rinne Owned by: coredevs
Priority: Should be done Milestone:
Component: General Keywords:
Cc:

Description

I would like to disable/make invisible an element in the settings pane depending on a value of another element of the settings pane.

Change History (5)

comment:1 Changed 12 years ago by Thomas Schmid

Resolution: fixed
Status: newclosed

Fixed: can be done using the

public event TaskPaneAttributeChangedHandler TaskPaneAttributeChanged;

in the settings of a plugin. Sample code:

SettingChanged(MEM_USAGE_PROPERTY, Visibility.Visible); SettingChanged(BUTTON_MEM_USAGE_PROPERTY, Visibility.Visible, new TaskPaneAttribute(Properties.Visuals.settingMemUsageOff, Properties.Visuals.settingMemUsageOff_ToolTip, Properties.Visuals.settingGroupMisc, 5, false, DisplayLevel.Beginner, ControlType.Button));

private void SettingChanged(string setting, Visibility vis) {

if (TaskPaneAttributeChanged != null) {

TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer(setting, vis)));

}

}

private void SettingChanged(string setting, Visibility vis, TaskPaneAttribute tpa) {

if (TaskPaneAttributeChanged != null) {

TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer(setting, vis, tpa)));

}

}

comment:2 Changed 12 years ago by Sören Rinne

Resolution: fixed
Status: closedreopened

Works nice, but CT2 doesn't remember the state of a setting in the settings pane, after re-opening a .cte for example.

So, if the state of a setting was Visibility.Collapsed, its state is Visibility.Visible the next time I open the .cte (although I saved it before).

I tried to set the state by hand in

public void PreExecution() { ... }

but it doesn't seem to help.

comment:3 Changed 12 years ago by Matthäus Wander

(In [943]) Converter:

  • added initialization for icon and task pane visibility (references #80, #46)
  • set default conversion to string (init fails otherwise)

comment:4 Changed 12 years ago by Sören Rinne

Resolution: fixed
Status: reopenedclosed

Solved by Schmid. Call a settings function to set the visibility on Initialize().

comment:5 Changed 12 years ago by Arno Wacker

(In [945]) Enigma: Now also from start only available settings are visible (see #46) - thanks to Thomas.

Note: See TracTickets for help on using tickets.