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

Thread: thinBasic Beta 1.9.8.0

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

    thinBasic Beta 1.9.8.0

    thinBasic Beta 1.9.8.0

    Download from: http://www.thinbasic.biz/projects/th...ic_1.9.8.0.zip


    This is a real Beta in the sense there is a lot of new features all (more or less) to be finished and fully documented.
    So, please use this version only for testing and not for real production scripts.


    Have a look and please report any impression/problem/likes always remembering it is a beta!!!!!



    Fixed some bugs
    Added latest TBGL module from Petr Schreiber
    ...
    List of changes can be found in Help file distributed with the product.

    In this version I introduced a new way to handle Window Events.
    Programmer can Name a Window using new Name "DialogName" option. Window name is used to create specific events callback functions automatically executed by thinBasic UI engine when such an event occurs. Window names is indicated in DIALOG NEW ... statement (see help)

    Here an example:
      uses "UI"
      Uses "console"
           
      Begin ControlID       
        %IDC_TIMER      
        %IDC_LABEL      
        %IDC_Start      
        %IDC_Stop       
      End ControlID
       
      %TIMER_DELAY    = 10     ' Timer delay (in milliseconds, not very accurate below about 100)
    
      Global TimerValue As Double       '---Will be used to calculate timer values
    
      '------------------------------------------------------------------------------
      ' Main function
      '------------------------------------------------------------------------------
      FUNCTION TBMain() as long
        LOCAL hDlg AS DWORD
                
        Dialog New Name "TimerDialog", 0 , "Timer Example using CallBacks functions", -1, -1, 240, 40, %WS_OVERLAPPEDWINDOW  To hDlg
    
        CONTROL ADD BUTTON, hDlg, %IDC_Start, "Start" ,  10, 10, 50, 20
        CONTROL ADD LABEL , hDlg, %IDC_LABEL, ""      ,  90, 10, 55, 20, %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER OR %SS_CENTERIMAGE OR %SS_CENTER
        CONTROL ADD BUTTON, hDlg, %IDC_Stop , "Stop"  , 180, 10, 50, 20
       
        Dialog Show Modal hDlg 'Call MainDialog_OnCallBack        
        
      END FUNCTION
    
     
      '------------------------------------------------------------------------------
      ' OnCallBack
      '------------------------------------------------------------------------------
      CallBack Function TimerDialog_OnCallBack() As Long
        PrintL Timer, Function_Name, CBMSG             
      End Function
    
    
      '------------------------------------------------------------------------------
      ' OnCommand
      '------------------------------------------------------------------------------
      CallBack Function TimerDialog_OnCommand() As Long
        Select Case CBCTL
    
          '---Check which control as fired the event
          Case %IDC_Start
            '---If start, than enable/disable relevant buttons and activate the timer
            Control Disable CBHNDL, %IDC_Start
            Control Enable CBHNDL, %IDC_Stop
    
            TimerValue = 0              '---Set the time counter to zero
            Dialog Set Timer CBHNDL, %IDC_TIMER, %TIMER_DELAY
    
          Case %IDC_Stop
            '---If sstop, than enable/disable relevant buttons and destroy the timer
            Control Disable CBHNDL, %IDC_Stop
            Control Enable CBHNDL, %IDC_Start
            Dialog Kill Timer CBHNDL, %IDC_TIMER
    
        End Select
      End Function
      
      '------------------------------------------------------------------------------
      ' OnInit
      '------------------------------------------------------------------------------
      CallBack Function TimerDialog_OnLoad() As Long
        Control Disable CBHNDL, %IDC_Stop
      End Function
    
      '------------------------------------------------------------------------------
      ' OnTimer
      '------------------------------------------------------------------------------
      CallBack Function TimerDialog_OnTimer() As Long
        '---This event is fired by any timer created on the dialog. We have to check which one
      
          '---CBWPARAM contains the ID of the timer that fired %WM_TIMER event
          '---More than one timer can be active sumultaneously
          Select Case CBWPARAM
            Case %IDC_TIMER
              '---Increment and set the test value...
              TimerValue += 0.01
              Control Set Text CBHNDL, %IDC_LABEL, Format$(TimerValue, "#0.00")
          End Select
      End Function
        
      '------------------------------------------------------------------------------
      ' OnSize
      '------------------------------------------------------------------------------
      CallBack Function TimerDialog_OnSize() As Long
        PrintL Timer, "Sizing", CBWPARAM, CBLPARAM
      End Function
      
      '------------------------------------------------------------------------------
      ' OnMove
      '------------------------------------------------------------------------------
      CallBack Function TimerDialog_OnMove() As Long
        PrintL Timer, "Moving", CBWPARAM, CBLPARAM
      End Function
    
    Looking at the above example ....
    Dialog New Name "TimerDialog", 0 , "Timer Example using CallBacks functions", -1, -1, 240, 40, %WS_OVERLAPPEDWINDOW  To hDlg
    
    Indicates that the dialog is names "TimerDialog", so automatic events callbacks are named TimerDialog followed by the handled event: TimerDialog_OnLoad(), TimerDialog_OnLoad(), ...
    All callbacks, like all Window callbacks, will automatically receive the standard automatic pseudo variables like: CBHNDL, CBMSG, CBWPARAM, CBLPARAM, ...

    So far I've developed the following automatic event functions:
    • Dialog Automatic Event Callback Function added: <DialogName>
      Dialog Automatic Event Callback Function added: <DialogName>_OnCallBack
      The above two functions are the standard callback function for the window and (if one is present) they are used to substitute the callback functions indicated in DIALOG SHOW ...
    • Dialog Automatic Event Callback Function added: <DialogName>_OnNotify
    • Dialog Automatic Event Callback Function added: <DialogName>_OnShow
    • Dialog Automatic Event Callback Function added: <DialogName>_OnSizing
    • Dialog Automatic Event Callback Function added: <DialogName>_OnMoving
    • Dialog Automatic Event Callback Function added: <DialogName>_OnActivate
    • Dialog Automatic Event Callback Function added: <DialogName>_OnDestroy
    • Dialog Automatic Event Callback Function added: <DialogName>_OnSysCommand
    • Dialog Automatic Event Callback Function added: <DialogName>_OnCallBack
    • Dialog Automatic Event Callback Function added: <DialogName>_OnClose
    • Dialog Automatic Event Callback Function added: <DialogName>_OnCommand
    • Dialog Automatic Event Callback Function added: <DialogName>_OnTimer
    • Dialog Automatic Event Callback Function added: <DialogName>_OnLoad
    • Dialog Automatic Event Callback Function added: <DialogName>_OnInit
    • Dialog Automatic Event Callback Function added: <DialogName>_OnMove
    • Dialog Automatic Event Callback Function added: <DialogName>_OnSize


    The above methods can live face to face with the current one so programmer is free to choose if to create a big callback function full of SELECT CASE ... END SELECT messages or add a name to the dialolog and use automatic events handling.
    If this new way will function as expected I will add more Windows events and start to add this new technique to controls too.

    I've also started to change thinBasic tutorial example ( \thinBasic\Tutorial\ ) to adhere to the new way of events handling. So have a look at it too.



    Known bugs:
    among others (I hope not so many) I know there is a bug in this version when creating bundled exe. Some process can sometimes fail due to incorrect TOC inside Exe. I'm working on solving this problem asap.



    Ciao.
    Eros
    Last edited by ErosOlmi; 08-09-2013 at 12:31.
    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

  2. #2
    Thanks Eros for the update.

    Could you please answer to my personal message I sent to you.

    Take care
    Michael

  3. #3
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,525
    Rep Power
    170
    Great. Thanks from here too.

    I like the ability to get fast to a certain elements event/cb-function in codebrowser so this already improves speed a lot when typing - because one does not need additional bookmarks nor notes nor to browse long functions for the right position. This is a cool side-effect and makes using thinAir more fun than it already was.
    You saved all users already countless hours - which they usually would need to find a certain place within a callback - because they're all too lazy to type additional bookmarks...
    I love it to have some built-in overview
    I think there are missing some Forum-sections as beta-testing and support

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    I'm happy about that. I too noticed about how this method could benefit in source reading if dialog names are well chosen.

    I just added few of the main events a window can receive, so feel free to ask for more and I will add.

    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
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,525
    Rep Power
    170
    Some idea what to improve would be about this:

     CallBack Function WinMain_OnSysCommand() As Long 
        
        If (CBWPARAM And &HFFF0) = %SC_CLOSE Then 
    '...
    
    Those comparisons and bin-ops to read out what happened are things that "have no real name" so one does not find it and who does not know this "special treatement" would never come to the idea it has to be done this way...somehow I imagine easier alike:

    CallBack Function WinMain_OnSysCommand() As Long 
        
        Select Case SysCommand
        Case "CLOSE"  
        Case "MINIMIZE"
        
    '...etc
    
    which could eventually end up in:
    CallBack Function WinMain_OnSysCommand_CLOSE() As Long
    
    - anyway - more "important" would be the developement of control-names to me so a functions name can contain the control...
    Last edited by ReneMiner; 08-09-2013 at 13:49.
    I think there are missing some Forum-sections as beta-testing and support

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    First good news this week, great! I like this kind of surprises!


    Petr

    EDIT: The GUI tutorials have still displayed Date Modified: 2009.04.10 - could it be that new tutorial is not yet present? The version I have on my PC does not cover the new way of handling events, is that correct?
    Last edited by Petr Schreiber; 09-09-2013 at 08:11.
    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

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Oops sorry, yes it can be: I've a problem in my setup script. I'm getting tutorial from the wrong directory.

    I will make a new update by this week.

    thanks
    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

    Symantec Endpoint Protection doens't like TB

    Hi Eros,

    I tried to run TB 1.9.8.0 from a memory stick at my job and there the Symantec Ednpoint Protection classified thinbasic.exe as a threat and put it under carantine.
    I can't post a more detailed message as I don't wanna take a chance that our IT department investigates on this.

    Anything you could do around that?

    Cheers
    Michael

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Michael,

    the best is to write directly to Symantec - I did the same for ESET, AVG and Avast, and no issues since then.
    In my experience, the report has higher priority if you are their user.


    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
    My company uses it, not me. I was hoping that I could use TB from a memory stick, but it seems not be possible here at this setup :-/

    I remember having having virus checkers acting up with TB back in the days :-) I think it was when you install it on a module or so.

Page 1 of 2 12 LastLast

Similar Threads

  1. Beta testing thinBasic Beta 1.9.7.0
    By ErosOlmi in forum thinBasic Beta testing
    Replies: 29
    Last Post: 21-02-2015, 01:37
  2. thinBasic Beta 1.9.1.0
    By ErosOlmi in forum thinBasic Beta testing
    Replies: 2
    Last Post: 26-10-2012, 18:31
  3. thinBasic Beta 1.8.8.0
    By ErosOlmi in forum thinBasic Beta testing
    Replies: 14
    Last Post: 25-06-2011, 19:24
  4. thinBasic beta 1.7.10.2
    By ErosOlmi in forum thinBasic Beta testing
    Replies: 3
    Last Post: 17-02-2010, 14:55
  5. thinBasic beta 1.7.10.1
    By ErosOlmi in forum thinBasic Beta testing
    Replies: 11
    Last Post: 08-02-2010, 07:09

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
  •