View Full Version : thinForm - clunky to use, but a form designer none the less :)
Petr has updated thinForm to use all of the latest thinBasic goodies.
Thanks to Petr for the updates and fixes again!
You can download the latest version from here:
http://www.thinbasic.com/community/showthread.php?8241-thinForm-clunky-to-use-but-a-form-designer-none-the-less-%29&p=85999#post85999
Can someone give me a URL reference for downloading the most recent version of thinForm. I( would like to give it a try.
Thanks.
Don B.
ErosOlmi
11-10-2007, 17:01
I have this version, not sure if last one but is the last one I have.
Ciao
Eros
Thanks Eros for helping out, I will place links here for everything... I have in the first post for future access.
kryton9:
I have been tinkering with thinForm (1.4) and noticed something that you probably already know about - but here goes anyway.
I created a simple form with radio buttons and a push button. After changing the captions on the form, radio buttons, and the push button, I saved the form and then generated a thinBasic source file. The executed source looks just like the form looked when I was generating it.
However, when I restarted thinForm and loaded the saved form, only the window's caption was still as I had changed it before. The captions on all the controls on the form were set back to their thinForm's defaults.
Otherwise, thinForm works pretty slick. I found your Windows Media demos especially helpful.
Don B.
Thanks Don glad you are playing with it and like it, and thanks for the bug report. I sort of stopped working on it as I found using and making forms using the Free Turbo Delphi and then making a dll for the form was easy to setup and use in thinBasic. This way you have all the power of that IDE.
I do think of ways of bringing that type of interface to thinBasic. I am just not there at this moment in my powerBasic learning to try to write something like that. It is on my mind though. A visual form designer is just too valuable of a tool not to have and I am sure others are thinking about it too.
I updated thinForm to version 1.6
I fixed a few bugs / mistakes that Eros pointed out.
Also fixed a strange bug that lost the control names.
You have two options:
1. generate a script that you can run as before.
2. saves to ini file
when you press save, it now saves it to an ini format file
you can use the ini file to write your own load routines for
flexibility.
load in thinForm now loads the file autoform.ini that is
generated by the save button
If you run autoform.tbasic, all is well. It works as it should.
If you run thinform again and press the load button, the form is drawn the wrong size, but the controls are in the correct places.
You just have to resize your form to see all the controls again.
Everything else is as before in the previous video tutorials.
I just cleaned up version 1.5. Got rid of fields I didn't use so the ini file output doesn't waste space for fields that are never used.
I also added renaming existing autoform.ini files so that they don't get written over by accident.
The latest version is in the first post on this page.
Petr Schreiber
25-05-2008, 11:17
Hi Kent,
thanks for new version!
Petr
That was my first major project in thinBasic, it felt strange working on it and to think of all the new things that have come in thinBasic since back then :)
Michael Hartlef
25-05-2008, 13:14
Thanks Kent, it is nice to see that you are much more into thinBasic again.
dcantera
25-05-2008, 14:43
hi,
I'm a newbie to thinbasic, just found it last night...
I have a small project to create and thinbasic is just the solution, however, there is not much on examples.
the thinform is cool. I don't have any experience with window gui programming... can some one help me understand how to create a windows gui?
thanks,
daveC
Petr Schreiber
25-05-2008, 15:00
Hi daveC,
building a GUI application is quite simple, you just have to keep in mind the concept.
You can use thinForm to generate layout for you or do following in thinAir:
click File/New/NewFile/
From templates choose GUI/CustomDialogWithButton.taguit
That will generate minimal sample of Windows GUI application for you.
The "forms" are called "dialogs" in thinBASIC. Dialog is identified by its handle - unique identifier, typically named like "hDlg" ( handle-of-dialog ).
To such a dialog you can add various controls - buttons, textboxes ... each of this controls has its identifier too, to be manipulable later. So each control has specified mainly handle of dialog it belongs to, own ID, position and other details.
Once you define dialog and its controls, you can show it using "DIALOG SHOW MODELESS hDlg" for example.
To be able to react on events ( button clicked, dialog closed ), you have to read messages in cycle, typically looking like:
' -- Performs loops as long as dialog is "alive"
While ISWINDOW(hDlg)
' -- Get dialog messages - to Msg the type of message is stored, wParam and lParam contain message specific parameters
Msg = GETMESSAGE(hDlg, wParam, lParam)
' -- Now we will determine which message was fired for the >dialog< ... and manage it somehow
Select Case Msg
Case %WM_Command
' -- Here you can process the input from controls
' -- Ctrl identifier
Ctrl = loWrd(wParam)
' -- >Control< specific message
CtrlMsg = HiWrd(wParam)
' -- According to which control we will react
select case Ctrl
case %btnClose
if CtrlMsg = 0 then exit while
end select
Case %WM_SYSCOMMAND
If wParam = %SC_Close Then Exit While
End Select
Wend
' -- Once we are out of main dialog loop, the dialog should be destroyed
DIALOG END hDlg
Hope I put more light on this topic.
There was a nice tutorial on dialogs in thinBASIC, but in italian language. Here is a link to machine translated page. (http://translate.google.com/translate?u=http%3A%2F%2Fwww.italiafreeware.altervista.org%2F%3Fq%3Dnode%2F80&hl=cs&ie=UTF8&sl=it&tl=en)
For more samples please see SampleScripts/UI/ folder.
Petr
Thanks Kent, it is nice to see that you are much more into thinBasic again.
Thanks Mike, yeagh it is lonely in the c++ world so nice to be more back at home :)
hi,
I'm a newbie to thinbasic, just found it last night...
I have a small project to create and thinbasic is just the solution, however, there is not much on examples.
the thinform is cool. I don't have any experience with window gui programming... can some one help me understand how to create a windows gui?
thanks,
daveC
Thanks Petr, for responding and helping out. Welcome to thinBasic Dave.
Don, I am working on fixing the big bug you reported sometime back.
Kent:
Thanks for your update. I will be looking forward to the bug fix.
Don
Updated thinForm to version 1.8:
I think I got most of the things that were annoying me out of the way and fixed the naming bug that Don pointed out.
Copying selections now works the way it should. The copy is what is selected when the copy is done to move into position and not the original source selections as it was before.
The only real oddity that exists is when using spinner controls with either a textbox or label. Don't forget you need to have one of those added right before you add a spinner control. But since the spinner updates the caption in the buddies field (textbox or label), it messes up the autonaming of the buddy field. Right now as a test fix, I am generating a random number and asssigning it to the name. This naming things is not a problem in saving and loading forms or even generating them, it is just when you try to run a generated script, there is the chance of having duplicate control name constants. For now if you get such an error, you will need to hand fix this problem.
But the sizing of forms, selecting and moving stuff seems to be working ok in my tests.
This should be the last release unless you guys find something really annoying or a big bug, so thanks.
The latest version 1.8 is attached to the first post in this thread.
hello
in the file thinForm_v1.8 there is a dupplication in line 165:
code "hwnd as long" to the line 160, can't be run unless commented
regards
Petr Schreiber
22-12-2008, 15:33
Hi Zak,
here is revised version for you.
If you are interested in reason of the problem:
User Defined Type around line 160 had defined dialog handle twice
type tcontrol
ctype as asciiz * 255
caption as asciiz * 255
name as asciiz * 255
id as long
hwnd as long
x as long
y as long
width as long
height as long
hwnd as long
end type
Petr
chris_bdnsee
14-03-2009, 20:34
Hello,
thinForm is another reason why I really like thinbasic :eusaclap:
A question to Kent,
do you plan to update thinform for generating code with the new callback functions ?
This would be really a nice enhancement.... ;)
best regards
Christian
sorry for not responding earlier, somehow I just sort of missed the posts...
I will work on an update or new thinForm once all the new features are complete.
It has been on my mind.
I started thinking about the next thinForm and I thought I would bring up an alternative:
What about using a free form designer, like Microsoft Visual Basic or C# Express IDE's for making the forms?
Then the new thinForm could be written to use the form files generated by the MS IDE to generate
thinBasic scripts. or perhaps the script generator could be written in MSVisualBasic or C#.
Let me know what you guys think or if you have any other suggestions or ideas.
Michael Hartlef
03-04-2009, 09:43
Well, if I would have to install Visual Basic anyway, I would use that totally for a project.
Michael Hartlef
03-04-2009, 09:56
Before I forget, Eros had a nice sample somewhere where he used a trick with bitmaps to move elements around on a dialog. It worked great. But I can't find that script. Maybe Eros is willing to share it.
zlatkoAB
03-04-2009, 10:50
Hi people...
I just download thinForm v1.8 and try start them.
But I only recive error message ( on screenshot).
What is wrong ? or what I do wrong :roll:
ErosOlmi
03-04-2009, 12:06
Many changes has been done in UI since thinForm so ... not sure if better to rewrite it from the basis or amend it.
Before I forget, Eros had a nice sample somewhere where he used a trick with bitmaps to move elements around on a dialog. It worked great. But I can't find that script. Maybe Eros is willing to share it.
It is on the official thinBasic release ;)
See sample in \thinBasic\SampleScripts\UI\MDI\MDI_Test_DialogEdit.tbasic
Than use File/New menu and click on button/checkbox, They will be dragged.
Eros
Michael Hartlef
03-04-2009, 13:07
Doooh :oops:
Petr Schreiber
03-04-2009, 14:58
There was a problem in using IF around CASE statements - earlier version tolerated it.
New version attached.
Kent - it also occurred to me to use Visual Studio Designer, which is great - but it would be temporary solution.
Why should thinBasic user download and install pretty big software to be able to design forms visually?
I see two ways which could lead to good result - community project based on mentioned sample script, or UI designer hardwired to ThinAir.
Petr
zlatkoAB
04-04-2009, 11:30
Yes, this version works ;)
Idea is not bad ...
I am open to any ideas, probably making it a community project would move it along quicker whichever way we go.
I guess I download so many languages and IDE's the thought of downloading MS IDE for that purpose didn't seem like a problem, but I do understand the concerns and you guys are right about it not being efficient.
Maybe Eros and Roberto can decide how they would like a form designer for thinBasic and we can go on from there.
I guess the two options are a module for thinAir or a stand alone app for thinBasic as the first thinForm was.
If there is another alternative let us know here.
Thanks guys for input and ideas.
Michael Hartlef
05-04-2009, 09:26
I would say that the sample from Eros would make a great start. I think the fact that you have the WYSIWYG feature covered is alo great. You would use thinBasic dialog elements and features. ;)
I would like the next version of thinForm to be integrated in with thinAir. Roberto, would I need to make thinForm a dll for thinAir to use it, or a stand alone exe file?
I am thinking of using c++ to make the form designer, as I think thinAir is written in c++. Can I use MFC or do I need to stick to strict winapi coding for the controls?
Thanks for any info and thoughts.
ErosOlmi
09-04-2009, 07:59
Kent,
thinAir is 95% written in Power Basic. The rest 5% (some of the area related to Bundling capabilities) is developed using MS C.
I've thought a lot about a visual designer for thinBasic and I come to the conclusion that the only way to be able to use thinBasic special controls like SplitterBar, ViewPort, ImageCtx, PropertyList, ... is to develop it with thinBasic itself. Of course I can be 100% wrong but I have this feeling.
If developed within a thinBasic application, all control features will be directly available.
If developed with an external program or dll, you have to mimic thinBasic behave. Of course this is very simple if dealing with standard controls like textbox, listbox, combo, radio, check, ... But this is not trivial (if not impossible) for all other controls some unique to thinBasic.
I have some code to start from. Code to develop tools palette, to add handlers to controls if in design mode, code to manage control properties, ... I need to find time to concentrate and give it a start.
Just a personal thought.
Ciao
Eros
Michael Hartlef
09-04-2009, 11:28
I would also prefer a designer where you get the same native output and behaviour so I think developing this in thinBasic is the best choice.
Eros and Mike, I will keep studying and thinking about ideas and have more direction to focus on now seeing how my thoughts about thinAir being a c++ app were wrong.
If developed within thinBasic or using Charles modules or combo of both... will it be possible to integrate into thinAir later then?
Michael Hartlef
10-04-2009, 07:10
What do you mean by integrate it into thinAIR? What kind of functionality do you want to get?
ErosOlmi
10-04-2009, 07:11
Kent,
from my side, as soon as I will finish 1.7.8.0 version, I will try to produce some of the code basis needed to create a form editor is order to simplify it as much as possible.
Ciao
Eros
@Mike, about integration with thinAir these are some things that would be inside thinAir:
File/New/Form
In the tool bar an icon for new form.
Then from thinForm to put the generated script into thinAir into a project that creates all the necessary file for you.
I am even thinking of maybe with Charles modules, some sort of more interactive development as they have in MS IDE, with
dynamic code updating, code completion etc.
Since this would be nice also for thinAir this would some how need to be integrated.
Just some thoughts for now.
@Eros, no rush just flushing out ideas for now of what could be done or not.
I guess the easiest way to describe my wishes would be to say be all that the form designers in Borland or Microsoft Products are and then some.
I know high goals, but we all love challenges here.
Lionheart008
11-04-2009, 08:41
hi all, dear kent, eros, mike.. :)
although I don't know much about thinform and coding form structures (btw: thinair was programmed in powerbasic/c??? -wow-, why not with thinbasic ??? ), but as I know you can use with "iBasic" (found iBasic by googling 'basic', the program doesn't exist anymore, but have had a good gui, many examples included and online tutorial too :) ...!) by three, four click a multiple button and form dialogue under the same ibasic GUI I liked it (have used some weeks ago the prof. demo!)... this functionality of forms creations belongs surely to other basic languages too... and my thinform knowledge are still low... uff...
download area: http://download.cnet.com/IBasic-Professional/3000-2069_4-10381532.html
I would like to see it also for 'thinair' (I love it!) as a new menu bar with templates, icons, examples... we can use it simple and fast to create forms or include it even in UI/TBGL module... It's a lot of work I can imagine to program this kind of forms... the idea of forms creation with integration to thinair I like also to see... (ok, I seldom use thinform for my daily work)
Then from thinForm to put the generated script into thinAir into a project that creates all the necessary file for you.
I have used thinform for two, three button examples with date (calendar), time and slider options... was very impressed how fast/good this features worked ! :D
good luck for this development and new releases :)
ciao, lionheart
Thanks lionheart for thoughts and ideas. Yes thinForm was ok for small simple forms, but anything with lots of controls and then wanting to rearrange them showed its very big weakness.
Also since thinBasic is updated frequently, I am not sure if writing the script for the user is the solution.
I am thinking about a simple command maybe to load a control from an ini file or some sort of datafile. Then the programmer could code in any style they so wished and then thinform would not be out of date with changes to thinBasic and its new features.
Just some thoughts as still thinking about all the possibilities.
Petr Schreiber
11-04-2009, 12:30
Hi Kent,
I think the form layout could be stored in some sort of XML file.
That would allow adding new controls and options ( resize options, initial color override ) for them smoothly.
Petr
ErosOlmi
11-04-2009, 12:35
In fact in one of my late night self brain storming I was thinking about XUL (http://www.mozilla.org/projects/xul/) file layout as the basis for dialogs control properties storing
About formats:
For some reason XML just doesn't appeal to me, especially for data storage. Just so much extra stuff with all the tags for each item.
Actually for storing data in text, CSV (Comma Separated Values) is as efficient for text based it gets I think. I always liked the formats which
stored the field names in the first record and all the actual data started on line 2 till the end of file.
I also like ini files, I must say, but it is more suited for and well designed for configuration and not data storage of repeating fields.
Not that I haven't used it as that and still prefer that over XML-- as still cleaner to look at, if you ask me.
Looking into:
I am going to study Charles' modules as I would like to use his neat oop possibilities and to finally get my head into his powerful modules.
Charles Pegge
12-04-2009, 07:36
I may have a generic solution for reading/writing complex data formats: Use Basic as a data script :).
To make this happen, both thinBasic and Oxygen need to be able to interpret/compile a string of source code at run time. I'm developing a function called compile(), wherebye Oxygen invokes itself - which has some interesting consequences...
ErosOlmi
12-04-2009, 08:38
Actually for storing data in text, CSV (Comma Separated Values) is as efficient for text based it gets I think. I always liked the formats which
stored the field names in the first record and all the actual data started on line 2 till the end of file.
The problem with CSV is that they are positional and not dynamically handled.
Imagine you have to store control properties. With CSV you need to assume that all controls have the same properties, and this is not the case. Some are common, some not.
Also with CSV you cannot change the initial structure because it would be to change also the application that read/write them.
While with XML or INI you can add new features and this does not effect the application.
An option could be to handle old VB6 form file, the one with .frm extension. Even if quite old, it is not that bad and is dynamic but with blocks begin/end
Ciao
Eros
About CSV Eros, I have written many times custom load csv apps which are dynamic, the load app reads the first line and determines the number of fields and can then load any new fields automatically.
For controls that are really different in field structure, I would just use separate csv files. But you make a good point about the new formats perhaps not breaking old code.
I will wait to see what Charles comes up with for his data storage idea and just keep tinkering with concepts in O2H and making objects for controls for now. I am sure it will all come together in a nice solution eventually with all of us working on it.
Charles, I am interested to see what you come up with for data storage thanks for working on it!
ErosOlmi
12-04-2009, 19:52
I have written many times custom load csv apps which are dynamic, the load app reads the first line and determines the number of fields and can then load any new fields automatically.
Yes, I know that but the problem is still that it is not dynamic but positional.
For example if second column has some kind of meaning (for example ControlID) and than you insert a new column between the first and the second, your application will not be able to understand unless you write a lot of code to match column names with column positions.
This is not the case of other file formats where even if you add any number of new info, they will still work with the original application.
Anyhow, I just wanted to point out that file type choosing is an important key point.
Ciao
Eros
No you are right Eros, obviously the new formats came about because of deficiencies in other formats. And looking for the matching format to meet the solution is very important as you mentioned. I just have a weak spot in my heart for csv files being an old timer :)
I downloaded ThinForm v1.8. Great tool! But when I generate a script I can't open the Autoform.tbasic-script (or any other script) with Thinform. What's wrong here? So I use Notepad now to see and edit the script but I would prefer to use Thinair ofcourse.
Another question about ThinForm:
What's the function of the buttons in the left top of the form? I can't figure it out.
I mean these buttons:
0 0,25 3,25
1 0,5 3,5
2 0,75 3,75
etc.
Martin
Martin, thanks for trying thinForm 1.8
Those buttons are quick access to distance units the next control will be created, or how much to move an existing control.
When you click the save button, it just saves in a format that the load command can read and let you pick up from previous session of developing the form.
Once you have the form in a manner you are ready to work on the script. Click on the gen script button. This should create the Autoform.tbasic file that you can open with thinAir to edit.
gungadout
30-07-2009, 10:07
Hi Kent,
FYI, I downloaded thinForm_v1.8.tbasic and tried to run it.
It gave me a syntax error. See attachment.
I tried it because it may have some potential for me. I won't know until I see it in action.
If you get a chance to look at it some time, I'll try it again once you have.
Regards,
Peter H.
Petr Schreiber
30-07-2009, 10:13
Hi Peter,
this is known issue I fixed in attachement of this post:
ThinForm 1.8c (http://community.thinbasic.com/index.php?topic=1066.msg19268#msg19268)
I will ask Kent to attach it to first post of this thread to avoid confusion.
Petr
Thanks Petr, it is updated.
gungadout
31-07-2009, 02:16
Sorry Gents,
I missed the update post. I think I was a bit tired.
Petr, thanks for straightening me out.
Regards,
Peter H. (Gungadout)
Chris Boss
24-06-2011, 08:07
Interesting discussion!
How does one write a UI in ThinBasic ?
Just like PowerBasic, SDK style ?
I might be interested in offering some help in this area.
I currently offer a Visual Designer (freeware) for DDT and it could be modified for ThinBasic.
As a third party developer for PowerBasic, I think it would be good to help promote thinbasic. ThinBasic , as freeware, could be useful in promoting BASIC as a language, which is a good thing IMO.
With my latest Designer (EZ5) I have pushed the limits of Visual Design even more (I continue to learn) and it may be useful in helping create a designer for thinbasic.
So what is the current state of a Designer and/or IDE for thinbasic right now ?
Building a Visual Designer requires a number of core systems such as:
- a Form file format
- drag and drop form editor (aka. drag handles to move and size controls)
- property dialogs or property listbox for editing properties
- project (multiple forms) tracking (aka. project file format)
- control alignment (working with multiple controls)
The area of Visual Design greatly interested me.
ErosOlmi
24-06-2011, 12:26
Dear Chris,
first of all thanks a lot for being here with us at thinBasic community forum.
Many of us that follow PowerBasic forum know you and your great passion in developing user interface designers.
Regarding current state of a UI Designer in thinBasic is quickly said: nothing.
There were some passionate experiments years ago like the one you traced in this thread
All UI you can have into a thinBasic script is typed as code in thinBasic scripts source code more or less following a syntax very very close to PB DDT.
You can check thinBasic examples installing thinBasic and going into \thinBasic\SampleScripts\UI\ directory or also check Tutorial example in \thinbasic\Tutorial\ directory.
So and help on UI side is really appreciated and I'm quite sure other will be interested.
Important is to understand that thinBasic is a continuous descendant parser interpreter.
Every line of the source code can be interpreted again and again and again (if inside a loop or inside a callback function).
In theory (but not allowed ATM) you can even change source code while script is executed and execution would change according.
This gives great opportunity but impose some constrains: you do not have an exe that uses one or more dlls, you have to work on something like quicksand.
Also consider that I personalized (not much) some standard control behaves and added few custom controls and who would like to create a Designer has to consider this.
Maybe it is better to open a dedicated forum related to UI Designers for going on to discuss in there
Let me know.
Ciao
Eros
Chris Boss
24-06-2011, 16:26
One of the reasons ThinBasic interests me is this:
To promote Basic as a professional programming language (ie. PowerBasic) requires that Basic be promoted as a language for those interested in learning programming as well. While PowerBasic is great, learning languages usually are most successful when free. Thats why QBasic was so popular in the DOS days. It was so accessable.
I have followed a number of attempts at Basic languages on the web and while interesting, they become only slightly successful. A number deviate from the core Basic syntax of old, unlike PowerBasic which maintains the core Basic syntax I prefer. Some cater to game designers, so the graphics are great, but the language tends to be terrible. Some jump on the OOP bandwagon and lose the feel of Basic (OOP should be secondary to the language, not primary, like it is with PowerBasic).
Because we live in the age of Visual Design, many lack a decent visual designer and that hurts them as well (even though I still like being able to hand code a UI if I want to).
ThinBasic interests me because it was written using PowerBasic and because it emulates PowerBasic syntax (plus has lots of extras). It is freeware and has a good community of developers.
When you look at the history of Basic, it had a number of reasons for its success. First, there were freeware versions people can learn with. Second the language was easy to learn and to teach. Third, there were professional versions you could gravitate to when you wanted to do more.
Programming has changed a great and expectations are much higher now, because unlike the DOS days, computers are so much more powerful and everyone is use to more vivid graphics and user interfaces.
Sadly, Basic has been treated as if it is obsolete and old fashioned. Just read the following articles:
http://www.computerworld.com/s/article/9217820/How_are_students_learning_programming_in_a_post_Basic_world_
http://www.salon.com/technology/feature/2006/09/14/basic
Microsoft can't make its mind up what it wants to promote as the core programming model (is it dot.net, is if WPF, is it HTML5, is it Javascript).
As a long time professional programmer I appreciate the value of the Basic language. PowerBasic is one of the industries "best kept secrets. Because PowerBasic programmers are forced to learn the Windows API, the PB community likely has a better grasp of Windows under the hood, than many C# programmers today.
Also for a long time, people didn't care about the bloat in programming languages (aka. dot.net) because computers were so powerful (so who cared), but now with Tablet PC's and Netbooks becoming the latest fad, tools like PowerBasic (and ThinBasic) have an advantage. You can write software which will run on minimal hardware, which require little memory and disk space.
ThinBasic is an obvious choice to promote as a freeware Basic development tool.
I am not sure how much time I have to be able to help out with ThinBasic, but it may be worth some investment in time.
Chris Boss
24-06-2011, 16:43
Many may not realize this, but my GUI engine software is designed specifically for the task of building visual design (WYSIWYG) style applications. My latest (EZ5) Visual Designer is a 100% EZ5 application, meaning it does not make one single Windows API call. All the drag and drop stuff is built into the engine. EZ5 even comes with a drag handle control, a subclassing engine to take control and impliment drag and drop and property listbox control (perfect for adding property lists in a designer). All the hard stuff most face when trying to build a visual designer is all built in. Even things like snap to grids are built in.
As I learned new ways to do things, using the API, when it comes to visual design and drag and drop, I added it to the GUI engine, so it would be there when I (or my customers) wanted to use them.
Chris Boss
07-07-2011, 21:45
To start with ...
What code editors do most use when writing ThinBasic programs ?
Also could some post a very simple example of a ThinBasic program which displays a Form (Dialog) with a few controls on it.
If I create a Visual Designer for ThinBasic, it would use the Smart Parser technology I currently use in EZGUI 5.0, which would allow any external code editor to be used. The source code library from my last freeware DDT Visual Designer also could be used as the basis for coding forms.
When I get a chance, I'll see if I can create a quick prototype.
ErosOlmi
07-07-2011, 21:59
thinBasic editor is called thinAir. Just install thinBasic and you will get thinAir
7333
thinAir has complete debugger called thinDebug:
7334
As an example you can use thinBasic tutorial script you can find at \thinbasic\tutorial\Tutorial_Intro.tBasic
Just double click on it to execute script on the fly or right click + Edit to open source code into thinAir editor where you can see source code (and execute it)
7335
Tutorial script uses a lot of UI controls: menubar, toolbar, imagelist, treeview, splitter bar, richedit and web browser, viewport.
Also check the many UI scripts you can find into \thinBasic\samplescripts\UI\
Ciao
Eros
It will be nice to see what you guys come up with. Writing a good form editor is a challenge that is for sure.
Petr Schreiber
29-01-2012, 17:45
I remastered the thinForm to new standard, that is:
it uses Callback mechanism to process messages
partially eliminated global variables
project file/save to user chosen file
project file store thinForm version information
form script generation to user chosen file
also supports Callback event handling
it runs with ThinBASIC 1.8.9.0 out of the box
There is space for improvement (splitting to more files, using property control, ...), but it could serve as point zero for further modifications and tweaks.
thinForm 2.0
This script is simple form editor, able to generate script code for you, as well as store form as project for later fine tuning.
The program is organised to 2 windows:
main window with tools
second window, which is the one being designed
Quick start
To get the idea on the controls, you might try to design your first dialog with text box and button.
Setting up the dialog
to change default text for dialog, you might edit the caption property from "myapp" to for example "How old are you?"
to change the dialog client area, you might fill the width and height property to for example. Try for example 320 and 160.
hit "Set" button to make the changes appear
Adding the textbox
now we might want to add textbox
press "Text" in the lower part of window
fill cspacing to 5, cwidth to 310 and cheight to 20
click the "Add new" button
textbox will appear
you now might want to change its "txt 2" text to "default". Just change the text in caption and hit "Set"
Adding the button
now we might want to add OK button
click on the "Button" button :)
fill cspacing to 5, cwidth to 310 and cheight to 40
click the "Add new" button
button will appear
you can now change its default text to OK by editing the caption and pressing "Set"
if you want to move the button, just use the "up", "dn", "lt", "rt" buttons to move it up, down, left and right
Switching between the controls and form
As you probably noticed, the current control has orange borders. To change active control for editation, just use the "first", "prev", "next", "last" buttons.
To edit the form properties, hit the "form" button.
Saving the project
Just click the "Save" button, and fill in the name you wish.
This option saves the form for later processing.
Generating the script
When you are comfortable with the dialog look, press the "Gen script" button. You will need to enter name for the script. Once done, stand alone GUI script skeleton with your controls is at your service! You can edit it now with thinAir and finish the program...
Petr
Chris Boss
30-01-2012, 23:39
Thinbasic appears to be in real need of a Visual Designer from what I can tell.
As an independent developer I am not in a position to give anything away for free (wish I could), but I might point out that I am currently offering a previous version of my GUI engine (sold originally for $249) for the obsurdly low price of only $39 for hobby programmers and if any thinbasic developers who use Powerbasic are interested , it may open up some possibilities for building a true Visual Designer for thinbasic (which I can help out with showing you how to use it). My GUI engine tool, for those who don't realize it, is designed so one can build a visual designer. It has its own drag and drop engine, a drag handle control (to impliment drag and drop), a property listbox control and more.
To appreciate what it could offer to the thinbasic community, you can download my DDT (for Powerbasic) freeware Visual Designer which was creating using this GUI engine. The designer does not use a single Windows API call to do what it does. The GUI engine does all the drag and drop.
http://cwsof.com/freeware/ezdlgfre.zip (freeware DDT Designer)
I can contribute some source code for using the GUI engine to help get a Visual Designer up and running quicker.
Let me say that building a visual designer with real drag and drop and things like a property listbox control is not easy and it has been the biggest weakness in a number of independent (free and commercial) programming languages found on the internet. It is the one area which programmers seem to have the hardest time. Often they try to cludge together a designer using the command set of their programming language and fall terribly short.
I have researched the Windows API for years and built a drag and drop engine into my commercial GUI engine just for the purpose of building visual designers.
Thinbasic IMO is one of the best projects I have seen for a freeware programming language and I like that it emulates Powerbasic too.
The one area I have not done anything with though is code editors (most independent developers don't build one from scratch but use one of the freeware code editor libraries available).
I would be willing to provide some personal help in this effort if possible.
If ThinBasic could move forward with an official Visual Designer front end, it could be come one of the best freeware programming languages around. It is already great, but lack of a Visual Designer holds it back a bit.
Hi this is my first post to this impressive forum.
LONGER VERSION
I am a "VB refugee". I have programmed since 1976 (some Fortran, mostly Basic) to support my work and hobbies mainly in the area of geo-science data analysis and physical systems modelling. I have developed a collection of programs in MS Visual Basic running on Windows 2000 on a 3Ghz P4 with 0.5 Mb of Main RAM. (Please dont laugh!! "If it aint broke dont fix it" was my motto). It also has WinXP(SP0) but I havent used that very much. Many factors tell me it is time to upgrade.
So...
A new computer? yes.
A new OS, sadly, yes.
A new Programming Tool - hmmm.
Microsoft say "VB6 is dead so come to VB express it is nice and free". Hmmm. But I have to port my old code and it will not be easy. So I think "if I have to port why not look and see if there is a better solution?". Maybe now is the time to learn C, or Python, maybe go to Linux. I enjoy a little light programming but I do not live to program. I also need to use the programs I write. So I do not want a big learning curve. I want something like VB6. I search the Wikipedia. Oh so many different BASICs. I try a few and then I find thinBasic.
WOW. It downloads easilly. It works first time. I can understand the examples. It has so much going on. I wish I had this ten years ago it would have saved me from VB.
But. There are a few questions I need to consider.
1) I use dashboard-type forms with lots of text boxes in which I display current parameter values. These forms evolve over the years like eternal prototypes. I found this Thread and tried out Petr's UI designer. Actually it can probably do almost everything I need. But I need to think... "if I design a form this year and generate a script and then fill it with lots of my keyboard-typed code...fine...but how will I add new buttons next year? I guess that I can just hand-enter new control definitions into the script. I wont be doing it too much so I personally could probably live without a fancy GUI RE-design capability. And in some ways design by scripting rather than dragging will give me MORE power over the UI (e.g. I can comment my design in a script).
2) I do not see many products out there with an IDE like Visual Studio. Much of its richness I can do without but what I really like is the ability to interact in debug/break mode - e.g. to interrogate at the command line, to evaluate typed-in expressions, to inspect variable values by cursor rolling over them, to poke new values into variables, to even amend code. I dont know about thinBasic/thinAir underlying architecture but I guess that this sort of thing is not easy to implement.
3) I have recently developed a "need for speed". Attached script (Collisions19) shows the sort of ultra-basic physics modelling that I am interested in (elastic spheres, conservation of momentum, different arrangments). I call it BillyBalls for short. The script is my crude hack of a nice demo written by Jordi Valles, Petr Schreiber and Charles Pegge with thinbasic, TBGL and oxygen. I would need to hack it further and make the physics more realistic (event-driven rather than time-constrained as the collider experts say). It seems (from my brief researches) that most of the physics engines out there are for games or glossy animations. There are one or two academic resources about but they involve complex frameworks and large C libraries and I dont do C. The thinBasic + Oxygen partnership looks very interesting to me. I have never "popped a stack" in my life but while studying the oxygen code I found myself looking up assembler notation. Next week I expect will be designing my own chips! (Not). Petr's TGBL demos are very impressive to me. I personally dont need glossy graphics but anything that speeds up my simulation is useful to me. I looked at PythonXY, I'm not too keen on the Python style but they do have some good maths and science libraries e.g. NUMPY which speeds up array processing.
I'd better stop there for now.
I posted on this thread because of the UI stuff, maybe it should go somewhere else?
I'm sorry about the length of this post...
...here is a
SHORTER VERSION
I love your forum.
I love the products on show.
I need to think about thinBasic Form design, debug capabilities and number crunching capabilities.
Any advice would be very welcome.
ATTACHMENT
CollisionsV19
I have not used this, but have read good things about it for linux.
Gambas is a free development environment based on a Basic interpreter with object extensions, a bit like Visual Basic™ (but it is NOT a clone !).
http://gambas.sourceforge.net/en/main.html
I really don't understand people who need any sort of Visual designer for programming GUI
programs.Probably i am not used to that way of programming.
And i doubt that this way speed up any kind of programming task.
Probably do when you have lot of controls in one window(dialog).
ErosOlmi
05-03-2012, 09:47
--Aurel
I think we can survive without you to understand.
I prefer to have an open mind forum listening to all point of view rather to say "I do not understand you" (with "you" referring to a general you)
--Steve
you have expressed many very good points worth to take into consideration and deeply discuss or just think about.
thinBasic is an interpreter so in terms of speed it will never compare to real compilers. We closed the gap developing many many native functionality in order to write in few (interpreted) lines what other languages need much more code. Than there is Oxygen that that add the power of just in time compiled code to the interpreter (thinBasic). Consider that Oxygen can understand ASM and BASIC syntax so the Oxygen part of your collision example can be much more Basic like
On visual designer, yes I definitely need to think about that.
On the debugger, I think it is quite good but for complex scripts it has no advanced features like changing or executingpart of the code at runtime or changing variable data while debugging
All aspects to think about
Petr Schreiber
05-03-2012, 10:23
Hi Steve,
welcome to the forum. It was very interesting to hear about your background and ideas. Although I was not a big fan of visual designers myself, now I realize they can really speed up the design and generally help to get the job done faster.
Here is the brief quickstart guide to thinBasic debugger:
you launch debugging mode by pressing F8 or clicking the red arrow on the toolbar
use F8 to step line by line
use CTRL + F2 to place break point
use F5 to run to the next breakpoint
you can inspect the variables by clicking them in the lower left part of the debugging window. It is possible to inspect even individual memebers of the variables based on TYPEs and also 1D and 2D arrays using gridview
to abort debugging you need to hit the red button on debuggers toolbar
I had a little issue running your code, because there was minor problem on line 1039 (you can use Ctrl+G in ThinAIR to get there), which confused the Oxygen in the 1.9.0.0 preview version of thinBasic. It was:
end sub O2s_Finish
but it should be (name of sub commeted out):
end sub ' O2s_Finish
I attach the modified version here. Please do not hesitate to create new thread for this your modification! For example here:
TBGL Scripts and Projects (http://www.thinbasic.com/community/forumdisplay.php?221-TBGL-Scripts-and-Projects)
or here:
O2 JIT Compiler / Programs (http://www.thinbasic.com/community/forumdisplay.php?356-Programs)
If you have ideas for new features or if you found an problem, you can report it in the Support (http://www.thinbasic.com/community/project.php) section of the website.
Petr
--Eros
You get me wrong ,i don't think that is something wrong to use (have) Visual designer at all.
ErosOlmi
05-03-2012, 12:01
--Eros
You get me wrong ,i don't think that is something wrong to use (have) Visual designer at all.
Aurel,
maybe I got it the wrong side but ...
if you say "I do not think a visual designer is needed" I would say nothing because is your idea referred to the object and not to "people". So I will always respect it.
When you refer to "people" clearly referring to the one just posted before, you are "judging" someone. In this case I feel I need to act.
That's why I posted.
Sorry about that but this is my forum and I want it open mind as much as possible.
Ciao
Eros
- - Eros - -
Thankyou for providing this forum. I think your open-minded and friendly style is very good.
- - Everyone - -
Thankyou very much for your feedback, so much and so soon.
I think I should respond individually to avoid one big bloated post.
I will try to shift to other threads where appropriate.
Please bear with me on this, I am new to internet forums in general.
I really don't understand people who need any sort of Visual designer for programming GUI
programs.Probably i am not used to that way of programming.
And i doubt that this way speed up any kind of programming task.
Probably do when you have lot of controls in one window(dialog).
Aurel,
Thanks for your feedback.
I think I know what you mean. When I first tried to learn visual programming in early 1980's (on VAX/VMS/FMS and DEC Windows/X Windows) I found form designing very confusing and a big slow-down on my production rate. Even now with my old bloated VB project I am often not sure where all the different bits of code are floating around. Some bits are hiding in buttons, some in forms, some in the main program. For me one of many nice things about beginning to learn thinBasic is to find nice, individual, compact, self-contained scripts. And each script contains all the script-specific logic in one place. Which is great.
At the same time I agree with Chris and Petr about some benefits of an effective Form Designer/GUI Designer/UI Designer. I guess that having one could help to attract more programmers to using thinBasic. When I worked with end-users I also found that involving them in form design using a visual drag and drop tool helps to increase their commitment to an application. Even if they just choose the color of the buttons. This is especially true of users in HR and Marketing and PR departments!
But does thinBasic "need" a visual UI designer? I am reading that Eros puts passion before profit; the results of the community are often beautiful (IMO). Maybe attracting large numbers of new users is not the aim of the game. For me the best restaurants to eat in, and work in, are those which do not wish to become like MacDonalds.
For me (as a programmer) Petr's Visual UI Designer is good because...
1) It lets me see at a glance what kinds of control are AVAILABLE that I might use
2) It lets me quickly produce a Visual Form and an associated Dialog script skeleton without having to browse through documentation about structures, methods and parameters.
3) (IMO, from review of forum history) Petr seems to be always making newer and better things. I think perhaps that he is robot-assisted.
This is getting too long. So I will stop.
I have not used this, but have read good things about it for linux.
http://gambas.sourceforge.net/en/main.html
Kryton,
Thanks. Yes I saw Gambas on Wikipedia and keep coming back to it.
My VB legacy has so far kept me chained to windows. From technical angle I am rather shy of Unix in general and of Linux in particular. I dont want to be a system manager. I cant justify the cost (in mental effort and physical logistics) of running two operating systems at once. I occasionally work offshore and am weight restricted to one small laptop. I am reluctant to gather all my bags and make an all or nothing jump from windows to linux.
It would be nice to have a low-cost, low-risk bridge into the Linux/Open Systems world so that I can migrate piecemeal in small chunks and revert if things get messy on the other side. The bridge would involve hardware, OS, officeware, application dev and run environments.
A web-browser/java route would seem possible except for my legacy basic programs and need for high-powered data crunching. Maybe theres some way of using cloud-based processing power at low rental cost. But then that would not be available offshore.
Hmmm.
No ,it's not long if is interesting to read.Your observation is very good & OK.
Kryton
P.S. I just reread this thread from beginning and see that you were the originator of the thinForm.
I apologise for having not honoured you accordingly.
Petr Schreiber
05-03-2012, 17:29
:) Yes, Kent (Kryton9) is the thinForm author - I just did minor help and updated the code to reflect some advancements in ThinBASIC syntax over the years (switch from CPU intensive GUI message processing to CALLBACK mechanism, described in ThinBASIC Journal #2 (http://www.thinbasic.com/community/showthread.php?9450-ThinBasic-Journal-Issue-2))
Petr seems to be always making newer and better things. I think perhaps that he is robot-assisted.
Thanks for your kind words. Regarding the robot-assisted... yes I am, please see here (http://www.thinbasic.com/community/showthread.php?11505-ThinBASIC-flavoured-robo-invitation&highlight=advee) :p
Petr
Eros,
thanks for your kind words on my first post.
I did not realize till just now that thinBasic executable was a bundle and not a compilation.
Now I understand better how PowerBasic and Oxygen fit into the picture.
For my needs this is not a problem.
I begin to understand the architecture of having a nice easy-to-code thinBasic as a kind of "orchestra conductor" between the user interface and the high-performance pre-compiled engine (oxygen or other special DLL). It reminds me of the client-server model.
Now I am thinking about how to speed up an event-driven simulation.
Maybe I can decouple the front-end user interface from the back-end simulator engine by running as separate processes. E.g. I can fire up two separate thinBasic scripts at the same time?
Is there presently any suitable way of asynchronous communication between seperate thinBasic processes?
(P.S. This post is drifting away from the topic of the Visual User Interface thread.
Please can you advise how do I move it to another thread?)
Kryton
P.S. I just reread this thread from beginning and see that you were the originator of the thinForm.
I apologise for having not honoured you accordingly.
Thanks, it was my first major app to learn thinBasic. I got lots of help from Eros and Petr. It also showed the beauty of thinBasic that a newbie could take on something like that.
Petr took my wood wheeled cart and made it an automobile. The current version that he made is all his talent and in using the new control handling system that Eros put into place.
I am glad you will be giving thinBasic a try. Your projects sound like they will be very interesting to follow in the coming future.
ErosOlmi
05-03-2012, 21:50
Is there presently any suitable way of asynchronous communication between seperate thinBasic processes?
(P.S. This post is drifting away from the topic of the Visual User Interface thread.
Please can you advise how do I move it to another thread?)
Yes, it is better to open new posts.
One way to communicate between process can be using Tcp/Udp module.
Some examples can be found into http://www.thinbasic.com/community/forumdisplay.php?246-Tcp-Udp-module
In particular: http://www.thinbasic.com/community/showthread.php?9355-Code-Networking
Here another way: Memory Mapped Files: http://www.thinbasic.com/community/showthread.php?8940-Interprocess-communication-(Memory-Mapped-File)
Some Microsoft advice: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx
Thanks Eros.
Thats "Right on the Nail"
Those links are exactly what I needed.
IPC (Inter Process Communication) is the keyword.
I will study the thinBasic examples and do some thinking.