Re: UI tinkering tips?
Karsten Hilbert <[email protected]> Tue, 25 Nov 2025 23:46:01 +0100
| Newsgroups | gmane.comp.gnu.medical.devel |
|---|---|
| Message-ID | <[email protected]> |
> >The programmed-to-be-configured parts or the hardcoded bits > >(the general concept of GNUmed's UI) ? >=20 > The hardcoded bits mostly! For example, how would one build the UI of a = new plugin. Or if I > were to "clone" one of the plugins to tinker with. >=20 > Since asking the question, and specially just now that the modification = of the tab position > worked, I have been able to glean that: > - plugins' "backends" and almost all the formatting are at wxPython fold= er > - those same plugins' GUI and the .py from where they are actually calle= d are at wxPython/gui >=20 > It seems this is correct? For sure will be testing and tinkering, learni= ng how things work. Quite close. I use wxGlade to drag-and-drop together a suitable part of the GUI, say, a panel to be shown inside a notebook tab, let's assume "new_plugin". The wxGlade source files are in client/wxg/wxgNew_plugin.wxg. That file holds to UI layout. It gets compiled into Python3 code for wxPython using wxGlade. The result is in client/wxGladeWidgets/wxgNew_plugin.py holding a panel named wxgNew_pluginPnl. Then, in client/wxpython/gmNew_pluginStuff.py the wxgNew_pluginPnl is imported and subclassed as, say, cNew_pluginPnl. The subclass adds all the meat that makes the UI actually do something (button handlers, load, save, validation ...). (actual business logic is NOT done here, however: that is happening in client/business/*, but this file may also define UI workflows, IOW, the database is only ever touched by code inside client/business [and client/pycommon/gmPG2.py of course]) Then, a wrapper for the notebook is created: client/wxpython/gui/gmNew_plugin.py subclassing gmPlugin.cNotebookPlugin and loading client/wxpython/gmNew_pluginStuff.py::cNew_pluginPnl. That code tells the notebook to use cNew_pluginPnl as a new notebook plugin and gives it a user-facing name etc. Then, the configuration needs to be told about the plugin for certain workplaces to use it, see for example server/sql/v22-v23/dynamic/v23-cfg-incoming_area_plugin.sql :-) Karsten =2D-=20 GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B