Results 1 to 3 of 3

Thread: add label bug or my mistake

  1. #1

    add label bug or my mistake

    I'm not sure if there is a bug or I'm just making a mistake. When I run this script nothing shows up in the label.
    [code=thinbasic]
    uses "UI"

    %ID_CURRENT_WORD = 10

    DIM hDlg AS DWORD, hImg AS DWORD, x AS DWORD, Y AS DWORD

    dim Msg, wparam,lparam as dword

    DIALOG NEW 0, "thinBASIC", -1, -1, 280, 240, _
    %WS_DLGFRAME OR _
    %DS_CENTER OR _
    %WS_CAPTION OR _
    %WS_SYSMENU OR _
    %WS_OVERLAPPEDWINDOW, _
    0 TO hDlg

    control add label, hDlg, %ID_CURRENT_WORD, "Some text to display", 7, 150, 255, 25, %SS_ETCHEDFRAME


    DIALOG SHOW modeless hDlg


    while isWindow(hDlg)
    Msg = GetMessage(hDlg, wParam, lParam)

    select case Msg
    CASE %WM_SYSCOMMAND

    SELECT CASE wParam

    CASE %SC_CLOSE
    EXIT WHILE

    END SELECT
    END SELECT

    wend
    DIALOG END hDlg
    [/code]

    I might be making a mistake but if I am I can't find it.

    Thanks
    Sandy

  2. #2
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: add label bug or my mistake

    looks like its something to do with the etchedframe

    [code=thinbasic]control add label, hDlg, %ID_CURRENT_WORD, "", 7, 150, 255, 25, %SS_ETCHEDFRAME
    control add label, hDlg, %ID_CURRENT_WORD+1, "Some text to display", 10, 160, 250, 10 ', %SS_ETCHEDFRAME[/code]

    try the above lines.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

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

    Re: add label bug or my mistake

    Yes, Abraxas is right.

    Seems %SS_ETCHEDFRAME as style alone in reality is like CONTROL ADD FRAME ...
    I've found some other forum spotting the same problem. Example in PowerBasic forum: http://www.powerbasic.com/support/pb...ad.php?t=21815

    A possible solution seems to change in the following way:
    [code=thinbasic]

    uses "UI"

    %ID_CURRENT_WORD = 10

    DIM hDlg AS DWORD, hImg AS DWORD, x AS DWORD, Y AS DWORD

    dim Msg, wparam,lparam as dword

    DIALOG NEW 0, "thinBASIC", -1, -1, 280, 240, _
    %WS_DLGFRAME OR _
    %DS_CENTER OR _
    %WS_CAPTION OR _
    %WS_SYSMENU OR _
    %WS_OVERLAPPEDWINDOW, _
    0 TO hDlg

    CONTROL ADD LABEL, hDlg, %ID_CURRENT_WORD, "Some text to display", 7, 150, 255, 25, _
    %WS_CHILD OR %WS_VISIBLE OR %SS_LEFT, _
    %WS_EX_STATICEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING
    '---Add a frame over the label
    CONTROL ADD LINE , hDlg, -1, "Line1", 7, 150, 255, 25

    CONTROL SET COLOR hDlg, %ID_CURRENT_WORD, %black, -2


    DIALOG SHOW modeless hDlg


    while isWindow(hDlg)
    Msg = GetMessage(hDlg, wParam, lParam)

    select case Msg
    CASE %WM_SYSCOMMAND

    SELECT CASE wParam

    CASE %SC_CLOSE
    EXIT WHILE

    END SELECT
    END SELECT

    wend

    DIALOG END hDlg
    [/code]

    Hope this help
    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

Similar Threads

  1. Probably my mistake, but...
    By mhillmer in forum thinBundle bugs report
    Replies: 5
    Last Post: 12-09-2007, 22:24

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
  •