Win32Forth


Dialog -- Class for dialog boxes.


Load Dialog Resource File

The .RES file structure is a series of records.  Each record contains a header and a data field.  The structure of a header is as follows:

offset length
0 4 length of data field
4 4 length of header
10 2 record type
14 2 dialog ID number (for dialogs)
: dialogID?     ( hdr ID -- f )

Given the address of a header in a resource file, return true if this is the header for a dialog resource.  I'm only guessing here.

: find-dialog-ID ( id addr -- address-of-template-header )

Find dialog template given address and length of resource file in memory.

: load-dialog   ( -<filename-without-an-extension>- )

Load template from dialog resource (*.res) to here and allot memory.
Usage:  load-dialog dialog

Dialog Class

:CLASS Dialog   <SUPER Dialog&Control

Dialog class.
To use this class you have to create a ressource file (*.res) which must contain the dialog resource. Since Win32Forth doesn't provide any tool's to create a dialog resource you should use ForthForm to create your dialog windows instead.

:M Start:       ( parent -- flag )

Open the dialog

:M EndDialog:   ( return-value -- )

Close the dialog

:M On_Init:  ( hwndfocus -- f )

Init the dialog

:M On_Command:  ( hCtrl code ID -- f )

Process Commands from Controls

;Class

End of Dialog class

Modless Dialog class

:Class ModelessDialog   <SUPER Dialog

Modless Dialog class
To use this class you have to create a ressource file (*.res) which must contain the dialog resource. Since Win32Forth doesn't provide any tool's to create a dialog resource you should use ForthForm to create your dialog windows instead.

:M WindowStyle: ( -- n1 )

Get the window style of the dialog.

:M ExWindowStyle: ( -- n1 )

Get the extended window style of the dialog.

:M Origin:      ( -- x y )

Get the origin (upper left corner) of the dialog.

:M Start:       ( parent -- )

Open the dialog

:M EndDialog:   ( n1 -- )

Close the dialog

;Class

End of ModlessDialog class


Document $Id: Dialog.htm,v 1.12 2007/05/26 10:24:12 dbu_de Exp $