Skip to content

Commit 4d2803b

Browse files
authored
Merge f72f7c3 into bfde594
2 parents bfde594 + f72f7c3 commit 4d2803b

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

devDocs/technicalDesignOverview.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,44 @@ NVDA has its own graphical user interface to allow for easy configuration and ot
208208
This code is primarily contained in the `gui` package.
209209
[wxPython](http://www.wxpython.org/) is used as the GUI toolkit.
210210

211+
#### Common GUI bugs
212+
213+
##### Controls are invisible or clipping
214+
215+
Adding controls to the wrong parent will cause them to visually clip or become invisible.
216+
Adding controls to a ``wx.StaticBoxSizer`` by adding them to its parent causes undefined behaviour.
217+
This has caused problems with users with right-to-left language locales.
218+
wxWidgets requires that these items be added directly to the `StaticBox` associated with the `wx.StaticBoxSizer` via `GetStaticBox()`.
219+
220+
**Before (buggy behaviour):**
221+
222+
```python
223+
sizer = new wx.StaticBoxSizer(wx.VERTICAL, parent, "Test")
224+
sizer.Add(wx.StaticText(parent, wx.ID_ANY, "Where am I?"))
225+
sizer.Add(wx.Button(parent, wx.ID_ADD))
226+
```
227+
228+
**After:**
229+
230+
```python
231+
sizer = new wx.StaticBoxSizer(wx.VERTICAL, parent, "Test")
232+
sizer.Add(wx.StaticText(sizer.GetStaticBox(), wx.ID_ANY, "Where am I?"))
233+
sizer.Add(wx.Button(sizer.GetStaticBox(), wx.ID_ADD))
234+
```
235+
236+
PR [#12181](https://github.com/nvaccess/nvda/pull/12181) is an example of fixing this.
237+
238+
##### Event handlers are firing unexpectedly or failing to fire
239+
240+
When event handlers are firing unexpectedly or failing to fire, refer to the [wxWidgets documentation for event propagation](https://wiki.wxpython.org/EventPropagation).
241+
242+
Notably:
243+
* Event handlers stop propagation.
244+
- If `event.Skip()` is called in an event handler, propagation will continue.
245+
* `wx.CommandEvents`, a subset of wxEvents, will propagate up to the parent dialog by default.
246+
- If a child control performs an event, a parent event handler may fire.
247+
PR [#13117](https://github.com/nvaccess/nvda/pull/13117) is an example of a bug caused by this being fixed.
248+
211249
### Configuration management
212250
NVDA includes an extensive configuration management facility including various preferences dialogs, ability to apply a given configuration in apps and so forth.
213251
The base configuration options, as well as routines that manage configuration profiles and other management routines are housed in the `config` package, and NVDA uses [ConfigObj](http://www.voidspace.org.uk/python/configobj.html) to store configuration options.

0 commit comments

Comments
 (0)