xbrowse -Unselect line

xbrowse -Unselect line

Postby reinaldocrespo » Thu Mar 17, 2011 4:12 pm

Hi.

Is there a way to open an xbrowsed array with NO record selected?

Thank you,


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: xbrowse -Unselect line

Postby FranciscoA » Mon Mar 21, 2011 10:03 pm

Hi Reynaldo.
If I Understand...

One way to mimic what you ask, is putting the same xBrowse's background color to the selector rod.
Thus, the selector bar is not visible.

(But surely there is a designated register)

Eg:
For xBrowse's White background:
oBrw:bClrStd := {|| { nRGB( 0, 0, 0), nRGB(255,255,255) }}
oBrw:bClrSel := oBrw:bClrStd
oBrw:bClrSelFocus := oBrw:bClrStd

Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: xbrowse -Unselect line

Postby FranciscoA » Mon Mar 21, 2011 10:39 pm

Other way:

oBrw:nMarqueeStyle := 0
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: xbrowse -Unselect line

Postby reinaldocrespo » Tue Mar 22, 2011 2:04 am

Francisco;

Thanks for your reply. If I understand correctly, I'm afraid this won't work. The problem is a bit more complicated. The xbrowse is displayed so that the user may pick multiple lines. They achieve this by clicking on the record while pressing cntrl. But the problem is that the first record is already selected. Unless the users unselects the record, it comes back on the ::aSelection data of the xbrowse. Since upgrading my fwh, my users are not happy about having to Un-select the first record before selecting the ones they really want selected.

So painting the first record on another color, will not remove it from aSelection.

nMarqueestyle =0, will not work, since you can not do multiple selections with value zero on nmarqueestyle.

With Regards,



Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: xbrowse -Unselect line

Postby FranciscoA » Tue Mar 22, 2011 3:02 am

I see now. But users can select the first line they want, by clicking without pressing ctrl, and then to do click on the next record while pressing ctrl. I know ... customer is always right.

On the other hand, I think it's interesting that you post. I'll do some tests, and if I get something positive, I'll let you know.

Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: xbrowse -Unselect line

Postby reinaldocrespo » Tue Mar 22, 2011 3:15 am

Francisco;

Yes. You are correct. The user may click on any other line, and that removes the 1st record from aSelection.

But, most times my users don't want any record selected. My previous xbrowse does NOT autoselects a record when nMarqueeStyle = 5. It makes no sense to auto-select a row when you are showing a multiple-selection xbrowse.


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: xbrowse -Unselect line

Postby FranciscoA » Tue Mar 22, 2011 4:41 am

Reinaldo, test this code, please.

oBrw2:CreateFromResource(181)
oBrw2:SetRDD()

oBrw2:bKeyDown := { |nKey| if(oBrw2:nMarqueeStyle==0,oBrw2:nMarqueeStyle := MARQSTYLE_HIGHLROWMS,) }
...

ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( if(oBrw2:nMarqueeStyle == MARQSTYLE_HIGHLROWMS,; //Multiselect
(oBrw2:aSelected:={},oBrw2:Select(0),oBrw2:nMarqueeStyle:=0),) )

Francisco
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: xbrowse -Unselect line

Postby nageswaragunupudi » Wed Mar 23, 2011 6:26 am

reinaldocrespo wrote:Hi.

Is there a way to open an xbrowsed array with NO record selected?

Thank you,


Reinaldo.

I can think of this workaround for the time being:
Code: Select all  Expand view
ACTIVATE WINDOW/DIALOG ....... ON INIT ( oBrw:aSelected := {}, oBrw:Refresh(), oBrw:SetFocus() )


OR
Code: Select all  Expand view
ON INIT (oBrw:Select( 0 /* or 2 */ ):oBrw:Refresh() )


Can you also please indicate which older version the first record was NOT selected initially? This would help trace changes between the present and the older version. To the best of my knowledge, there was no intentional change in the multi-select behavior but it is possible that there was some change in the code at sometime inadvertantly.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xbrowse -Unselect line

Postby nageswaragunupudi » Wed Mar 23, 2011 7:33 am

Modification to XBrowse:

Please locate these three lines in the METHOD Adjust() of XBrowse calss:
Code: Select all  Expand view
  if ::nMarqueeStyle == MARQSTYLE_HIGHLROWMS
      ::Select(1)
   endif
 

Comment out these three lines.
Then initially no row will be selected.
But were these lines of code not there in the older version?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 80 guests