multi select in multi column

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

multi select in multi column

#1 Post 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.
Best regards,

Chris.
www.aboservice.be

User avatar
Tom
Posts: 1172
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: multi select in multi column

#2 Post 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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: multi select in multi column

#3 Post 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 :idea: are still welcome.
Best regards,

Chris.
www.aboservice.be

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: multi select in multi column

#4 Post 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.
greetings by OHR
Jimmy

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: multi select in multi column

#5 Post 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?
Best regards,

Chris.
www.aboservice.be

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: multi select in multi column

#6 Post 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
Attachments
CALENDAR.zip
XbpMultiCellGroup() Calender Sample
(4.78 KiB) Downloaded 595 times
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: multi select in multi column

#7 Post by rdonnay »

Chris -

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.

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: multi select in multi column

#8 Post 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.
Best regards,

Chris.
www.aboservice.be

Post Reply