Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Experimenting with an EZGUI Module for ThinBasic

  1. #1

    Experimenting with an EZGUI Module for ThinBasic

    I am currently experimenting with an EZGUI ThinBasic module. So far I am understanding how a module works and it just may be possible to make a module out of an EZGUI runtime.

    I was thinking of making a free version with limited features and possibly a commercial version with more "bells and whistles" afterwards.

    If anyone would be interested in testing the free version once I get it working, please feel free to email me at: support@cwsof.com

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Hi Chris,

    thanks a lot for your effort.
    If you need some info on how to create modules, let me know.



    I'm sorry, I'm not sure there will be commercial market for thinBasic modules but ... who knows: maybe I'm wrong and you will open a new way.

    Ciao
    Eros
    Last edited by ErosOlmi; 11-03-2016 at 08:30.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    One of the reasons I am interested in building a module for ThinBasic is that I want to do some online courses teaching BASIC. I need to have a free basic for those I teach and thinBasic is high up on my list. By creating an EZGUI module to make user interface stuff easier, then thinbasic may be the perfect teaching tool.

    Also I like thinbasic because its syntax is close to PowerBasic.

    As far as a commercial module for thinbasic I can see your point.

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Thank you Chris,

    this is a great news for thinBasic.
    Let me know if you need something or have something to suggest.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    One question I have is how to handle callbacks in ThinBasic modules.

    For example, if I have a function WaitInput which waits for user input, is it possible to generate a callback from the module to thinbasic doe when an event occurs ?

    For example, how do you handle callbacks in your UI module ?

    EZGUI is all about Events, rather than API (dialog) style callbacks, but the principle is the same.

  6. #6
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    It is not the easiest are of thinBasic SDK

    I will post an example this evening or maximum during the week-end.
    I will take the example of a button of current UI module.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Dear Chris,

    here attached an example of a new User Interface control called HoverButton.

    HoverButton creates a new UI class using standard Windows Api RegisterClass to register a new control with its class callback.
    Than control can be used in thinBasic scripts and react to messages.
    IMPORTANT: because thinBasic modules are DLLs, new Windows classes must have %CS_GLOBALCLASS in WNDCLASS.Style otherwise they are not visible by thinBasic Core engine.

    HoverButton control was posted by Kev Peel in PB web site at http://forum.powerbasic.com/forum/us...custom-control

    Attached you will find:
    HoverButton.inc Include file containing HoverButton Class declaration, initialize functions and callback
    thinBasic_UIHoverButton.BAS source code of thinBasic new UIHoverButton Module
    thinBasic_UIHoverButton.dll compiled UIHoverButton module. In order to test it, place it into the same directory of the script or, if you want it available to all scripts, place it into \thinBasic\Lib\ directory
    thinBasic_UIHoverButton.LNX I use Lynx to manage PB Projects. This is Lynx project file for the module
    UIHoverButton_Test.tbasic Test script in thinBasic

    Below the script using new module, so others can see it.
    Hope this can help

    Ciao
    Eros

    '________________________________________________________________________________________'
    ' HoverButton test program
    ' ========================
    '
    ' Simple program testing the HoverButton's module capabilities
    ' Uses standard button messages/notifications for compatibility.
    '________________________________________________________________________________________
    
    
    Uses "UI" 
    Uses "UIHoverButton"
     
    
    
    Begin ControlID
      %IDC_BUTTON1
      %IDC_BUTTON2
      %IDC_BUTTON3
      %IDC_BUTTON4
      %IDC_BUTTON5
      %IDC_BUTTON6
    End ControlID
    
    
      '------------------------------------------------------------------------------
      ' Callback function for main dialog
      '------------------------------------------------------------------------------
      CallBack Function dlgMain() As Long
     
        Select Case CBMSG
     
          Case %WM_COMMAND
            If (CBCTLMSG <> %BN_CLICKED) Then Exit Function
            Select Case CBCTL
        
              Case %IDC_BUTTON1
                MsgBox CBHNDL, "You clicked the first button, this button is marked as default.", "HoverButton", %MB_ICONINFORMATION
              
              Case %IDC_BUTTON2
                  '---This button is a "spin" button with multiple messages on mousedown...
                  Static siAmount As Long
                  Incr siAmount
                  Control Set Text CBHNDL, %IDC_BUTTON2, "Spin #" + Format$(siAmount)
                  Control Redraw CBHNDL, %IDC_BUTTON2
              
              Case %IDC_BUTTON3
                MsgBox CBHNDL, "You checked the third button", "HoverButton", %MB_ICONINFORMATION
              
              Case %IDC_BUTTON4
                  '---Set some random colors for the button...
                  Local ct As DWord, cb As DWord, cf As DWord
                  Randomize Timer
                  ct = Rnd(0, %WHITE)
                  cb = Rnd(0, %WHITE)
                  cf = Rnd(0, %WHITE)
                  Control Send CBHNDL, %IDC_BUTTON4, %HBM_SETCOLORS, ct, cb
                  Control Send CBHNDL, %IDC_BUTTON4, %HBM_SETHOVERCOLORS, -1, cb
                  Control Send CBHNDL, %IDC_BUTTON4, %HBM_SETFOCUSCOLOR, cf, 0
                  Control Redraw CBHNDL, %IDC_BUTTON4
              
              Case %IDC_BUTTON5
                MsgBox CBHNDL, "You clicked the old style (HBS_ORIGINAL) button", "HoverButton", %MB_ICONINFORMATION
              
              Case %IDC_BUTTON6
                MsgBox CBHNDL, "This button is disabled so this message should not be 'fired'", "HoverButton", %MB_ICONINFORMATION
        
            End Select
     
        End Select
       
      End Function
     
    
    
    '------------------------------------------------------------------------------
    ' Program Start Point
    '------------------------------------------------------------------------------
    Function TBMain() As Long
      Local hDlg As DWord
     
     
      Dialog New 0, "HoverButton Test", -1, -1, 210, 100, %DS_MODALFRAME Or %WS_CAPTION Or %WS_POPUP Or %WS_SYSMENU Or %WS_MINIMIZEBOX To hDlg
      Dialog Set Color hDlg, %WHITE, %BLACK
     
      Control Add HoverButton, hDlg, %IDC_BUTTON1, "Click Me!", 10, 10, 80, 20, %HBS_NORMAL Or %HBS_DEFAULT
      Control Send hDlg, %IDC_BUTTON1, %HBM_SETCOLORS, %GREEN, %BLACK
      Control Send hDlg, %IDC_BUTTON1, %HBM_SETHOVERCOLORS, %WHITE, %BLACK
     
      Control Add HoverButton, hDlg, %IDC_BUTTON2, "Hold Down Mouse", 10, 40, 80, 20, %HBS_NORMAL Or %HBS_SPIN
      Control Send hDlg, %IDC_BUTTON2, %HBM_SETCOLORS, %BLUE, %BLACK
      Control Send hDlg, %IDC_BUTTON2, %HBM_SETHOVERCOLORS, %WHITE, %BLACK
     
      Control Add HoverButton, hDlg, %IDC_BUTTON3, "Check Button", 10, 70, 80, 20, %HBS_NORMAL Or %HBS_CHECKBOX
      Control Send hDlg, %IDC_BUTTON3, %HBM_SETCOLORS, %RED, %BLACK
      Control Send hDlg, %IDC_BUTTON3, %HBM_SETHOVERCOLORS, %WHITE, %BLACK
     
      Control Add HoverButton, hDlg, %IDC_BUTTON4, "Change Color", 120, 10, 80, 20, %HBS_NORMAL
      Control Send hDlg, %IDC_BUTTON4, %HBM_SETCOLORS, %GRAY, %BLACK
      Control Send hDlg, %IDC_BUTTON4, %HBM_SETHOVERCOLORS, %WHITE, %BLACK
     
      Control Add HoverButton, hDlg, %IDC_BUTTON5, "Old Style", 120, 40, 80, 20, %HBS_NORMAL Or %HBS_ORIGINAL
     
      Control Add HoverButton, hDlg, %IDC_BUTTON6, "Disabled", 120, 70, 80, 20, %HBS_NORMAL Or %WS_DISABLED
      Control Send hDlg, %IDC_BUTTON6, %HBM_SETCOLORS, %GRAY, %BLACK
     
      Dialog Show Modal hDlg Call dlgMain
     
    End Function
    
    Attached Images Attached Images
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8
    Member
    Join Date
    Nov 2012
    Location
    Missouri, USA
    Posts
    113
    Rep Power
    29
    eros,

    thinBasic_UIHoverButton.BAS source code of thinBasic new UIHoverButton Module
    What BASIC language is this file for? thinBasic uses script tbasic files.

    Bill

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    The module is written in PowerBASIC, it is very efficient low level BASIC compiler we use for developing most parts of thinBASIC.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  10. #10
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Quote Originally Posted by Billbo View Post
    eros,

    What BASIC language is this file for? thinBasic uses script tbasic files.

    Bill
    That BASIC is Power Basic

    thinBasic modules, thinBasic Core, thinAir, thinDebug are all developed using Power Basic compiler for Windows: http://powerbasic.com/pbwin.php

    To my opinion is one of the best 32bit compiler around, regardless of the language itself.
    Its syntax is very very close to thinBasic (well ... the other way round) so if you like thinBasic you will love Power Basic.
    It creates super efficient code both dll and exe. It has OOP but you can program the without.
    Its strings are one of the best string system around: OLE32 strings or BSTR strings. thinBasic has the same string handling.

    Chris Boss is an "old" (in terms of years spent using PowerBasic) PowerBasic user.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Page 1 of 2 12 LastLast

Similar Threads

  1. Would there be an interest in a free EZGUI runtime for ThinBasic ?
    By Chris Boss in forum Suggestions/Ideas discussions
    Replies: 1
    Last Post: 16-01-2015, 01:32
  2. EZGUI - getting nosy...
    By ReneMiner in forum Software discussion
    Replies: 37
    Last Post: 12-09-2013, 16:58
  3. 2D module in/for thinBasic
    By misthema in forum Experimental modules or library interface
    Replies: 6
    Last Post: 23-10-2008, 17:29
  4. thinBasic as a CGI Module?
    By tekrat in forum Shout Box Area
    Replies: 5
    Last Post: 08-01-2008, 02:06
  5. TBGL module and ThinBASIC 1.0.6.4
    By Petr Schreiber in forum TBGL General
    Replies: 0
    Last Post: 06-11-2005, 22:08

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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