|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Topic # 984 |
Wow!? |
13/11/2004 @ 07:46 by John
|
I just purchased iziBasic, it will provide me with many hrs of learning in palm Basic programming. I did made some programs withPDAT, but this... i can take with me on the road and try to write some programs on the run. I have only one question? Is it possible to have two form, and if yes, than any chances for example? Regards John |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1 -------- 13/11/2004 @ 19:18 by gmigueis
visitor |
iziBasic is indeed a great tool! Cheers aldweb! You can have as many forms as you wish! I'm building iziForms, a tool to create forms by placing controls, etc. and I am myself experimenting with the various ways of "multiforming"... I'll post news if I get to any conclusion! Meanwhile you can try this methods:
1) You can create all the controls for your forms (every one with it's own ID, of course) and use subroutines to show/hide controls with the SHOW/HIDE instructions:
BEGIN GOSUB CreateControls REPEAT A=WAITEVENT ' here one could use a variable ' to keep track of what form is ' active... Perhaps this will ' avoid some errors GOSUB Form1Events GOSUB Form2Events UNTIL A=-1 END
CreateControls: ' controls for form 1 BUTTON #1,"GoToFormTwo",100,100,50,12 HIDE #1 ' controls for form 2 BUTTON #2,"GoToFormOne",10,10,50,12 HIDE #2 RETURN
ShowForm1: ' now you could use smarter FOR...NEXT ' loops and use just one subroutine... SHOW #1 RETURN
HideForm1: HIDE #1 RETURN
Form1Events: IF A=1 THEN GOSUB HideForm1 GOSUB ShowForm2 ENDIF RETURN
ShowForm2: SHOW #2 RETURN
HideForm2: HIDE #2 RETURN
Form2Events: IF A=2 THEN GOSUB HideForm2 GOSUB ShowForm1 ENDIF RETURN
2) Other method is to use the DESTROY instruction like this:
Form1Start: BUTTON #1,...... RETURN
Form1End: DESTROY #1 RETURN
This way you can re-use the same control IDs, but I've had some problems with this - my code was full of garbage anyway :)
3) With the DESTROY method you can either keep track of what form is active in a variable if you're re-using control IDs or you can have separate Event Loops for each form:
BEGIN (...) GOSUB Form1Start END
Form1Start: BUTTON #1,...... REPEAT A=WAITEVENT IF A=1 THEN GOSUB Form1End GOSUB Form2Start ENDIF UNTIL A=-1 ' save preferences and end GOSUB SavePreferences ' not shown here END RETURN
Form1End: DESTROY #1 RETURN
Form2Start: BUTTON #1,...... REPEAT A=WAITEVENT IF A=1 THEN GOSUB Form2End GOSUB Form1Start ENDIF UNTIL A=-1 ' save preferences and end ' as the user may want to get ' out quickly GOSUB SavePreferences END RETURN
This is written without testing, though! I'll post a "robust" multi-form framework as soon as I figure out what is the best way to do it, but I think this shows the idea! Hope it helps! |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2 -------- 14/11/2004 @ 03:25 by John
visitor |
Appreciate your quick response. I will give a go. at the moment i am experimenting with iziBasic building siple forms, but soon i can see that i must start using multiforms for better applications. I think that this (iziBasic) will be growing rapidly and make a very good development program. Once again appreciate your help. regards John |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3 -------- 21/11/2004 @ 12:34 by aldweb
visitor |
Very good answer from our friend gmigueis.
And, I will also provide a new full sample source code in the next release of iziBasic, sample software which will work with 2 forms: the main form and an options form.
Cheers, aldweb
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 4 -------- 18/05/2006 @ 00:11 by Adi Corrales
visitor |
mmm, If I use the destroy method... Is possible to use ViziBasic to create the forms and then put that code in my principal application? Copy and paste, or directly? I don't like to "draw" forms by coding it (I now, I now... I'm lazy... that's why I bought vizibasic ;) ) |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 5 -------- 18/05/2006 @ 15:21 by aldweb
visitor |
Hello Adi,
Yes of course this is possible, by copy & paste (or directly for the very first form because I then at the same time get the skeleton of my application), this is even what I do for each single new form I use in an application under development.
You are not lazy, I developed ViziBasic to speed up this GUI design phase
Cheers, aldweb
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 6 -------- 19/05/2006 @ 12:47 by Garfield
visitor |
Just a quick question - isn't it easier to create extra Forms in a Resource file in Bird instead of creating extra forms by hiding or destroying?
Isn't that the whole idea of the Resource file? Or am I missing something?
Thanks.
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 7 -------- 19/05/2006 @ 23:48 by aldweb
visitor |
Hello Garfield,
Well, I think that both can be used together. Some people prefer to manage all of their application in a single iziBasic syntax and source code. Others don't mind to jump from iziBasic to Bird and back. iziBasic offers both possibilities, everybody has the choice, we are the lucky ones
Cheers, aldweb
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 8 -------- 21/06/2006 @ 00:43 by Adi Corrales
visitor |
Hi again, I'm back (well, only for a couple of days, 'till I got to go back to my work at 100%)... After re-think my project, I stop to try to get images on it (by now at least.. muajajaja!) But now, I'm trying to do multiforming. I was Thinking in some ways to solve the problem. Here is what I think:
1. Create multiple PRC´s and call it with RUN. In this way, I can control exactly what each part of my app do, and it will be so easy to maintain, BUT, The user will have to install A LOT of files (imagine, like 5 prc's and some pdb's at the begining... I think that at the end, it gonna be like 20 or more files!)
2. By Destroy and creating the controls. This way, I can have only one or two files, but I will have and extense ibas (Ok, or many short ibas chained). What I don't like of this is that the change of forms is not as "Clear" as just calling other "Form" (or prc in the past assumption). In this way Vizibasic is gonna be a dream came true!
3. Creating forms in a resource file... but... How do I do that? I was trying with OPENFORM, but I can't create the form, it seems that I just lost focus of the main form, and then I need to hit the apps icon to get out the app...as i said in past posts, I don't understand the resources, so I have a lot of problems here. I like this method because as I saw, the form editor in Bird (sorry aldweb!) Is a bit easy to use than Vizibasic (at least for now!). I like to select controls just to click on it instead draw a window, and the way you can move them with the nav.
I hope that somebody can explain me how to display the forms created as a resource (if there is a direct way to do it with izi...) And I like to hear some opinions about my ideas...
Thanks a lot!
Regards |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 9 -------- 21/06/2006 @ 10:44 by aldweb
visitor |
Hello Adi,
The 3 options you describe will work, all of them have pros and cons!
1. This is exactly it, easier to develop somehow, because interactions between forms would have to be managed with preferences, temporary files, using the clipboard... => I never use this way of doing
2. This way of doing is the iziBasic "native" way of doing, everything is in your source code. ViziBasic can then help you design the forms and you will need to copy & paste the forms design code to your main application. => This is what I use for small projects, with a few forms
3. For sure the most sophisticated way of proceeding. => This is what I use for larger projects, like ViziBasic for instance
The forms have to be designed in a resource file, using one of the BIRD or RsrcEdit tools (don't be sorry for your comment about BIRD, this is a wonderful tool, a must have). The resources are linked to your main application at compilation time by iziBasic. The OPENFORM statement will then do nothing else but opening the form resource (refered by its ID) and displaying it. At this stage, I don't understand where and why you are blocked???
Cheers, aldweb
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 10 -------- 21/06/2006 @ 22:02 by Adi Corrales
visitor |
Ok, in option 3... I design my form in Bird and I give the ID number (101) I added a button in my main form that its supposed to open 101. I use OPENFORM 101, but when I press that button, the mainform does not change, instead, the controls stop to response and 101 does not show. The about box still works but nothing else. I think I should add some code in some part, but I don't know what or where. I thinking that the program "knows" that the main form is not the active one, instead, 101 must be shown, but the code does not know how to handle that form.... I don't know if I should add some label and buttons instruccions in code, or if izibasic its supposed to know what controls are in my 101 form and where they are....any way, I still can figure out how to "link" that form (101) to my .ibas file, in order to handle the events. |
|
|
topic active
topic closed
Sticky
New message -
Correct message
Close topic
Make sticky
|
|