Prevent TsPopupController from closing a form

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #68506
    HeDiBo
    Participant

    I have a situation in which a popup form opens up another form. In that particular case, I do not want the popup form itself to close. How can I do this?

    #68509
    HeDiBo
    Participant

    The popup in question is viewable in #86507
    The popup form contains a help button which will produce a HTML help screen. But in doing so, closes the popup form.

    #68516
    Support
    Keymaster

    I can suggest two ways:
    1. Use these two procedures:

      GetIntController.ClosingForbide(YourPopupForm);
      GetIntController.ClosingAllow(YourPopupForm);
    
    uses acPopupController

    2. Use the OnCloseQuery event of the popup form with CanClose parameter.

    #68520
    HeDiBo
    Participant

    The HTML help screen is totally separate from the rest of the application. It stays visible until the help screen itself is closed. So any activity on this help screen (like scrolling the text) should not close the popup screen, but activity on other parts of the application should close the popup screen.
    Maybe these requirements are too conflicting.

    #68527
    Support
    Keymaster

    I think, using of the OnCloseQuery event may help in this case.

    #68530
    HeDiBo
    Participant

    I think, using of the OnCloseQuery event may help in this case.

    No, it does not. After the help screen is created, it’s pretty much on its own. It is not related in any way any more to the window that created it. So there’s nothing to test in OnCloseQuery.

    #68537
    Support
    Keymaster

    You can make your own flag which can forbid closing of the form and check this flag in the OnCloseQuery event.

    #68540
    HeDiBo
    Participant

    This is a silly setup I have. The help window must stay, until manually closed by the user. Even if the popup window is long gone.
    The only thing I can think of is special coding to prevent the popup screen from closing if focus went to that help screen. But it’s totally OK if focus went to a window different from that help window. In that case the help window should stay open however.
    So it is definitely not just a simple flag.

    #68604
    HeDiBo
    Participant

    I have eliminated the popup window in this case.
    I think this problem cannot be solved, unless there comes a list of windows that should not interfere with the popup window.
    So, you can close this topic for now.😢

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Prevent TsPopupController from closing a form’ is closed to new replies.