Menu

#204 Browse GTK Linux, puts three dots in the column unnecessarily

v1.0_(example)
open
nobody
None
1
2025-04-24
2025-04-20
No

Hi!
See screen, three dots is larger than the text to be displayed.
So stop displaying text with only two characters, and show the three dots.

Best regards,
Itamar M. Lins Jr.

2 Attachments

Discussion

  • Wilfried Brunken

    Hello Itamar,
    can you post a sample demonstrating the bug ?

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

     
  • Itamar M. Lins Jr.

    Hi!

    #include "hwgui.ch"
    Function Test()
    Local oDlg, oBrw
    Local aSample := { {"Alex Santos Silva XYZ  ",17,1200,ctod('01/01/2025'),1}, {"Victor Vladimir Soares ABC  ",42,1600,ctod('01/02/2025'),2}, {"John Lennon Bob Marley   ",31,1000,ctod('01/03/2025'),3} }
    
       INIT DIALOG oDlg TITLE "Browse 3 dots";
             AT 0, 0 SIZE 520, 230 ;
             FONT HFont():Add( "Verdana",0,-17 ) 
    
       @ 10,20 BROWSE oBrw ARRAY SIZE 510,140 STYLE WS_BORDER + WS_VSCROLL + WS_HSCROLL ;
             ON SIZE ANCHOR_TOPABS + ANCHOR_LEFTABS + ANCHOR_RIGHTABS + ANCHOR_BOTTOMABS
    
       hwg_CreateArList( oBrw, aSample )
    
       oBrw:aColumns[1]:heading := "Name"
       oBrw:aColumns[2]:heading := "Age"
       oBrw:aColumns[4]:heading := "Date"
       oBrw:aColumns[4]:length:=9
       oBrw:aColumns[2]:lEditable := .T.
       oBrw:aColumns[1]:length:=20
    
       @ 100,180 BUTTON 'Close' SIZE 100,28 ON CLICK {|| oDlg:Close() } ;
             ON SIZE ANCHOR_LEFTABS + ANCHOR_RIGHTABS + ANCHOR_BOTTOMABS
    
       ACTIVATE DIALOG oDlg CENTER
    Return Nil
    

    Example screen with three dots attached.

    Best regards,
    Itamar M. Lins Jr.

     
    • Itamar M. Lins Jr.

      Hi!
      See that if we put "Boby" it doesn't show "Boby" it cuts the "y" and puts 3 dots.
      {"John Lennon Boby Marley ",31,1000,ctod('01/03/2025'),3}

      Best regards,
      Itamar M. Lins Jr.

       
      • Itamar M. Lins Jr.

        Hi!
        And field date, I put:
        oBrw:aColumns[4]:heading := "Date"
        oBrw:aColumns[4]:length:=9 //->date is 8 characters, I put + 1, and Browse GTK cut and put "..."

        Best regards,
        Itamar M. Lins Jr.

         
  • Wilfried Brunken

    Hello,
    see commit r3645,
    please check the solution only for the date,
    i will look for the other bugs the next few days.

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

     
  • Wilfried Brunken

    Hello Itamar,
    this post is also for #203, so i close this ticket.
    Here my description:
    (text added to docu of HBROWSE class)

    Define correct column length:
    If the columns are not wide enough, here some instruction for fixing:
    (.. appears)
    Browsing a database, the length of every column is delivered by the
    structure data.
    For arrays, in the init of browse, the field length is got from the length of the
    header text. So trim the header text with PADR() to the desired length !
    Example:
    @ 10,20 BROWSE oBrw ARRAY SIZE ...
    hwg_CreateArList( oBrw, aSample ) && aSample : array with data
    oBrw:aColumns[1]:heading := PADR("Name",45)
    oBrw:aColumns[2]:heading := PADR("Age",4)

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

     
  • Wilfried Brunken

    Hello Itamar,
    the reported problem of#203 appearing by mouse move seemed also be fixed.
    please check, may i close this ticket ?

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

     
    • Itamar M. Lins Jr.

      Hi!

      It was not resolved.
      Only the date, which I don't know why it was increased from 8 to 10. In my opinion, this is wrong, the GTK module continues to put the three dots on everything. The correct thing to do is not to put three dots. And it continues to overlap the word breaks.
      The problem is not with the size of the date field. But with the behavior of GTK to put three dots and format the text fields. Text fields (get) should not have formatting. Only if we use the PICTURE option or another function of ours.

      There was no change/correction. I could put the LENGHT option with the maximum size in each column of the browse. But this only shows that the user does not have the option of using a smaller width, simply because GTK puts three dots on everything that is smaller than the standard size and breaks words overlapping.

      Best regards,
      Itamar M. Lins Jr.

       

Log in to post a comment.