Navigation:  thinBasic Modules > UI (User Interface) > DIALOGSs >

DIALOG NEW

Previous pageReturn to chapter overviewNext page

 

Description

 

Creates a new dialog (window).

 

Syntax

 

DIALOG NEW [PIXELS, | UNITS,] hwParent, Title, xPos, yPos, Width, Height [, [Style] [, [ExtendedStyle] ] ] TO hwnd

 

Returns

 

None

 

Parameters

 

Name

Type

Optional

Meaning

PIXELS | UNITS


Yes

If the PIXELS is specified, all size and position are specified in pixels.

If UNITS is specified, all size and position are specified in units.

UNITS is the default one if this parameter is not specified.

hwParent

Number

No

Handle of the parent window

Title

String

No

String expression used to set window title

xPos

Number

No

Upper x position

yPos

Number

No

Upper y position

Width

Number

No

Width of the new window

Height

Number

No

Height of the new window

Style

Number

Yes

An optional bitmask describing how the dialog should be displayed. See Dialog Style equates.

ExtendedStyle

Number

Yes

An optional extended style bitmask describing how the dialog should be displayed. See Dialog ExtendedStyle equates.

hwnd

Variable

No

A numeric single variable name that will receive the handle of the new window.

 

Remarks

 

All size and position parameters passed to functions working with dialogs and controls will be sensible to PIXELS | UNITS option specified when the dialog is creates.

 

Restrictions

 

See also

 

Examples

 

USES "UI"

 

'---Define a button ID

%ButtonClose = 1001

 

Dim hDlg As DWORD

 

DIALOG New 0, "APPTITLE",-1,-1, 330, 203, _

                                   %WS_POPUP         Or _

                                   %WS_VISIBLE       Or _

                                   %WS_CLIPCHILDREN  Or _

                                   %WS_CAPTION       Or _

                                   %WS_SYSMENU       Or _

                                   %WS_MINIMIZEBOX,     _

                                   0 To hDlg

 

CONTROL ADD BUTTON, hDlg, %ButtonClose, "Click to kill", 90, 50, 150, 100

 

DIALOG SHOW MODAL hDlg Call cbDialog

 

'------------------------------------------------

' Callback function used to handle dialog events

'------------------------------------------------

CALLBACK Function cbDialog() As Long

 

  Select Case CBMSG

    Case %WM_Command

      If CBWPARAM = %ButtonClose Then DIALOG End CBHNDL

 

    Case %WM_DESTROY

      MSGBOX 0, "Window is to be destroyed."

      

  End Select 

 

End Function

 

 

 

© 2004-2008 thinBasic. All rights reserved. Version 1.7.0.0 Web Site: http://www.thinbasic.com