General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Restoring minimized document

  • LeeHart

    Restoring minimized document

    Participants 4
    Replies 5
    Last Activity 13 years, 7 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.

    Reply

    Derek Read

    Reply to: Restoring minimized document

    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?

    Reply

    LeeHart

    Reply to: Restoring minimized document

    > 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.

    Thanks,

    Lee

    Reply

    Derek Read

    Reply to: Restoring minimized document

    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.

    Reply

    LeeHart

    Reply to: Restoring minimized document

    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.

    Thanks,

    Lee

    Reply

    Derek Read

    Reply to: Restoring minimized document

    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

    Access: Read/write

    Returns: Integer

    Description:
    Returns or sets the window state that the document's MDI window is in. Allowed
    values are:

    sqMDIWindowStateUnspecified (-1): Unspecified
    sqMDIWindowStateMaximized (0):    Maximized
    sqMDIWindowStateMinimized (1):    Minimized
    sqMDIWindowStateNormal (2):      Normal (resizable, movable window with maximize and minimize buttons)

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support