creating and updating dialog within script

Started by
2 comments, last by WitchLord 19 years, 6 months ago
Hi I am trying to create a modeless dialog and update it on fly.But dialog is stuck , cannot update itself until script execution finish. Any method to solve this or is this possible?.Angelscript version is 1.9.2a . ( OpenWatchWindow()= creates modeless dialog ) //test.as //script file content bool result = InitBus(); if( result ) { int i = 0 ; int value = 0 ; OpenWatchWindow(); for( i = 0 ; i < 10 ; i ++ ) { value = ReadByte( SCON_CSYNC_INV + i ); SendMessage(SCON_CSYNC_INV + i,value); UpdateWatchWindow(); } CloseWatchWindow(); } best regards BilgeKaan
Advertisement
Call the UpdateData() function.. register it in your script and do it that way. Then add a call to UpdateData.

Actually, that is assuming you are using DDX i belive.
Rain Dog

the problem is not to change the value of control , the real problem is the controls inside the dialog are not visible until script execution finishes. and also it is not posible to drag
dialog with mouse .UpdateWatchWindow() is used for updating data and currently calling UpdateData() function inside .
And also i tried to to another method and create modeless dialog and hide it before script execution . At that time i used OpenWatchWindow() which calls //dlg->ShowWindow(SW_SHOW);// function only for showing dialog created before.Still i got the same problem.No change
I believe you are not allowing the message pump for the dialog to run. You seem to be opening and closing the dialog without letting the application call GetMessage()/DispatchMessage() in between. What exactly do you want the script to do? If you think of the script as a normal C++ function there would be no time to actually display the window, or at most it would only flicker on the screen.

If you want the window to show and allow user interaction while running the script you need to make the script event based. That is, is must open the window, then suspend. Then at WM_INITDIALOG the script initializes the controls, then suspends again. When the WM_CLOSE message is received the script can be allowed to close the dialog and terminate.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement