FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xbrowse -Unselect line
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
xbrowse -Unselect line
Posted: Thu Mar 17, 2011 04:12 PM

Hi.

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

Thank you,

Reinaldo.

Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: xbrowse -Unselect line
Posted: 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
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: xbrowse -Unselect line
Posted: Mon Mar 21, 2011 10:39 PM

Other way:

oBrw:nMarqueeStyle := 0

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: xbrowse -Unselect line
Posted: Tue Mar 22, 2011 02: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.

Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: xbrowse -Unselect line
Posted: Tue Mar 22, 2011 03: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
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: xbrowse -Unselect line
Posted: Tue Mar 22, 2011 03: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.

Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: xbrowse -Unselect line
Posted: Tue Mar 22, 2011 04: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xbrowse -Unselect line
Posted: Wed Mar 23, 2011 06: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 (fw): Select all Collapse
ACTIVATE WINDOW/DIALOG ....... ON INIT ( oBrw:aSelected := {}, oBrw:Refresh(), oBrw:SetFocus() )


OR
Code (fw): Select all Collapse
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xbrowse -Unselect line
Posted: Wed Mar 23, 2011 07:33 AM
Modification to XBrowse:

Please locate these three lines in the METHOD Adjust() of XBrowse calss:
Code (fw): Select all Collapse
   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

Continue the discussion