FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Menu popup in xBrowse
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM

Menu popup in xBrowse

Posted: Thu Jul 01, 2010 03: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?

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: Menu popup in xBrowse

Posted: Thu Jul 01, 2010 10:08 PM

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

Regards



G. N. Rao.

Hyderabad, India
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM

Re: Menu popup in xBrowse

Posted: Fri Jul 02, 2010 04:23 AM

Great Idea.

Thank you

Harvey
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM

Re: Menu popup in xBrowse

Posted: Fri Aug 27, 2010 02: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

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: Menu popup in xBrowse

Posted: Fri Aug 27, 2010 03: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: Menu popup in xBrowse

Posted: Fri Aug 27, 2010 04:46 PM
Suggested solution:
Replace lines 3511 to 3552 ( version 10.6 ) with the following code.
Code (fw): Select all Collapse
   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
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM

Re: Menu popup in xBrowse

Posted: Tue Aug 31, 2010 08: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

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: Menu popup in xBrowse

Posted: Tue Aug 31, 2010 10:27 AM

This is now incorporated in FWH 10.8.

Regards



G. N. Rao.

Hyderabad, India
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM

Re: Menu popup in xBrowse

Posted: Tue Aug 31, 2010 10:28 AM

Excellent news - going to download this now.

Thanks for your help,

best regards,

Pete

Continue the discussion