View Poll Results: Do you like new concise syntax?

Voters
8. You may not vote on this poll
  • Yes

    6 75.00%
  • No

    1 12.50%
  • Do not know

    1 12.50%
Results 1 to 4 of 4

Thread: thinBasic 1.10.5 UI is becoming more easier and more clean (I hope)

Threaded View

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

    thinBasic 1.10.5 UI is becoming more easier and more clean (I hope)

    Another new set of features you will get in next thinBasic 1.10.5 is the ability to specify shorter sentences for creating windows and controls and later, when it's the right time, specify the missing information using a simple <object>.<property> notation. This is possible using the new "Name" option that will allow to give a name to Windows and Controls and use that name to reference to specific windows or controls without the need to know windows handle and control IDs

    Of course remaining 100% compatible with previous notation.
    No need to change anything in your scripts if you do not want.

    A script example and a bundled exe can show you how.
    uses "ui"
    
    
    begin ControlID
      %lbl
      %txt
      %btnClose
      %stBar
      %listbox
      %progressbar
    end ControlID
    
    
    '---Create Window and controls using new shot notations
    '---All the rest of properties can be defined later during window events
    DIALOG New Pixels, Name frmMain, 0, "Window to demonstrate Named Controls"
      control add label     , name lbl      , frmMain.Handle, %lbl      , "This is a label"
      control add textbox   , name txt      , frmMain.Handle, %txt      , "This is a textbox"
      control add Button    , name btnClose , frmMain.Handle, %btnClose , "Close"
      Control Add Statusbar , name stBar    , frmMain.Handle, %stBar    , ""
    
    
    DIALOG SHOW MODAL frmMain.Handle
    
    
    
    
    '--------------------------------------------
    callBack function frmMain_OnCallback() As Long
    '--------------------------------------------
    
    
    end Function
    
    
    '--------------------------------------------
    callBack function frmMain_OnInit() As Long
    '--------------------------------------------
    
    
      long dW, dH
    
    
      '---Define window style
      frmMain.Style = %WS_DLGFRAME | %DS_CENTER | %WS_CAPTION | %WS_SYSMENU | %WS_OVERLAPPEDWINDOW
    
    
      '---Get desktop size
      DESKTOP GET SIZE TO dW, dH
      
      '---Set Window client size
      frmMain.cw = 800
      frmMain.ch = 600
    
    
      '---Set window minimum size
      frmMain.MinSize = 640, 480
      
      '---Center window
      frmMain.x  = (dW - frmMain.cw)/ 2
      frmMain.y  = (dH - frmMain.ch)/ 2
    
    
    end Function
    
    
    '--------------------------------------------
    callBack function frmMain_OnSize() As Long
    '--------------------------------------------
    
    
      '---Set controls locations and size
      lbl.x = 5:      lbl.y =  5:  lbl.w = 200:  lbl.h = 20
      txt.x = 5:      txt.y = 25:  txt.w = 200:  txt.h = 25
    
    
      btnClose.x = frmMain.cw - 110
      btnClose.y = frmMain.ch - 50 - stBar.h
      btnClose.w = 100
      btnClose.h = 40
    
    
    end function
    
    
    '--------------------------------------------
    callback function btnClose_OnClick()
    '--------------------------------------------
    
    
      frmMain.End
      
    end Function
    
    Attached Files Attached Files
    Last edited by ErosOlmi; 30-11-2017 at 00:49.
    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

Similar Threads

  1. Cool and Clean, safe to use?
    By kryton9 in forum Suggestions/Ideas discussions
    Replies: 3
    Last Post: 05-05-2017, 14:01
  2. Computer hope
    By ErosOlmi in forum Shout Box Area
    Replies: 1
    Last Post: 02-07-2010, 14:25
  3. Pirates of the Mediterranean (fixed - I hope)
    By danbaron in forum Shout Box Area
    Replies: 11
    Last Post: 25-06-2010, 01:15
  4. clean(ish) Energy
    By Michael Clease in forum Science
    Replies: 12
    Last Post: 20-10-2008, 19:37

Members who have read this thread: 1

Posting Permissions

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