Menu

#52 How to update checkbox parameters ?

v1.0_(example)
closed
nobody
chechbox (1)
1
2022-09-12
2022-08-16
No

Hi,

I have an array initialized with empty values.
I use it to add a chechbox and two buttons.
Here is a part of the code :

if tabAccess[rg,1] == ""
        tabAccess[rg,1]=cprog
        tabAccess[rg,2]=cComment
        tabAccess[rg,3]=lapt
        tabAccess[rg,4]=cdeb
        tabAccess[rg,5]=oRequis:getText()
        tabAccess[rg,6]=csite
        tabAccess[rg,7]=cCommand
        tabAccess[rg,8]=.f.
        tabAccess[rg,9]=oInfo:getText()
        tabAccess[rg,10]="version"
        cobject="oAccess"+ltrim(str(rg))
        celem="tabAccess"+ltrim(str(rg))
        butname="bAccess"+ltrim(str(rg))
        butinfo="bAInfo"+ltrim(str(rg))
        butvers="bAVersion"+ltrim(str(rg))
qout(cobject)   => oAccess1 for example
// &cObject:SetText(::title:=cProg)
        &cObject:refresh()  
        &cObject:show()
        if cSite != ""
                &butname:refresh()
                &butname:show()
         endif
         if trim(oInfo:getText()) != ""
                 &butinfo:refresh()
                 &butinfo:show()
         endif
         exit
endif 

As shown ow to update ell the parameters of the checkbox on the hardcopy, the two buttons are displayed, the checkbox also, but without caption for the last object.
How to update all the parameters (caption, on click, ....)

Thanks
A+

1 Attachments

Discussion

  • Wilfried Brunken

    Hello Alain,
    can you post a standalone sample program demonstrating
    the bug ?

    With regards
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2022-08-17

    Hi Wilfried,

    Here is a test program.

    You can notice that the problem occurs with checkbox caption, but also with buttons tooltip.

    Thanks
    A+

     

    Last edit: Aupeix Alain 2022-08-17
  • Wilfried Brunken

    Hello Alain,
    i can not see with this sample program,
    what the symptom is.
    (See appended screenshot)

    I tested the exe file in your posted archive
    and the myselfcompiled sample
    (The bahavior is identical, Ubuntu 22.04 LTS).

    Need for compile:
    - Copy the include directory from my last
    HWMAKE commit
    - use the appended *.hbp file
    - The added entries in .profile

    With regards
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2022-08-17

    Hi, the screenshot shows that the font is too large.
    Curious, because I haven't this problem.
    Do you test under Windows or Linux ?
    The test is that : * Add a program * Just enter progname, comment, info, site and version. * The content of the field isn't important. * Save * You have now a chechbox without title, and buttons without tooltip. * This is the problem.

    Thanks
    A+

     
  • Wilfried Brunken

    Hello Alain,
    the description was very useful.
    I hope, the solution is OK to you.
    Appended files:
    3 screenshot, the modified prg file, and text file with diff and terminal outputs.

    My recent LINUX installation i tested it :
    Ubuntu 22.04 TLS

    Hint for FONT:

    Function documentation:
    hwg_DefaultFont()

    Returns an object with a suitable default font
    for Windows and LINUX, OS dependent.

    In my app "CLLOG" (https://sourceforge.net/projects/cllog/)
    i forever checked the design on Windows and LINUX
    to set a suitable font.

    With regards
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2022-08-30

    ok for caption, but is there a way to update tooltips of checkbox or button ?

    A+

     
  • Wilfried Brunken

    Hello Alain,
    with commit r3113 i added the methods for your
    request and a test program.

    Please try and give feedback.

    With regards
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2022-09-05

    Hi Wilfried,
    Yes it works

    I have made a test (Test_Checkbox) which combines Test_checkbox and Test_for_check (the problem of creating checkbox in a for ... next boucle).

    Here is this test which can replace the previous ones.

    A+

     

    Last edit: Aupeix Alain 2022-09-06
  • Wilfried Brunken

    Hello Alain,
    i tested the binary in the archive and it seems to be OK.
    Is it OK for you ?
    Can this ticket be closed ?

    With regards
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2022-09-08

    Yes, it can be closed.

    Thanks
    A+

     
  • Alexander S.Kresin

    • status: open --> closed
     

Log in to post a comment.