FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Unespected calling sequence
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Unespected calling sequence
Posted: Tue Feb 28, 2006 09:19 PM
The following two samples show a different calling sequence between a window and a dialog:

#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


#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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Unespected calling sequence
Posted: Wed Mar 01, 2006 07: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Unespected calling sequence
Posted: Wed Mar 01, 2006 08:37 AM

Ok, thank you.

EMG

Continue the discussion