Which would be the best approach for this...

BlitzMax Forums/MaxGUI Module/Which would be the best approach for this...

Arowx(Posted 2008) [#1]
Hi, I would like to make a GUI 'Widget' that has the following features and was wondering if you could help get me started...

Widget features...
Label for Name
TextArea for Description

Movable wherever the user wants.
Container/Contained - Widgets within widgets

Minimizeable, collapse down to Just label
Sizeable with scrollbar when needed

Now I think that a Window or Panel might be the ideal starting point for this 'Widget' but I'm not sure which would work best?

Given that there will be lots of these Widgets in a column or grid based layout within the applications main window which would you recommend?

Cheers


jsp(Posted 2008) [#2]

Widget features...
Label for Name
TextArea for Description



This sounds a bit like a proxygadget, may have a look at that one.


Movable wherever the user wants.



Via coordinates or during runtime?
Via coordinates, just use a panel as background and put all gadgets on top, thus they will be relative to the parent panel.
During runtime, you could use a window without titlebar and put the above panel on that one.
When the panel is made active for mouse moves and you receive the events you could move the window and all the content will follow...


Container/Contained - Widgets within widgets



Not sure where you want to put another one? Container in container would work, but the the Label and the TextArea are no container gadgets.


Minimizeable, collapse down to Just label



That should be possible, either by making the Label sensitive and check for a double click. When received, you expand the panel/window (SetGadgetShape) and show the TextArea, vice versa.
You could also use a small Arrow in an extra panel to visualize the collapse or expand. Then I would make that one active to receive the events.


Sizeable with scrollbar when needed



When you put all your gadgets on top of the panel and let them self adjust to the size of the panel via SetGadgetLayout() the TextArea will pop in the needed Scrollbar without any exrta work.


Now I think that a Window or Panel might be the ideal starting point for this 'Widget' but I'm not sure which would work best?



I would start with a panel and work from that one to the final version as mentioned above.


Given that there will be lots of these Widgets in a column or grid based layout within the applications main window which would you recommend?



This panel / label / textarea combination should be created as proxygadget or a similar type and should act in itself on events, thus every instance in your column/grid layout can act independently.