Results 1 to 2 of 2

Thread: Visual designer generated code - ProgressBar

  1. #1

    Visual designer generated code - ProgressBar

    Hi,


    VD generates this code for a simple window with a progressbar,
    line 96 leads to an error,

    CONTROL SEND hDlg, lID, %PBM_SETRANGE,0,MAKDWR(0,100) would be the correct line.

    File attached :vd-test-progressBar.zip

    '------------------------------------------------------------------------------
    'thinAir Visual Designer
    '------------------------------------------------------------------------------
    ' Project: Visual Designer generated code
    ' File:    Your file name
    ' Created: On 11-02-2018 at 10:07:36
    '------------------------------------------------------------------------------
    
    '---Needed thinBasic modules
    USES "UI"
    
    '---Controls IDs---
    Begin ControlID
    	%IDC_PROGRESSBAR_1
    End ControlID
    
    
    
    '------------------------------------------------------------------------------
    ' Main thinBasic function
    '------------------------------------------------------------------------------
    Function TBMain() As Long
    
    	MainWindow_Create(%HWND_DESKTOP)
    
    End Function
    
    '------------------------------------------------------------------------------
    ' Create main Window
    '------------------------------------------------------------------------------
    Function MainWindow_Create(ByVal hParent As Long) As Long
    
    	Local hDlg     As Long
    	Local hFont    As Long
    	Local lStyle   As Long
    	Local lStyleEx As Long
    	lStyle = _                          
    	        %WS_DLGFRAME          | _   
    	        %WS_CAPTION           | _   
    	        %WS_SYSMENU           | _   
    	        %WS_OVERLAPPEDWINDOW  | _   
    	        %WS_CLIPCHILDREN      | _   
    	        %WS_CLIPSIBLINGS      | _   
    	        %DS_CENTER                  
    	lStyleEx = 0                        
    
    	Dialog New Pixels, hParent, "Form1", -1, -1, 468, 225, lStyle, lStyleEx, TO hDlg
    
    	hFont = Font_Create("MS Sans Serif", 8)
    	Dialog Send hDlg, %WM_SETFONT, hFont, 0
    
    
    
    	CONTROL ADD "MSCTLS_PROGRESS32", hDlg, %IDC_PROGRESSBAR_1, "ProgressBar1", 56, 40, 368, 24, %WS_CHILD OR %WS_CLIPSIBLINGS OR %WS_VISIBLE, 0
    
    	SampleProgress(hDlg, %IDC_PROGRESSBAR_1)
    
    	Dialog Show Modal hDlg, CALL MainWindow_Proc
    
    	Win_DeleteObject hFont
    
    End Function
    
    '------------------------------------------------------------------------------
    ' Main WIndow CallBack handler
    '------------------------------------------------------------------------------
    CallBack Function MainWindow_Proc() As Long
    
    	LOCAL pNMHDR   AS NMHDR PTR
    
    	LOCAL PageNo   AS LONG     
    
    	LOCAL hFontTab AS LONG     
    
    	SELECT CASE (CBMSG)
    
    	    CASE %WM_INITDIALOG
    	    CASE %WM_COMMAND
    	        SELECT CASE LOWRD(CBWPARAM)
    	            CASE %IDOK
    	            CASE %IDCANCEL
    	        END SELECT
    
    	    CASE %WM_NOTIFY
    	    CASE %WM_DESTROY
    	End Select
    End Function
    
    '--------------------------------------------------------------------------------
    ' ** Sample code **
    '--------------------------------------------------------------------------------
    FUNCTION SampleProgress(BYVAL hDlg AS LONG, BYVAL lID AS LONG) AS LONG
    
    	CONTROL SEND hDlg, lID, %PBM_SETBARCOLOR,0,RGB(89,89,171)
    	CONTROL SEND hDlg, lID, %PBM_SETBKCOLOR,0,RGB(205,205,205)
    	CONTROL SEND hDlg, lID, %PBM_SETRANGE,0,MAKDWD(0,100)
    	CONTROL SEND hDlg, lID, %PBM_SETSTEP,30,0
    	CONTROL SEND hDlg, lID, %PBM_STEPIT,0,0
    
    END FUNCTION
    
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Thanks, great catch.
    Fixed, I will release soon a new version.
    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. thinBasic Visual Designer Code Generator
    By ErosOlmi in forum thinBasic vaporware
    Replies: 17
    Last Post: 24-11-2018, 11:17
  2. Is there a thinBASIC Script UI Designer
    By gian20 in forum thinBasic General
    Replies: 2
    Last Post: 09-04-2012, 04:06
  3. Replies: 78
    Last Post: 06-03-2012, 11:58
  4. Firefly Visual designer
    By Michael Clease in forum Development
    Replies: 0
    Last Post: 30-07-2009, 10:28
  5. Replies: 8
    Last Post: 07-03-2009, 00:46

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
  •