GUI dynamically updated using sizers or editable treebox

Palmito

Well-known member
Hi,

I need for my project some sort of editable list.

My functional need is for a master-detail table:
- a TreeBox containing master elements (this works perfectly)
- a zone next to it where I can directly edit several details values (this is where I do not manage to update controls dynamically)
Screenshot 2022-05-26 105450.jpg

I looked into TreeBox as it seems the way to go for lists, but it doesn't support edition and I don't think I can extend it for my purpose.

So I looked into Sizers, I have HorizontalSizers containing a Label and a TextBox. I then add my HorizontalSizers into a VerticalSizer.

This works fine if controls are created in the constructor, but doesn't if I do it after my dialog as been painted (ie on node click).

What is the way to achieve this?

Thanks!
 
Oh, so I just noticed this TODO in the repository: Screenshot 2022-05-26 114545.jpg

@Juan Conejero can you give me a few hints on how I can get started with this?
I will be more than happy to implement inline node editor ;-)

I have been able to compile and debug any process on my windows machine, however I failed to compile PCL itself.
 
Ok I found what was wrong with my code and am able to use VerticalSizer and HorizontalSizer dynamically.

I had an Array<HorizontalSizer> in my dialog class. Which I used to remove previous entries.
Then when adding elements I was declaring a local HorizontalSizer and adding it to parent VerticalSizer.

Long story short, flickering made me realize that previous elements were not removed from parent sizer also, I am not 100% sure, but believe some garbage collection is involved here.

To fix it I had to create a class deriving from HorizontalSizer, maintaining pointers to its children (a Label and a TextBox). Also I had to store a pointer reference to my class ( Array<MyEditableControl*> rather than Array<MyEditableControl> ).

I hadn't coded C++ in 20 years and got really used to the confort of Java and C#.
Jeez it is as steep as learning to use PixInsight :LOL:
--edit: don't get me wrong, PixInsight is a brilliant tool, PJSR and PCL very well designed, a bit of architecture documentation would be welcome though, but code is well commented.
 
Last edited:
Back
Top