docking widget layout management proposal



Hi Gustavo & others,

This is a proposal for adding layout management to the docking widget
(GdlDock). What i mean with layout management is the following:

- Load & save component locations in the docking widget.
- Preferably do this using XML for compatibility.
- Allow loading a layout during runtime: switch between different
layouts on the fly.

Properties that need to be saved:
- docking location (TOP, LEFT, RIGHT, BOTTOM) (CENTER is a special case
since the component is actually embedded in a notebook, same with
FLOATING).
- Store component location & dimensions if component is floating.

The docking widget uses a tree to store the components (component in a
notebook in a paned in a paned etc.). The best way to store the layout
therefore is to use an XML tree. Example:

<dock-layout>
	<layout name="edit">
		<paned orientation="horizontal" divider="30">
			<item name="scintilla"/>
			<notebook>
				<item name="debug_watches"/>
				<item name="debug_breakpoints"/>
			</notebook>
		</paned>
		<float x="12" y="345" width="67" height="89">
			<item name="projecttree"/>
		</float>
	</layout>

	<layout name="debug">
	</layout>
</dock-layout>


You would also need some public methods for loading & saving a layout:

	void gdl_dock_layout_load (xmlNotePtr node);

	void gdl_dock_layout_save (xmlNodePtr node);

The application is responsible for loading the xml (from a file, from
memory or from some other location (GConf)).

Let me know what you think of this.

Jeroen






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]