Topics

how to build a settings panel with advanced options?

Christopher Pross
 

Hi,

how I could easiely build a settingspanel, where some settings are hidden until the user hits a button or a checkbox?

Like the advanced settings in nvda?

I read already the source code of the class, but don't understand the main strategy.

Andy B.
 

Hi,

 

You would use the checked event for checkboxes or the click event for buttons to change the visible state of the other controls.

 

  • Create all of your controls on the settings panel.
  • Register a checked event for the master checkbox, or clicked event for the master button.
  • In the checked or click event, determine the state of the origin control.
  • Make all of the controls you wish visible/invisible based on the state of the button or checkbox.

 

 

Sent from Mail for Windows 10

 

From: Christopher Pross
Sent: Tuesday, June 9, 2020 10:13 AM
To: nvda-addons@nvda-addons.groups.io
Subject: [nvda-addons] how to build a settings panel with advanced options?

 

Hi,

 

how I could easiely build a settingspanel, where some settings are

hidden until the user hits a button or a checkbox?

 

Like the advanced settings in nvda?

 

I read already the source code of the class, but don't understand the

main strategy.

 

 

 

 

 

 

Noelia Ruiz
 

I think that the strategy of this class can be sumarized as follows:

1. Create a class (optional) to manage easily multiple controls
instead of managing each one. This is AdvancedPanelControls.

2. Create the main class AdvancedPanel and add the first class, after
other controls, in makesettings method.
3 Use this line to decide if the first class, that is, its controls,
will be enabled:
self.advancedControls.Enable(self.enableControlsCheckBox.IsChecked())



If self.enableControlsCheckBox.IsChecked(), then the controls will be
enabled, otherwise there will be disabled
Enable accepts as a parameter a boolean, which is True or False
deppending on the state of the checkbox.
Hope this helps.

2020-06-09 16:13 GMT+02:00, Christopher Pross <chpross42@...>:

Hi,

how I could easiely build a settingspanel, where some settings are
hidden until the user hits a button or a checkbox?

Like the advanced settings in nvda?

I read already the source code of the class, but don't understand the
main strategy.