Recent

Author Topic: [SOLVED] AnchorDocking: detecting whether forms are visible/docked  (Read 1010 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 7522
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
« Last Edit: May 14, 2024, 03:54:52 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 7522
Re: [SOLVED] AnchorDocking: detecting whether forms are visible/docked
« Reply #1 on: May 14, 2024, 03:57:11 pm »
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
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

VisualLab

  • Sr. Member
  • ****
  • Posts: 435
Re: [SOLVED] AnchorDocking: detecting whether forms are visible/docked
« Reply #2 on: May 14, 2024, 04:52:59 pm »
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

  • Hero Member
  • *****
  • Posts: 7522
Re: [SOLVED] AnchorDocking: detecting whether forms are visible/docked
« Reply #3 on: May 14, 2024, 05:15:11 pm »
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
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018