Unespected calling sequence

Unespected calling sequence

Postby Enrico Maria Giordano » Tue Feb 28, 2006 9:19 pm

The following two samples show a different calling sequence between a window and a dialog:

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


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    @ 1, 1 LISTBOX FIELDS;
           ON CHANGE MSGINFO( "OnChange" )

    MSGINFO( "Here" )

    ACTIVATE WINDOW oWnd;
             ON INIT MSGINFO( "OnInit" )

    RETURN NIL


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


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    @ 1, 1 LISTBOX FIELDS;
           ON CHANGE MSGINFO( "OnChange" )

    MSGINFO( "Here" )

    ACTIVATE DIALOG oDlg;
             ON INIT MSGINFO( "OnInit" )

    RETURN NIL


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

Postby Antonio Linares » Wed Mar 01, 2006 7:11 am

Enrico,

Its ok that they behave different:

The window just get created once it is defined: it already has a handle of a window. So the messages shown are: OnChange-Here-OnInit. They happen in the same secuence as defined.

The dialog does not have a window handle until it is activated, so the messages shown are:

1. "Here" (neither the dialog or the listbox have window handles yet).
2. "OnChange" as the control of the dialog is initialized before evaluating the ON INIT clause.
3. Finally "OnInit" as it is evaluated finally, once the dialog its created and its controls are initialized.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Wed Mar 01, 2006 8:37 am

Ok, thank you.

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests