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.
multi select in multi column
Re: multi select in multi column
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.
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.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: multi select in multi column
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.
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

Re: multi select in multi column
as you want to use "fixed" Dimension why not use one XbpMultiCellGroup() ?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.
you will get all those Methode like :cellFromPos() to write you own lbdown / lbDblClick / lbup
for you multiselection in a X-Y Grid.
greetings by OHR
Jimmy
Jimmy
Re: multi select in multi column
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?
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
it is realy easy to use XbpMultiCellGroup() as X / Y Grid, attach Sample from Diego Kerejeta.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?
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
- Attachments
-
- CALENDAR.zip
- XbpMultiCellGroup() Calender Sample
- (4.78 KiB) Downloaded 702 times
greetings by OHR
Jimmy
Jimmy
Re: multi select in multi column
Chris -
Look at the \exp19\samples\browse\multirow.prg sample for a multi cellgroup example.
Roger
Look at the \exp19\samples\browse\multirow.prg sample for a multi cellgroup example.
Roger
The eXpress train is coming - and it has more cars.
Re: multi select in multi column
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.
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.