FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
Posted: Wed Sep 07, 2011 04:42 PM
Hi all,

I am using a xBrowse with a .dbf file without an Index...

If I go to the bottom of the database programatically, the browse is shown like this:



I think it should not be that way, because there are more records in the database. Instead it should be like this:



Is there a way to get the xbrowse to go to the bottom programatically and be shown as the second picture???

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: DBGoBottom() with xBrowse
Posted: Wed Sep 07, 2011 04:55 PM
Do not use DbGoBottom()
Instead, call oBrw:GoBottom() in the ON INIT clause of the dialog.

Code (fw): Select all Collapse
#include 'fivewin.ch'
#include 'xbrowse.ch'

function Main()

   local oDlg, oBrw

   USE CUSTOMER

   DEFINE DIALOG oDlg SIZE 600,400 PIXEL
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      AUTOCOLS ALIAS 'CUSTOMER' CELL LINES NOBORDER

   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED ON INIT oBrw:GoBottom()

return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: DBGoBottom() with xBrowse
Posted: Wed Sep 07, 2011 05:27 PM

Thanks Mr Rao, I tried to place that command after creating the browse and that was the reason why it did not work....

By the way, I placed it just after oBrw:CreateFromCode() and worked as well...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: DBGoBottom() with xBrowse
Posted: Wed Sep 07, 2011 05:31 PM

Mr Rao,

Is there a way to have xBrowse to detect the mouse wheel when the pointer is over it, even when it does not have the focus???

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: DBGoBottom() with xBrowse
Posted: Wed Sep 07, 2011 06:11 PM
Bayron wrote:Mr Rao,

Is there a way to have xBrowse to detect the mouse wheel when the pointer is over it, even when it does not have the focus???

Not with any simple code.

Probably other window which has the focus can capture the mouse and check where the mouse is located when the wheel is operated.
Regards



G. N. Rao.

Hyderabad, India
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: DBGoBottom() with xBrowse
Posted: Wed Sep 07, 2011 06:32 PM

Yes I see...

I will investigate this further my self... The easy way is to create a class, but I do't know Class Programming (Just thinking out loud)

Thanks for your help Mr. Rao...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: DBGoBottom() with xBrowse
Posted: Wed Sep 07, 2011 06:56 PM
Got It, thanks to your help.

Code (fw): Select all Collapse
  oDialog:bMouseWheel = { | nKeys, nDelta, nXPos, nYPos | If( nDelta > 0, oBrw:GoUp( WheelScroll() ) , oBrw:GoDown( WheelScroll() ) ) }


This works for the entire window. I will try to condition it to only work when the mouse is over the control, and it will be done.....

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: DBGoBottom() with xBrowse
Posted: Wed Sep 07, 2011 07:19 PM
I have it working half way, but I think I am screwing something in the coordinate conditions...

Code (fw): Select all Collapse
oDialog:bMouseWheel = { | nKeys, nDelta, nXPos, nYPos | ;
   If( nDelta > 0, If( nXPos >= oBrw:nLeft .and. nXPos <= oBrow:nRight , oBrw:GoUp( WheelScroll() ) , ) ,;
   If( nYPos >= oBrw:nTop .and. nYPos <= oBrw:nBottom , oBrw:GoDown( WheelScroll() ) , ) ) }

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: DBGoBottom() with xBrowse
Posted: Wed Sep 07, 2011 07:51 PM
This way it Works:

Code (fw): Select all Collapse
oDialog:bMouseWheel = { | nKeys, nDelta, nXPos, nYPos | If( nXPos >= oBrw:nLeft .and. nXPos <= oBrw:nRight .and.  nYPos >= oBrw:nTop .and. nYPos <= oBrw:nBottom ,;
                          If( nDelta > 0, oBrw:GoUp( WheelScroll() ) , oBrw:GoDown( WheelScroll() ) ) ,  ) }


As we all know:

FiveWin, One line of code and it's done...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Continue the discussion