May 09, 2024, 01:23:01 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Application compile find no runtime errors, I dont see the GUI Window

Started by Techno, September 05, 2007, 03:41:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Techno

Dear programmers

I have tested an application with textboxes en one button
The application compile fine en no runtime errors but I don't see the window, where is it
How can I show this window?



CONST EDIT_1 = 1
CONST EDIT_2 = 2
CONST BUTTON_3 = 3
DIALOG d1
CREATEDIALOG d1,0,0,169,97,0x80C80080,0,"Caption",&d1_handler
CONTROL d1,@EDIT,"Edit1",18,8,139,20,0x50800000,EDIT_1
CONTROL d1,@EDIT,"Edit2",16,40,139,19,0x50800000,EDIT_2
CONTROL d1,@SYSBUTTON,"Test",19,73,70,20,0x50000000,BUTTON_3

SUB d1_handler
SELECT @MESSAGE
CASE @IDINITDIALOG
CENTERWINDOW d1
/* Initialize any controls here */
CASE @IDCLOSEWINDOW
CLOSEDIALOG d1,@IDOK
CASE @IDCONTROL
SELECT @CONTROLID
CASE EDIT_1

CASE EDIT_2
/* respond to edit notifications here */
CASE BUTTON_3
IF @NOTIFYCODE = 0
DEF s AS STRING
s = GETCONTROLTEXT (d1, EDIT_1)
SETCONTROLTEXT d1, EDIT_2, s
ENDIF
ENDSELECT
ENDSELECT
RETURN
ENDSUB


I find the visual designer to poor you haven't only the standard controls en none of the Win32 controls why?

pistol350


EDIT : Message for Paul.
This example made me think about a bug in the dialog Editor :
When you create a dialog GUI using the dialog editor
After compiling the generated skeleton handler you don't have anything displayed since just as Techno's example , the code lacks the following statements :

  run = 1
  showdialog d1
  waituntil run = 0


Regards ,
Peter B.


Hi Techno .
as i don't see any showdilalog statement , i assume you forget to add it.
Then,you also need to had a "waituntil run = 0 "statement . ;)

Here is the working code :

CONST EDIT_1 = 1
CONST EDIT_2 = 2
CONST BUTTON_3 = 3
DIALOG d1
CREATEDIALOG d1,0,0,169,97,0x80C80080,0,"Caption",&d1_handler
CONTROL d1,@EDIT,"Edit1",18,8,139,20,0x50800000,EDIT_1
CONTROL d1,@EDIT,"Edit2",16,40,139,19,0x50800000,EDIT_2
CONTROL d1,@SYSBUTTON,"Test",19,73,70,20,0x50000000,BUTTON_3
   run = 1
   showdialog d1
   waituntil run = 0


SUB d1_handler
SELECT @MESSAGE
CASE @IDINITDIALOG
CENTERWINDOW d1
/* Initialize any controls here */
CASE @IDCLOSEWINDOW
CLOSEDIALOG d1,@IDOK
CASE @IDCONTROL
SELECT @CONTROLID
CASE EDIT_1

CASE EDIT_2
/* respond to edit notifications here */
CASE BUTTON_3
IF @NOTIFYCODE = 0
DEF s AS STRING
s = GETCONTROLTEXT (d1, EDIT_1)
SETCONTROLTEXT d1, EDIT_2, s
ENDIF
ENDSELECT
ENDSELECT
RETURN
ENDSUB
Regards,

Peter B.

jerryclement

 ;)
Techno, read this from the HELP section.

Showing the dialog

Add controls to the dialog after it is defined and show the dialog with the DOMODAL or SHOWDIALOG functions.

DOMODAL shows the dialog as modal. This means that all other windows in your program will be blocked until the dialog is closed. The DOMODAL function has the syntax of:

return = DOMODAL( variable [,parent] )

The variable must be of type DIALOG and defined with the CREATEDIALOG statement. DOMODAL will return the value given to the CLOSEDIALOG statement or @IDCANCEL if the user presses the <Esc> key to dismiss the dialog.  All input will be captured by the dialog while it is displayed. Note that any controls in the dialog cannot be initialized until the dialog is displayed. All control initialization should be done in the dialog handler subroutine in response to the @IDINITDIALOG message.

The optional parent parameter overrides the parent window/dialog specified in the CREATEDIALOG statement. It is preferable to specify the parent window/dialog when it is shown.


To show a non modal dialog use the SHOWDIALOG statement.  The syntax of SHOWDIALOG is:

SHOWDIALOG variable [,parent]

Once the dialog is displayed, your program continues to execute normally. A dialog shown with SHOWDIALOG requires a message loop to properly process and send message to the handler subroutine. In this respect a dialog shown with SHOWDIALOG operates in the same manner a normal window does with the benefits of a dialog.

The optional parent parameter overrides the parent window/dialog specified in the CREATEDIALOG statement. It is preferable to specify the parent window/dialog when it is shown.

-------------------------------------------------------------
Jerry C.
Jerry - Newbie from TN

Ionic Wind Support Team

What Jerry said ^

The dialog editor makes the statements necessary to define the dialog and it's handler. It is up to you to decide whether you want it to be modal or non-modal.   You do have to write some  code ;)

And yes, it is in the users guide.
Ionic Wind Support Team

LarryMc

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

pistol350

Uups!
thank you Larry.
code fiixed   :D :


CONST EDIT_1 = 1
CONST EDIT_2 = 2
CONST BUTTON_3 = 3
DIALOG d1
CREATEDIALOG d1,0,0,169,97,0x80C80080,0,"Caption",&d1_handler
CONTROL d1,@EDIT,"Edit1",18,8,139,20,0x50800000,EDIT_1
CONTROL d1,@EDIT,"Edit2",16,40,139,19,0x50800000,EDIT_2
CONTROL d1,@SYSBUTTON,"Test",19,73,70,20,0x50000000,BUTTON_3
   run = 1
   showdialog d1
   waituntil run = 0
   CLOSEDIALOG d1,@IDOK
end


SUB d1_handler
SELECT @MESSAGE
CASE @IDINITDIALOG
CENTERWINDOW d1
/* Initialize any controls here */
CASE @IDCLOSEWINDOW
run=0
CASE @IDCONTROL
SELECT @CONTROLID
CASE EDIT_1

CASE EDIT_2
/* respond to edit notifications here */
CASE BUTTON_3
IF @NOTIFYCODE = 0
DEF s AS STRING
s = GETCONTROLTEXT (d1, EDIT_1)
SETCONTROLTEXT d1, EDIT_2, s
ENDIF
ENDSELECT
ENDSELECT
RETURN
ENDSUB

Regards,

Peter B.

Barney

run and waituntil are not needed if DOMODAL function is used...

Barney