LClick with xBrowse

LClick with xBrowse

Postby David Williams » Sun Jul 13, 2014 6: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
User avatar
David Williams
 
Posts: 82
Joined: Fri Mar 03, 2006 6:26 pm
Location: Ireland

Re: LClick with xBrowse

Postby elvira » Sun Jul 13, 2014 6:20 pm

So do i for editing fields !!!
elvira
 
Posts: 515
Joined: Fri Jun 29, 2012 12:49 pm

Re: LClick with xBrowse

Postby David Williams » Sun Jul 13, 2014 8: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
User avatar
David Williams
 
Posts: 82
Joined: Fri Mar 03, 2006 6:26 pm
Location: Ireland

Re: LClick with xBrowse

Postby nageswaragunupudi » Mon Jul 14, 2014 3: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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: LClick with xBrowse

Postby Gale FORd » Mon Jul 14, 2014 2: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.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: LClick with xBrowse

Postby nageswaragunupudi » Mon Jul 14, 2014 2: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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: LClick with xBrowse

Postby Gale FORd » Mon Jul 14, 2014 2: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.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: LClick with xBrowse

Postby David Williams » Wed Jul 16, 2014 6: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:

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
User avatar
David Williams
 
Posts: 82
Joined: Fri Mar 03, 2006 6:26 pm
Location: Ireland


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 101 guests