Lock the current Layout

Hi there.

I’m using DF to create the layout of an application. But as I don’t need the full capabilities of DF (Moving and Resizing the different parts) I would like to know if there is a way to lock the layout, so the user can’t change the layout any more.

I’m using CControl and DefaultCDockables to create the layout…

Thanks for your help


There is a way to prevent drag and drop:
[ul][li]You first have to write a new CControlFactory. The factories method “createController” must be changed to deliever a new special DockControllerFactory to the new DockController.[/li][li]You have to write a new DockControllerFactory. This factories method “createRelocator” must be changed to create a new special DockRelocator.[/li][li]You have to write a new DockRelocator which does do nothing (at least that is not hard to implement)[/li][li]And you call the constructors of CControl and DockController with these new factories.[/li][/ul]

As for resizing: Unless you write a new DockStation its impossible to deactivate it.

A philosophical question: why do you want to remove functionallity? I can understand drag&drop, which might confuse unexperienced users. But resizing seems to be such a helpful feature that I really do not understand why not using it.

Thanks for the reply. I’ll try this later as I’m a bit occupied today.

I need to disable this, as we are creating an application that will be used in different ways (for different users) but with quite the same functionality in the background. So we can create the GUI once, and configure the layout for each group of users. Then the gui shall be locked that a normal user can’t modify the layout and only an “Administrator” can reenable.


Ok, I’ve added a new method “setResizingEnabled” to “SplitDockStation”. It will be available in Version 1.0.6 - which I hope to publish within the next two weeks. Assuming you use the default-content-area, you will need to call the method in a way like this:
control.getContentArea().getCenter().setResizingEnabled( false );

Hey, thanks.

That will help me a lot…
Great service :slight_smile:

The only way to block dragging is still as described above? Or has there been a setDragging(false) been added in the mean time?

Currently that is still the only option. But I think I’ll add some “veto-listener”, which - if invoked - can cancel a DnD operation before it starts. At least I put it on the todo-list.

I’ve tried to prevent dragging by detecting it afterwards and resetting the layout using the CDockableLocationListener on a dockable. That works, only the painting goes wrong when the layout is reset. Weird.

Sorry! The code accidentally loaded a stored layout! So that works!