PDA

View Full Version : New in UI module: Dialogs CALLBACKs



ErosOlmi
12-07-2008, 10:57
Hi all,

another preview of next UI module: Dialogs Callbacks with DIALOG SHOW MODAL ...
Create a dialog, show it in MODAL way linking a script callback function in charge to handle events. Finish.

This new way of handling windows will give complete freedom on how to manage windows events and react to them. No more internal thinBasic tricks to do things. You will have the power. And more important: programming style will be almost identical to other more advanced compiled programming languages, so if you do things in thinBasic it will be more easy to port in/out code from other languages.

Anyhow, check by yourself with attached files. Look at how events flow while you move, size, move the mouse, lose and get focus, ... this was impossible with previous UI logic.

Attention:

attached DLLs are just for testing purposes
many internal thinBAsic tricks like SET MINSIZE or CONTROL SET RESIZE, ... will not work when using DIALOG SHOW MODAL ...
Those nice features were developed with internal UI tricks that I didn't already ported to new MODAL way. But it will be very easy to do
all previous scripts should work fine


Updates:

added example with multy dialogs
in multy window example, every window has a text field and each field has a callback
problem when using DIALOG SHOW MODAL ... from inside a function. Code after DIALOG SHOW ... was never executed and function never exit because MODAL dialogs do not release control. Added DIALOG SHOW MODELESS ... with callback possibility
added "Arrange window" in example to automatically adjust position of all created windows

Michael Clease
12-07-2008, 12:13
It does seem fast, perhaps you could if you have time you could make the same script using the old method so we can compare.

thanks

Mike

ErosOlmi
12-07-2008, 12:25
Yes, good idea.

Speed compare will be hard to see on UI applications.
But syntax compare will show how much clean the code will be.

Anyhow thare are a lot of steps to do for an official release.

catventure
12-07-2008, 12:27
Worked great! Fantastic stuff.


catventure.

ErosOlmi
12-07-2008, 13:20
Attached files to first post of this thread updated.
_________________________________________________

Added a new example showing a main window that can open any number of new dialogs each with its callback.
I tested with up to 20 new windows and all seems fine.
Move around windows, you will see events fired at hi speed each for the relevant window.

This was a stress test script I wrote in order to test multy dialog possibility.

Eros

ErosOlmi
12-07-2008, 13:41
Attached files to first post of this thread updated.
_________________________________________________

Sorry about so frequent updates but I'm very excited about the many possibilities.
Now in multy window example every new window has a text field that is associated with a callback.
So there will be a mess of messages and still working. I'm surprised ;)

Eros

catventure
12-07-2008, 14:44
Hi Eros,

You've really excelled yourself today with these wonderful examples! :o

Amazingly good!

Worked great.

catventure

ErosOlmi
12-07-2008, 14:52
Thanks catventure.

I'm very excited about the possible future scripts that thinBasic users will be able to accomplish.
Thare are many many things I still need to check but those examples seems telling that it is possible to go on in this direction.

And because the new interface functions I implemented in thinCore will be available (when released in next thinBasic) to all users developing thinBasic modules, I think new un-expected possibilities will be present also on this side.

Petr Schreiber
12-07-2008, 19:07
This is so cool,

thanks a lot Eros! I did not do much UI coding till now, but now with such a power in hands I will check it more closely.
Worked great on my PC.


Petr

ErosOlmi
12-07-2008, 23:20
Attached files to first post of this thread updated.
_________________________________________________

Fixed a problem when using DIALOG SHOW MODAL ... from inside a function.
Code after DIALOG SHOW MODAL ... was never executed and function never exits because MODAL dialogs do not release control.
Added DIALOG SHOW MODELESS ... with callback possibility to be used from inside functions.
This also solved many other internal problems.

Eros

ErosOlmi
13-07-2008, 00:57
Attached files to first post of this thread updated.
_________________________________________________

Added "Arrange window" in multy window example to automatically arrange position of all created windows.
Tested script with up to 200 windows. Callbacks seems able to get the loads.

Eros

catventure
13-07-2008, 01:18
Hi Eros,

The penultimate example worked Ok for me.

Downloading latest now!

catventure.

catventure
13-07-2008, 01:27
Hi Eros,

The Arrange Windows button worked.

catventure

ErosOlmi
13-07-2008, 01:38
Thanks for testing catventure.

Purpose of those previews is exactly the possibility to see if next version features are working fine or not.
I've some computers and different OSs on where to test but it is a very limited situation. Having many nice poeple here willing to spend some time on testing is for us the best encouraging situation. And time is one of the few things cannot be purchased so I double appreciate it.

Thanks again.
Eros

GSAC3
13-07-2008, 02:32
Eros:

The MULTI-WINDOW is working fine here (and, as you said, FAST!) on mt XP "beast".

This is a very slick new feature you are building into thinBasic.

Thank you.

Don

ErosOlmi
14-07-2008, 17:14
Thanks a lot Don.

I've seen there are problems in debugging scripts using the new UI CallBack method.
I'm working on it before going on adding callbacks for other UI elements.

Michael Clease
14-07-2008, 17:31
:( I was waiting patiently for the menus.

ErosOlmi
14-07-2008, 18:08
OK, OK. I will add CallBacks in Menu and than fix Debugger.
Happy ;D

Ciao
Eros

Michael Clease
14-07-2008, 18:32
that was ment as a joke but I wont turn your very kind offer down ;)

as always thanks for all the good work that you do.

ErosOlmi
14-07-2008, 22:22
??? adding CallBacks to Menu is not so easy as expected.
Menu and popups can be created outside any window and the same menu can be associated to different windows.
Also menu items and popups can be dynamically attached/removed.

I'm thinking on how to hack it ...

ErosOlmi
30-07-2008, 19:46
Resolved the following items in callbacks usage:


automatic gradient background where DIALOG SET GRADIENT (http://www.thinbasic.com/public/products/thinBasic/help/html/dialog_set_gradient.htm) ... is used
automatic background images painting where DIALOG SET IMAGE (http://www.thinbasic.com/public/products/thinBasic/help/html/dialog_set_image.htm) ... is used
automatically move/resize of controls where CONTROL SET RESIZE (http://www.thinbasic.com/public/products/thinBasic/help/html/control_set_resize.htm) ... is used.


I will update attached file in this post soon with a new preview.

New callbacks in UI module is giving to windows handling a new great fashion.
I'm sure you will like it in next thinBasic release. I'm preparing a new set of script examples showing how this way of handling windows will be very powerful and simple at the same time.

Ciao
Eros

catventure
30-07-2008, 20:22
Sounds really good Eros.

Looking forward to the example scripts.

Regards,
catventure.

jack
31-07-2008, 04:11
this is very good addition to ThinBasic, thank you :)