Menu popup in xBrowse

Menu popup in xBrowse

Postby PeterHarmes » Thu Jul 01, 2010 3:40 pm

Hi,

I've just worked out how to reproduce a minor niggle i have when calling a menu popup in an xBrowse that has row selection enabled ( oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS )

Highlight the first record and then press and hold shift

Click on the last record and all rows between the start and end correctly get highlighted

Let go of shift and right click.

The problem is that if the mouse pointer has moved to another column between selecting the last record and pressing the right mouse button, the selected rows deselect themselves.

It would be nice that if you have a bPopup defined, when you right click (no matter where you are in the browse), the popup menu appears and all columns remain selected. Is this possible?

Best regards,

Pete

*Edit*

Just had a look at how excel handles this, if you select a set of rows and right click within the selected area, the popup menu appears with the columns still selected. If you right click out of the selected area, you lose the selection - I think this would be good if xBrowse worked this way - any thoughts?
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Menu popup in xBrowse

Postby nageswaragunupudi » Thu Jul 01, 2010 10:08 pm

Good suggestion.
Wish this improvement is made in the next release.
Regards

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

Re: Menu popup in xBrowse

Postby hag » Fri Jul 02, 2010 4:23 am

Great Idea.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Menu popup in xBrowse

Postby PeterHarmes » Fri Aug 27, 2010 2:06 pm

I've just been playing with the xBrowse source code and I think that by just commenting out line 3505 - ::Select(0) this gives the xbrowse the behaviour we require. - this is for version 10.06 of FW

Could someone check to see if this will cause any problems and maybe if Antonio thinks this is ok, could you include this in the next build?

Best Regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Menu popup in xBrowse

Postby nageswaragunupudi » Fri Aug 27, 2010 3:42 pm

PeterHarmes wrote:I've just been playing with the xBrowse source code and I think that by just commenting out line 3505 - ::Select(0) this gives the xbrowse the behaviour we require. - this is for version 10.06 of FW

Could someone check to see if this will cause any problems and maybe if Antonio thinks this is ok, could you include this in the next build?

Best Regards,

Pete

Not enough. Browse has to decide if the click is on one of the selected row, before deciding whether or not to clear the selection.

Anyway, in the present implementation if we right click without changing row or column, the selection remains and popup works.
Regards

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

Re: Menu popup in xBrowse

Postby nageswaragunupudi » Fri Aug 27, 2010 4:46 pm

Suggested solution:
Replace lines 3511 to 3552 ( version 10.6 ) with the following code.
Code: Select all  Expand view
  elseif nRowPos > 0
      if nRowPos != ::nRowSel
         if ! ::FullPaint()
            ::DrawLine()
         endif
         ::Skip( nRowPos - ::nRowSel )
         ::nRowSel := nRowPos
         if nColPos > 0
            ::nColSel   := nColPos
         endif
         ::Change( .t. )
      elseif nColPos > 0 .and. ::nColSel != nColPos
         ::nColSel := nColPos
         ::Change( .f. )
      endif
      if Len( ::aSelected ) > 0 .and. AScan( ::aSelected, ::BookMark ) == 0
         ::Select( 0 )
         ::Select( 1 )
      endif
      if ::FullPaint()
         ::Super:Refresh( .t. )
      else
         ::DrawLine( .t. )
      endif
      if ::oVScroll != nil
         ::VSetPos( ::KeyNo() )
      endif
      if ::oHScroll != nil
         ::oHScroll:SetPos( ::nColSel )
      endif
      if bPopUp != nil
         Eval( bPopUp, oCol ):Activate( (::nRowSel * ::nRowHeight) + ::nHeaderHeight, oCol:nDisplayCol, Self )
         return 0
      elseif oCol:bRClickData != nil
         return Eval( oCol:bRClickData, nRow, nCol, nKeyFlags, oCol )
      endif
   endif
 

This appears working well for me in my tests. If it is tested and confirmed we may expect this to be included in fwh library
Regards

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

Re: Menu popup in xBrowse

Postby PeterHarmes » Tue Aug 31, 2010 8:46 am

Hi,

Is there any chance that you could email me your amended xbrowse.prg as i think mine may have changed for some reason :?

Could you send it to peterh at plsoft.co.uk?

Once i've recieved it, i will test it out

Thanks

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Menu popup in xBrowse

Postby nageswaragunupudi » Tue Aug 31, 2010 10:27 am

This is now incorporated in FWH 10.8.
Regards

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

Re: Menu popup in xBrowse

Postby PeterHarmes » Tue Aug 31, 2010 10:28 am

Excellent news - going to download this now.

Thanks for your help,

best regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 52 guests