dialog maximize and minimize events

dialog maximize and minimize events

Postby don lowenstein » Thu Feb 14, 2008 6:33 pm

How can I detect when a window/dialog was maximized?

This event does not seem to trigger an "on resize" event. It would be nice to know if the user left the dialog maximized, then I could re-display it in the future maximized.
Don Lowenstein
www.laapc.com
User avatar
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm

Re: dialog maximize and minimize events

Postby Enrico Maria Giordano » Thu Feb 14, 2008 6:44 pm

From the following sample you will see that ON RESIZE event is trigged on maximize:

Code: Select all  Expand view  RUN
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    ACTIVATE WINDOW oWnd;
             ON RESIZE TONE( 440, 1 )

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby don lowenstein » Thu Feb 14, 2008 7:04 pm

How can I tell if the dialog was MAXIMIZED or simply resized by dragging the corner of the dialog?
Don Lowenstein
www.laapc.com
User avatar
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm

Postby Enrico Maria Giordano » Thu Feb 14, 2008 8:32 pm

This is a sample:

Code: Select all  Expand view  RUN
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    ACTIVATE WINDOW oWnd;
             ON RESIZE SHOWRESIZETYPE( nSizeType )

    RETURN NIL


#define SIZE_INIT      NIL
#define SIZE_RESTORED  0
#define SIZE_MINIMIZED 1
#define SIZE_MAXIMIZED 2


STATIC FUNCTION SHOWRESIZETYPE( nSizeType )

    STATIC lInit := .T.

    DO CASE
        CASE nSizeType = SIZE_INIT
            ? "SIZE_INIT"
            lInit = .F.
        CASE nSizeType = SIZE_RESTORED .AND. !lInit
            ? "SIZE_RESTORED"
        CASE nSizeType = SIZE_MINIMIZED
            ? "SIZE_MINIMIZED"
        CASE nSizeType = SIZE_MAXIMIZED
            ? "SIZE_MAXIMIZED"
    ENDCASE

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby don lowenstein » Thu Feb 14, 2008 9:23 pm

Thanks - I believe that is exactly what I was looking for.
Don Lowenstein
www.laapc.com
User avatar
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 77 guests