xBrowse Drag Error when Kinetic scrolling is enabled

xBrowse Drag Error when Kinetic scrolling is enabled

Postby anserkk » Fri Oct 30, 2009 10:27 am

I am using FWH 9.08

I have done what Mr.Antonio has suggested to make Kinetic scroll optional, available in this thread viewtopic.php?f=3&t=16905&p=87669#p87669

When I enable oBrw:lKinetic:=.T. an error occurs only when I try to drag a row upwards, but if I drag the row downward it is working fine

Am I doing anything wrong ?

Here is my the error log

    Application
    ===========
    Path and name: D:\Apps\WinAcs\WinAcs.Exe (32 bits)
    Size: 2,712,576 bytes
    Time from start: 0 hours 0 mins 18 secs
    Error occurred at: 30/10/2009, 15:18:36
    Error description: Error DBCMD/2001 Workarea not in use: DBSKIP
    Args:

    Stack Calls
    ===========
    Called from: => DBSKIP(0)
    Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:MOUSEMOVE(3199)
    Called from: => TWINDOW:HANDLEEVENT(0)
    Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1453)
    Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(9921)
    Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
    Called from: => DIALOGBOXINDIRECT(0)
    Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
    Called from: User.Prg => USERRIGHTS(703)
    Called from: WinAcs.Prg => (b)BUILDMENU(635)
    Called from: .\source\classes\MENU.PRG => TMENU:COMMAND(437)
    Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND(1003)
    Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND(243)
    Called from: => TMDIFRAME:HANDLEEVENT(0)
    Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
    Called from: => WINRUN(0)
    Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(952)
    Called from: WinAcs.Prg => MAIN(63)

Here is the code used to Define xBrowse
Code: Select all  Expand view
aMenuOptions:={ {"Add"                     ,.T.},;
                {"Edit"                    ,.T.},;
                {"Delete"                  ,.F.},;
                {"Print"                   ,.T.},;
                {"Show Data on Grid/Browse",.T.},;
                {"Export Data to Excel"    ,.F. } }

@ 0,420 XBROWSE oBrwMenuOptions ;
    COLUMNS 1, 2 ;
    HEADERS "Functionalities", "Status" ;
    OF oDlg ;
    ARRAY aMenuOptions

oBrwMenuOptions:nMarqueeStyle:=MARQSTYLE_HIGHLROWRC
oBrwMenuOptions:aCols[1]:nWidth:=195
oBrwMenuOptions:aCols[2]:nWidth:=50
oBrwMenuOptions:nRowHeight:=20   //17
oBrwMenuOptions:bClrStd := { || oApp:aClrCol[ oBrwMenuOptions:KeyNo % 2 + 1 ] }

// Alternative way to display BMP, if multiple conditions and more than 2 bitmaps are there
oBrwMenuOptions:aCols[2]:AddResource("CheckOn")
oBrwMenuOptions:aCols[2]:AddResource("CheckOff")
oBrwMenuOptions:aCols[2]:bBmpData :={ || iif(oBrwMenuOptions:aArrayData[oBrwMenuOptions:nArrayAt][2],1,2)}
oBrwMenuOptions:aCols[2]:bStrData:={ || NIL }  // Avoid showing .T. .F. in the column

// Change Tick Off/On when Clicked and ensure that this happens only in Column 2
oBrwMenuOptions:bLClicked := { | nRow, nCol | iif(oBrwMenuOptions:nColSel == 2, oBrwMenuOptions:aArrayData[oBrwMenuOptions:nArrayAt][2]:=!oBrwMenuOptions:aArrayData[oBrwMenuOptions:nArrayAt][2] ,NIL),oBrwMenuOptions:Refresh() }

// Enable user to either use Enterkey or Spacebar to change the value in Checkbox
oBrwMenuOptions:bKeyDown= {|nKey| ( oBrwMenuOptions:nColSel:=2 ,;  // else ie Menu items
    if ( nKey  == VK_RETURN .or. nKey == VK_SPACE,;
            (oBrwMenuOptions:aArrayData[oBrwMenuOptions:nArrayAt][2]:=!oBrwMenuOptions:aArrayData[oBrwMenuOptions:nArrayAt][2],oBrwMenuOptions:Refresh()), ) ;
        )  }

oBrwMenuOptions:CreateFromCode()
 

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: xBrowse Drag Error when Kinetic scrolling is enabled

Postby nageswaragunupudi » Fri Oct 30, 2009 2:04 pm

You must be using version 9.08, when Kinetic scrolling was first introduced.
In this version of XBrowse, there is bug in line 3199

Please replace "Skip( -1 )" as "::Skip( -1 )" in line 3199 of XBrowse.Prg ( version 9.08 )

This bug is fixed in version 9.09
Regards

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

Re: xBrowse Drag Error when Kinetic scrolling is enabled

Postby anserkk » Sat Oct 31, 2009 4:29 am

Dear Mr.Rao,

Please replace "Skip( -1 )" as "::Skip( -1 )" in line 3199 of XBrowse.Prg ( version 9.08 )


Thank you. Your solution worked.

May I ask you one more doubt :) .

At present the code oBrw:lKinetic := .T./.F. is making Kinetic scrolling enabled/disabled on all the xBrowse's in the application. What would be the changes required in xBrowse class so that I can have 2 xbrowses in a dialog, one with kinetic scrolling and another one without kinetic scrolling.

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: xBrowse Drag Error when Kinetic scrolling is enabled

Postby nageswaragunupudi » Sat Oct 31, 2009 11:48 am

lKinetic is implemented as CLASSDATA. So it applies to all browses. That is the way it is implemented now.

I am sure FWH can implement what you like to do.
Regards

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

Re: xBrowse Drag Error when Kinetic scrolling is enabled

Postby James Bott » Sat Oct 31, 2009 1:48 pm

Anser,

What would be the changes required in xBrowse class so that I can have 2 xbrowses in a dialog, one with kinetic scrolling and another one without kinetic scrolling.


This may not be a good design. Users will be confused by the browses not working the same way.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: xBrowse Drag Error when Kinetic scrolling is enabled

Postby nageswaragunupudi » Sun Nov 01, 2009 6:28 am

Mr James

>>
This may not be a good design. Users will be confused by the browses not working the same way.
>>

Personally I agree with you and I am for providing a consistent design through out an application.

Still there is no reason, why the library should not offer the flexibility to the programmer. Let the programmer decide what he desires to do with the flexibility.
Last edited by nageswaragunupudi on Sun Nov 01, 2009 6:35 am, edited 1 time in total.
Regards

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

Re: xBrowse Drag Error when Kinetic scrolling is enabled

Postby nageswaragunupudi » Sun Nov 01, 2009 6:34 am

Mr Anser

Your question:
>>
What would be the changes required in xBrowse class so that I can have 2 xbrowses in a dialog, one with kinetic scrolling and another one without kinetic scrolling.
>>

If you like to modify your XBrowse class or have a derived class, this is my suggestion.

In the XBrowse.prg create a new DATA lKineticBrw ( between CLASS TXBrowse and END CLASS)
In both methods New() and Redefine, initialize this DATA to the CLASS DATA lKinetic and use lKineticBrw instead of lKinetic in the MouseMove method.
Code: Select all  Expand view

METHOD New( oWnd )  and also METHOD Redefine
...
...
::lKineticBrw := ::lKinetic
RETURN Self

METHOD MouseMove(..)

// ::lPressed := ::lKinetic   // Instead of this line
   ::lPressed := ::lKineticBrw  // Substitute this line

...

 

Now, if you set .t. or .f. to TXBrowse():lKinetic, this has a global effect.
When you set .t. or .f. to oBrw:lKineticBrw, this overrides the global setting and has effect only on that browse.
Regards

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

Re: xBrowse Drag Error when Kinetic scrolling is enabled

Postby anserkk » Mon Nov 02, 2009 4:59 am

Dear MR.Rao,

Thank you for the help

>>
This may not be a good design. Users will be confused by the browses not working the same way.
>>

Personally I agree with you and I am for providing a consistent design through out an application.

Still there is no reason, why the library should not offer the flexibility to the programmer. Let the programmer decide what he desires to do with the flexibility.


I too insist on consistent design through out an application. But at certain times there may be specific situations to have an exception. As you rightly said "Let the programmer decide what he needs" and would be nice if the library provide that flexibility to the programmer

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 87 guests