Page 1 of 1
multi select in multi column
Posted: Mon Feb 27, 2012 12:40 pm
by skiman
Hi,
I need a quick way to make a multi-select. The different options are in a simple database with about 60 records. I would like to show them in 3 columns of 20 rows. I need a multiselect option, so after validation I receive an array with all the selected options.
I could use a standard browse, but I want to avoid the need of scrolling in the data. It would be better to display all the possible options. If anyone have an idea or sample for this, it would be appreciated.
Re: multi select in multi column
Posted: Mon Feb 27, 2012 1:03 pm
by Tom
Some ideas:
a. Create 20 rows with 3 columns of DCCHECKBOXES, like @ n,m DCCHECKBOX aOption[x,1] prompt aOption[x,2] (aOption is {{.F.,'Option 1'},{.F., 'Option 2'} ... })
b. Create an array browse with 3 columns and add a custom handler which reflects AppKeyState(xbeK_CTRL)=1 and. nEvent = xbeM_LbClick. If so, a logical value is triggered, which forces the browse cells to be shown in a different color (or highlighted in another way, using CustomDrawCell) for "marked cells". If wanted, add AppKeyState(xbeK_SHIFT)=1+xbeM_LbClick for line-/rectangle-highlighting (rectangle-/line-calculation is a little difficult). If you don't want to show standard Windows highlighting features, just use ItemMarked for (de-)highlighting. Toggle an array value if done so. Place a button to close the selection window. Or use ItemSelected, but this may interfere with the cell selection.
c. Create your own control, like a static with textes, boxes and maybe icons on it. A click calculates the item selected (click position), item properties change (like box color or background, text properties a.s.o.). Not a heavy task with GRA and ownerdrawing.
Re: multi select in multi column
Posted: Mon Feb 27, 2012 1:33 pm
by skiman
Hi Tom,
Nice ideas but maybe this will take too much time.
I think I will create 3 browses with 20 records each. If I use multiselect in the browses, I receive 3 arrays with the selections made. I can combine these three to one array.
Faster methods and ideas

are still welcome.
Re: multi select in multi column
Posted: Mon Feb 27, 2012 1:54 pm
by Auge_Ohr
skiman wrote:I think I will create 3 browses with 20 records each. If I use multiselect in the browses, I receive 3 arrays with the selections made. I can combine these three to one array.
as you want to use "fixed" Dimension why not use one XbpMultiCellGroup() ?
you will get all those Methode like :cellFromPos() to write you own lbdown / lbDblClick / lbup
for you multiselection in a X-Y Grid.
Re: multi select in multi column
Posted: Tue Feb 28, 2012 1:49 am
by skiman
Hi Jimmy,
It seems as the multicellgroup is indeed the solution for my problem. It looks as there is no eXPress++ variant of it? Or did I overlooked it?
Re: multi select in multi column
Posted: Tue Feb 28, 2012 2:14 am
by Auge_Ohr
skiman wrote:It seems as the multicellgroup is indeed the solution for my problem. It looks as there is no eXPress++ variant of it? Or did I overlooked it?
it is realy easy to use XbpMultiCellGroup() as X / Y Grid, attach Sample from Diego Kerejeta.
i also wrote a Listview as replacement for XbpMultiCellGroup() to use benefit like Backgound Image.
on Devcon 2012 i want to show those Listview Sample as part of my DXE LIB using native Controls with ot4xb
Re: multi select in multi column
Posted: Wed Feb 29, 2012 9:51 am
by rdonnay
Chris -
Look at the \exp19\samples\browse\multirow.prg sample for a multi cellgroup example.
Roger
Re: multi select in multi column
Posted: Wed Feb 29, 2012 11:32 am
by skiman
Roger,
This seems to be a multiline cell. This is not what I needed. I solved my problem with 4 browses which gives me 4 columns with multiselect.