Forum > General

[SOLVED] AnchorDocking: detecting whether forms are visible/docked

(1/1)

MarkMLl:
I'm starting off what might become a moderately-sized program, but anticipate that in most cases it will comprise a main window with between zero and two others docked to the RHS. I'm currently using GTK2, but could switch easily to Qt5 for testing.

I've got a couple of early-stage questions, which I'll pose individually.

I'm controlling the making the subsidiary windows visible using menu entries with checkboxes. So irrespective of whether one of them is docked or undocked, if it is displayed somewhere on the screen (i.e. possibly slipped under some other window) the corresponding checkbox is marked (i.e. "checked", "ticked" etc.).

If a subsidiary form is undocked and its main close button is clicked, its Visible property becomes false. This may be tracked by the checkbox.

If the small cross on a (docked or undocked) subsidiary window's dock header is clicked, the window disappears but its Visible property remains true.

How can I detect in this case that the window is no-longer visible, so that the checkbox state can be kept in step?

MarkMLl

MarkMLl:
I've expunged this from the project. It was too erratic, the silence from the community is telling, and the combination of multiple title bars and multiple "Close" buttons had the makings of a support nightmare.

MarkMLl

VisualLab:
Did your design include a main window and several tool windows that could be floating or docked? (e.g. as in Visual Studio, Delphi, MS Office or various engineering programs) I like such solutions in programs. They make it easier for the user to manipulate content (data) because there is no need to display and close dialog windows.

I once (15 years ago) tried to apply this solution to my project created in Delphi using the TBX library (https://github.com/plashenkov/TBX). But implementing this solution is time-consuming and the TBX library itself was complicated and had some shortcomings (and also supported dockable toolbars). There is also a problem when the GUI of tool windows is to be context-sensitive.

MarkMLl:
Yes, as in OP's first para.

However starting off using the wiki in lieu of any proper documentation, even just trying to get one window docked and undocked only worked 50% of the time, the main form was resizing itself when the subsidiary one was docked, sorting that out invariably ended up with the docking bar moving from the side to the top... and then there's the lack of any equivalent to a visible property.

Now I'm sure that somewhere in the sources and example there's some indication of a workround, but frankly: life's too short.

I'm mocking something up for technical-but-not-programmer users who I /know/ would have problems with e.g. multiple crosses doing different things, and my gut feeling is that time and effort invested in this would be wasted. I'm replacing it with splitters which can also be forced by a menu to simulate panes being hidden.

MarkMLl

Navigation

[0] Message Index

Go to full version