PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Grid column dropbox width specification  (Read 1331 times)

felis.domestica

  • Guest
Grid column dropbox width specification
« on: September 09, 2019, 10:42:18 AM »
hi listmembers,

i am trying to confine the shown width of a drop box list (dropboxhidebtn) used in grid cells of a grid column. I am using PxPlus 2018 (v15.10)



As shown in the attachment the grid is partly visible, with a cell's drop box visible with list items shown in the list not confined to the cell's width. As is visible my options are filled with a 'label', and a right side padded 'id'. Previously (a previous version of PxPlus) these id's were invisible. The choice of the user for a list option could/can easily be translated into an id by clipping the option's text. I would like to only present the label (and keep the id under wraps).
PS: How do PxPlus pro's do this b.t.w.? Translating the label of the chosen option into an id?

Thanks for helping me!
 
« Last Edit: September 09, 2019, 10:49:32 AM by felis.domestica »

Mike King

  • Diamond Member
  • *****
  • Posts: 3818
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Grid column dropbox width specification
« Reply #1 on: September 09, 2019, 11:08:57 AM »
Rather than trying to pad the text to make it not visible you should be using a translation table which has been around for many releases.

If I understand what you are looking for you want to set the value in the cell to some number 169xxx but have it display text.

You can do this by using the 'CellTblWidth and 'CellTbl$ properties which defines a translation table for the cell (width of each entry and values).

Here is a sample program that should help explain these properties:

Code: [Select]
0010 PRINT 'CS',
0020 LET x=10
0030 GRID x,@(10,10,40,10),FMT="[Prouct Planning]20 [Correct]12"
0040 LET x'autosequence=-1
0050 LET x'rowshigh=10
0060 LET x'colno=1,x'row=0 ! Change column 1
0070 LET x'celltype$="dropbox"
0080 LET x'text$="Harvest robot"+SEP+"Handpicked Select"+SEP+"Hytdroponics robot"+SEP
0090 LET x'celltblwidth=6
0100 LET x'celltbl$="169198"+"1682??"+"169???" ! The three values
0110 WHILE 1
0120 OBTAIN (0)'BI',*,'EI'
0130 IF CTL<>x THEN BREAK
0140 GRID READ x,col,row,value$
0150 PRINT "Changed col:",col," row:",row," to '",value$,"'"
0160 WEND
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

felis.domestica

  • Guest
Re: Grid column dropbox width specification
« Reply #2 on: September 10, 2019, 02:42:01 AM »
Dear mister King, thank you kindly again : ), just what i was looking for.