FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour LClick with xBrowse
Posts: 82
Joined: Fri Mar 03, 2006 06:26 PM
LClick with xBrowse
Posted: Sun Jul 13, 2014 06:10 PM

How can I implement a single click LClick in xBrowse?

I want to convert the use of TCBrowse throughout my applications to xBrowse. My clients are used to just Single Left Clicking to select an item in a listbox.

TIA
David

Posts: 518
Joined: Fri Jun 29, 2012 12:49 PM
Re: LClick with xBrowse
Posted: Sun Jul 13, 2014 06:20 PM

So do i for editing fields !!!

Posts: 82
Joined: Fri Mar 03, 2006 06:26 PM
Re: LClick with xBrowse
Posted: Sun Jul 13, 2014 08:48 PM

Elvira,

Perhaps I didn't explain it properly. For example, On a dialog, I have a field requesting a client number, with a button on the right of the get. If the button is clicked, I show an xBrowse with all clients, together with their addresses etc.. I want to LClick to select a client in the listbox, Not lDblclick. Similar to bLClickHeader, but on a row.

David

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: LClick with xBrowse
Posted: Mon Jul 14, 2014 03:39 AM

In XBrowse, Single click selects a cell now.
Whats more you want? Can you be more clear?

Another point. If existing WBrowse or TCBrowse in an application is working well, why do we need to convert to XBrowse, unless there is some additional facility in XBrowse that we want to use?

FWH will continue to support WBrowse, TCBrowse and XBrowse.

Regards



G. N. Rao.

Hyderabad, India
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: LClick with xBrowse
Posted: Mon Jul 14, 2014 02:00 PM

I think what you want something like:

Local uReturn := ''
..... Build dialog and browse
oBrw:bChange := { || ( uReturn := MyData, oDlg:end()) }
Return uReturn

When the record is selected you can close the window and return the results.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: LClick with xBrowse
Posted: Mon Jul 14, 2014 02:07 PM

You may use something like:
oBrw:bLButtonUp := { || RevVal := <....>, oBrw:oWnd:End() }

Please try, but this may take away the facility of navigating the browse with mouse-click. You can decide.

Regards



G. N. Rao.

Hyderabad, India
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: LClick with xBrowse
Posted: Mon Jul 14, 2014 02:52 PM

The oBrw:bChange option would limit the ability to scroll and position with keyboard before selecting correct record.
Are you sure it would not be better with a combination of double click on the browse and an accept button that is set as default so an enter key can select record.

Posts: 82
Joined: Fri Mar 03, 2006 06:26 PM
Re: LClick with xBrowse
Posted: Wed Jul 16, 2014 06:22 PM

Thanks everyone for your suggestions.

I used Rao's suggestion of bLButtonUp as it emulates the LClick. Thank you Rao. My clients are used to navigating dropdown listboxes using increment seek, mouse wheel, scroll bars or navigation arrows, AND they complain if they have to double click, don't even mention confirming. But, the customer is always right :o

Now they have it all. The get changes with the ON CHANGE and they can left click, double click or press enter on the selected row. This what I used:

 
  @ 0, 0 XBROWSE oBrw ALIAS "Tourops" OF oDlg ;
    FONT oFont ;
    SIZE aSize[1], aSize[2] PIXEL ;
    ON CHANGE (oGet:varput(Tourops->name), oGet:Refresh()) ;
    ON DBLCLICK (oGet:varput(Tourops->name), oGet:Refresh(), oDlg:End(), lReturn := .t.)

  ADD COLUMN TO oBrw HEADER cTitle ;
    DATA trim(Tourops->name)+" "+ ;
      trim(Tourops->address_1)+" "+trim(Tourops->address_2)+" "+ ;
      trim(Tourops->city_town)+" "+trim(Tourops->cnty_state) ;
    SIZE 460 ;
    TAG cTag ;
    ALIGN LEFT

    :bKeyDown := {|nKey| if(nKey == pENTER, ;
                   (oGet:varput(Tourops->name), oGet:Refresh(), oDlg:End(), lReturn := .t.), ;
                   if(nKey == pESC,(oDlg:End(), lReturn := .f.),))}

    :bLButtonUp := { |r,c,f,o| if( o:SelectedCol():lEditable, o:selectedcol():Edit(), ;
                     (oGet:varput(Tourops->name), oGet:Refresh(), oDlg:End(), lReturn := .t.))}

Thanks again

David :D

Continue the discussion