those scrollbars look fancy and really neat - I have been using Ubuntu for several years now, but wasn't aware of those "new" scrollbars, so thanks - I guess, I need to update some things here
What you said above sounds really good - I'd just suggest to keep in mind that being able to dynamically place/modify widgets would be awesome to lower the entry barrier for GUI development and allow others to help here, some sort of "layout/design" mode, where an arbitrary widget (canvas group) can be "authored", as in "resized/placed" or restyled.
If that could be also supported at the property tree/canvas level via a handful of Nasal APIs, we would really open up the doors for fgdata developers to help with porting/redesigning the FlightGear GUI - if the widget APIs could be told to make a widget editable, people would need very little Nasal code to come up with WYSWYG gui/dialog or even widget editors.
Sort of like having a handful of flags that directly allow groups to be affected all at once, I think we'd really only need some form of "Editable" interface class that is implemented by each widget, so that each widget can expose editable attributes (e.g. x,y,w,h, color/style) - and once the corresponding flags are set, those event listeners would be delegated to use the Editable interface implementation of each widget, rather than the actual callbacks that implement the widget functionality.
For example, there could be a standard interface for rectangular widgets (think buttons, labels, sliders) for changing x/y, w/h - that would be shared by all rect widgets, and then some form of "label" interface for text labels (buttons etc).
Subject: meta modesHooray wrote:Referring to:
Subject: Just a commentPhilosopher wrote in Wed Jul 10, 2013 2:31 pm:Actually a good "development extension" would be one that shows the position in pixels when you click on a Canvas -- so I could just say "I want my text *here* [click]"
Hooray wrote:- Code: Select all
my_canvas.addEventListener("click", func(e) globals.gui.popupTip(sprintf("click (%.1f|%.1f)", e.clientX, e.clientY)));
...now change the event-listener callback to directly modify a PropertyList tree in the property tree, and you'll end up with a WYSIWYG-GUI editor that allows you placing canvas-elements on-screen while serializing everything to a runtime tree/XML file.
Thinking about it, a really useful feature would be allowing "meta modes" for groups that automatically affect placement/resizing, so that the bounding box for the corresponding group is rendered as a frame with hot spots (handles) for mouse drag/drop, so that the whole group becomes optionally resizable and draggable, without manually setting the corresponding properties directly - that would allow a simple widget/GUI designer to be provided on top of the canvas with very little work, just by accessing the top-level group - this could be all done through a single boolean property that transparently modifies the underlying properties and locks the thing afterwards. We could then even load our existing XML dialogs and drag/drop & resize widgets around, which would allow contributors to more easily update/port/edit dialogs and widgets.
I think this could be easily provided at the canvas/GUI level through a single parent class in Nasal, without touching the C++ code - Tom ?