Page 1 of 1

LClick with xBrowse

PostPosted: Sun Jul 13, 2014 6:10 pm
by David Williams
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

Re: LClick with xBrowse

PostPosted: Sun Jul 13, 2014 6:20 pm
by elvira
So do i for editing fields !!!

Re: LClick with xBrowse

PostPosted: Sun Jul 13, 2014 8:48 pm
by David Williams
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

Re: LClick with xBrowse

PostPosted: Mon Jul 14, 2014 3:39 am
by nageswaragunupudi
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.

Re: LClick with xBrowse

PostPosted: Mon Jul 14, 2014 2:00 pm
by Gale FORd
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.

Re: LClick with xBrowse

PostPosted: Mon Jul 14, 2014 2:07 pm
by nageswaragunupudi
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.

Re: LClick with xBrowse

PostPosted: Mon Jul 14, 2014 2:52 pm
by Gale FORd
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.

Re: LClick with xBrowse

PostPosted: Wed Jul 16, 2014 6:22 pm
by David Williams
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:

Code: Select all  Expand view
 @ 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