General XMetaL Discussion
LeeHart March 6, 2009 at 7:59 pm
Restoring minimized documentMarch 6, 2009 at 7:59 pmParticipants 4Replies 5Last Activity 13 years, 10 months ago
Using the Activate method of the Document object I can activate any document that is loaded. However if the document is minimized, the minimized document gets the keyboard focus but remains minimized. I'd like to be able to detect if a document is minimized, and if so, to restore it. If I could get the window handle for that MDI child I could use ShowWindow(hWnd, SW_RESTORE).
Is there a way to directly restore a specific document? Short of that is there a way to get the window handle for a specific document?
Thanks.Derek Read March 7, 2009 at 12:00 am
Reply to: Restoring minimized documentMarch 7, 2009 at 12:00 am
We don't have any APIs designed to let you maximize an MDI window, just the main app window.
I've tried various workarounds, including a few very convoluted ones and cannot come up with one that will maximize a minimized (or “cascaded”) window via scripting.
What is the original problem you are trying to solve here?LeeHart March 7, 2009 at 1:38 pm
Reply to: Restoring minimized documentMarch 7, 2009 at 1:38 pm
> What is the original problem you are trying to solve here?
We have a Table of Contents control in a pane in the Resource Manaer that list both the documents in the TOC hierarchy and the documents in the order they apear in the filesystem. When many documents are open, it's very covenient to be able to double-click on them (either in the TOC or filesystem view) ad activate them. If they are minimized, it activates the minimized MDI window, but I'd like to be able to restore it if minimized (it's not always apparent that the double-click worked when it just slightly changes the color of a minimized child.)
I actually don't want to maximize the window, just restore it. I've noticed that XMetaL 5.5 always maximizes the previously active topic when starting up, and reorders to a cascaded view; the previous version of XMetaL that we used (4.0) would remember the window position of the documents loaded and restore that. I preferred the old behavior as it allowed me to continue where I left off after closing and restarting XMetaL.
Being able to restore the document window would just help to make it more user-friendly.
LeeDerek Read March 9, 2009 at 9:08 pm
Reply to: Restoring minimized documentMarch 9, 2009 at 9:08 pm
I see what you mean about maximizing previously open files after restarting the product rather than remembering the window state. I see the old behavior (where it remembered the window state for each document and restored it when opening them at startup) with older versions (including 3.1).
It sounds like ultimately it would be nice for you to have a set of APIs, possibly attached to the Document object (ActiveDocument), that would let you control these things programmatically.
Long term we might actually change the MDI interface, and so implementing new APIs to support the current UI might not make much sense if it becomes obsolete when (if) we do that. We've had a few requests for a more “Visual Studio-y” or “Firefox-y” UI (one that is tab-centric). That doesn't mean we'll actually implement anything though and it would be some time out anyway if it was done.LeeHart March 10, 2009 at 3:07 pm
Reply to: Restoring minimized documentMarch 10, 2009 at 3:07 pm
Even if you had a way to provide the hWnd for each child document it would help. Personally I prefer the MDI method, and I really like the way XMetaL combines both MDI and tabs, but I understand if you feel you need to abandon MDI. However, if you can provide the hWnd, you could handle any commands sent to that window (like SW_RESTORE) as you best see fits the new paradigm (or ignore it if it doesn't).
Restoring XMetaL's ability to remember the previous child documents window state would be helpful. If that could get into the next release it would be appreciated.
LeeDerek Read March 10, 2009 at 10:56 pm
Reply to: Restoring minimized documentMarch 10, 2009 at 10:56 pm
I'll file a feature request for this, though I cannot say for sure when (or if) we will implement such a feature. I'm thinking something along these lines (which uses the MDI functionality provided in VB and our existing API ViewType as models):
MDIWindowState (Document property)
Applies: To XMetaL Author
Returns or sets the window state that the document's MDI window is in. Allowed
sqMDIWindowStateUnspecified (-1): Unspecified
sqMDIWindowStateMaximized (0): Maximized
sqMDIWindowStateMinimized (1): Minimized
sqMDIWindowStateNormal (2): Normal (resizable, movable window with maximize and minimize buttons)
- You must be logged in to reply to this topic.