Results 1 to 10 of 17

Thread: thinBasic Visual Designer Code Generator

Share/Bookmark

Hybrid View

  1. #1
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,113
    Blog Entries
    2
    Rep Power
    10

    thinBasic Visual Designer Code Generator

    Ok, some vaporware to show in thinBasic world.
    It is some time I'm working on next thinBasic version 1.9.
    I've already added many new features to the language, many new options to SDK engine regarding Module Classes, and now I've started to work to a very rough visual designer.
    I've used a quite old piece of code from PB forum public released by "JULES MARCHILDON" (I will add merit in executable when it will released) changing and adapting it to work under all latest Windows Versions including Windows 8.

    So far I've added few controls, control property dialog, form properties, tab order dialog, possibility to save forms in binary format in order to be able to save and re-open when needed.
    At the end, the visual designer directly produces thinBasic source code ready to be pasted into a thinBasic script and be executed.
    I've intention to release Visual Designer as PowerBasic source code so everyone will be able to participate in development.
    The idea is to finish beta version able to work as simple thinBasic code generator but later I will try to add events to forms and controls in order to add thinBasic source code directly into designer and produce real applications and not just skeleton of scrips.

    Anyway, a video is worth 1000 words.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,113
    Blog Entries
    2
    Rep Power
    10
    That is not automatic.
    What is best is usually a programmer by programmer decision and is valid only for that programmer.
    So, the most there will be on the table the better for thinBasic programmers.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,776
    Blog Entries
    3
    Rep Power
    690
    Eros,

    this looks really great, it would be big help in form intensive applications. The controls are intuitive, I like it very much!
    My mind is already full of wild ideas:

    Visual designer itself
    • add support for RESIZE of controls (anchors)
    • use Begin ControlID/End ControlID blocks in generated code for equates
    • add option to generate code for dialog, which is not in TBMain (code for secondary dialog, for example to be placed to other thinBASIC Unit)
    • add help label to the form, where you pick the styles - beginners are usually not familiar with Win32 styles
      • something to think about - preserve style definition using Win32 styles, or go the route of "general" styles implemented via Win32 behind the curtains?

    • define the format of forms in XML -> possible use by modules, see below


    Module related to visual designer - classic conservative approach

    • ability to save/load the forms from XML(or other format) to script.
      So something like hDlg = Module_CreateForm( sPathToFile )
      The benefit is that the code does get simpler, without 100 lines of dialog definition
    • the equates could be then defined from module via thinBASIC_AddEquate without need to be explicitly named in code


    Module related to visual designer - OOP style
    As ThinBASIC modules in 1.9.0.0 will have great power, I think it would be possible to design standalone module, allowing to handle forms via OOPish syntax. Imagine:
    DIM myForm AS TBForm = new TBForm("Form1.bin") ' -- Constructor loads the form definition from file
    myForm.ShowModal( EventProcedure ) ' -- Classic method call, passes callback function name as parameter, invokable internally using thinBasic_FunctionSimpleCall_ByPtr
    
    ...
    
    myForm.Edit1.Text = "Hello" ' -- Now this is a bit more complex, but not that much - each control has its equate stored in the definition file, so via the approach which is used for method chains in Betas, when I find symbol, which is not method, I look if it is not name of the control (based on loaded data), and then behave accordingly
    

    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,113
    Blog Entries
    2
    Rep Power
    10
    eh eh Petr,

    I know your mind is always travelling fast and in different directions at the same time. And ... I LIKE IT

    At the moment all is very rough:
    • Visual Designer Power Basic code is quite copy/paste mode from different sources. I need to better organize, "modularize" and beautify it before I can release it
    • form can be saved but actually only in binary format. I will sure convert it into XML format
    • thinBasic generated code is quite bad but the beauty is that it can be "modulated" in the sense we can add different "code generators" dynamically.
      In any way next generated code will be much better
    • I still need to add all main controls. After that I will add thinBasic special controls
    • I definitely want to add possibility to add events (in form and controls) and add thinBasic source code to events directly into Visual Designer
    • I will also add possibility to execute thinBasic code directly from Visual Editor without the need to copy/past code into thinAir. Anyway all possibilities will be available.

    So, a lot to work on but seems exciting looking at the possibilities.

    Very soon I will release PowerBasic Visual Designer source code into thinBasic SVN server

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  5. #5
    Eros,

    The preview looked good. I came to the forum today to read some older threads about making Dialogs and Forms. So it was nice to see what you have planned for thinBasic's future.

    Lance

  6. #6
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    61
    Posts
    3,869
    Rep Power
    397
    Looks really nice Eros! Such a good language needed a good form designer and your plans for the future sound really great!

Similar Threads

  1. Is there a thinBASIC Script UI Designer
    By gian20 in forum thinBasic General
    Replies: 2
    Last Post: 09-04-2012, 04:06
  2. thinBasic interface under Microsoft visual C/C++ language
    By RobertoBianchi in forum MSVC++ 6.0
    Replies: 26
    Last Post: 05-03-2010, 17:10
  3. Firefly Visual designer
    By Michael Clease in forum Development
    Replies: 0
    Last Post: 30-07-2009, 10:28
  4. Does ThinBasic have a visual-dragDrop-IDE?
    By VernonMarsden in forum thinAir General
    Replies: 3
    Last Post: 30-06-2009, 07:24
  5. Replies: 8
    Last Post: 05-08-2008, 19:12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •