FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse - drag - getfocus - error
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
xBrowse - drag - getfocus - error
Posted: Thu Oct 07, 2010 08:16 PM
I have 2 xBrowse on a WINDOW.
If you click inside the left and then in the right xBrowse xBrowse the drag mode starts although you don’t hold down the mouse key.
When the twin browses are on a dialog there is no problem.
But the problem is when the browses are on a window.

Thanks in advance
Otto

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

//#define USEDLG

function main()

   local oWnd, oPanel, oState, oCust, oFont, oCur
   local nWidth

   SetKinetic( .f. )

   DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
   DEFINE CURSOR oCur DRAG

#ifdef USEDLG
   DEFINE DIALOG oWnd SIZE 600,400 PIXEL FONT oFont

   nWidth      := 100
   oPanel      := oWnd
#else
   DEFINE WINDOW oWnd
   oWnd:SetFont( oFont )

   nWidth      := 200
   oPanel      := oWnd
#endif

   USE STATES NEW
   USE CUSTOMER NEW

   @ 10,10 XBROWSE oState SIZE nWidth,-10 PIXEL OF oPanel ;
      COLUMNS 'NAME' ALIAS 'STATES' CELL LINES NOBORDER

   @ 10,nWidth XBROWSE oCust SIZE -10,-10 PIXEL OF oPanel ;
      AUTOCOLS ALIAS 'CUSTOMER' CELL LINES NOBORDER

   WITH OBJECT oCust
      :oDragCursor   := oCur
      :bDragBegin    := { || nil }
      :bGotFocus     := { || nil }
      :lAllowRowSizing  := .f.
   END

   oState:CreateFromCode()
   oCust:CreateFromCode()

#ifdef USEDLG
   ACTIVATE DIALOG oWnd CENTERED
#else
   ACTIVATE WINDOW oWnd MAXIMIZED
#endif

   RELEASE FONT oFont
   RELEASE CURSOR oCur

return nil
//------------------------------------
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse - drag - getfocus - error
Posted: Fri Oct 08, 2010 06:37 AM

I too confirm the problem.
The problem is only when the window is activated in MAXMIZED mode, not when activated normally.

Regards



G. N. Rao.

Hyderabad, India
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: xBrowse - drag - getfocus - error
Posted: Mon Oct 11, 2010 08:52 PM
I began to log control.prg, windows.prg and xbrowse:

This is what I found so fare:
This is when I stay inside the xBrowse and click on different rows:
06.10.2010 12:31:20: LButtonDown xbrowse#####
06.10.2010 12:31:20: -(4)--->><LButtonDown xbrowse##### return Super:LButtonDown
06.10.2010 12:31:20: CONTROL: LButtonDown ::lMouseDown .T. TXBROWSE ::lDrag .F.
06.10.2010 12:31:20: return Super:LButtonDown: CONTROL: LButtonDown ::lMouseDown .T. TXBROWSE ::lDrag .F.
06.10.2010 12:31:20: xbrowse - LButtonUp
06.10.2010 12:31:20: CONTROL - LButtonUp .F.
06.10.2010 12:31:20: bLostFocus TXBROWSE - 4393184 -

06.10.2010 12:34:42: nach bGotFocus TXBROWSE - 4588584 -
06.10.2010 12:34:43: LButtonDown xbrowse#####
06.10.2010 12:34:43: -(5)--->><LButtonDown xbrowse##### return Super:LButtonDown
06.10.2010 12:34:43: CONTROL: LButtonDown ::lMouseDown .T. TXBROWSE ::lDrag .F.
06.10.2010 12:34:43: return Super:LButtonDown: CONTROL: LButtonDown ::lMouseDown .T. TXBROWSE ::lDrag .F.
06.10.2010 12:34:43: xbrowse - LButtonUp
06.10.2010 12:34:43: CONTROL - LButtonUp .F.
06.10.2010 12:34:43: windows - LButtonUp TXBROWSE

Here is when xBrowse gets focus:
lButtonDown is not executed first but then LButtonUp executes LButtonDown – but I don’t understand why


06.10.2010 12:31:19: nach bGotFocus TXBROWSE - 5835110 -
06.10.2010 12:31:19: xbrowse - LButtonUp
06.10.2010 12:31:19: CONTROL - LButtonUp .F.
06.10.2010 12:31:19: windows - LButtonUp TXBROWSE
06.10.2010 12:31:19: -(5)--->><LButtonDown xbrowse##### return Super:LButtonDown
06.10.2010 12:31:19: CONTROL: LButtonDown ::lMouseDown .T. TXBROWSE ::lDrag .F.
06.10.2010 12:31:19: return Super:LButtonDown: CONTROL: LButtonDown ::lMouseDown .T. TXBROWSE ::lDrag .F.
06.10.2010 12:31:19: .T.
06.10.2010 12:31:19: bDragBegin
06.10.2010 12:31:19: .T.
06.10.2010 12:31:19: .T.
06.10.2010 12:31:19: .T.
06.10.2010 12:31:19: .T.
06.10.2010 12:31:19: .T.
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: xBrowse - drag - getfocus - error
Posted: Tue Oct 12, 2010 11:18 PM
Mr. Otto

please comment the SysRefresh in METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TXBrowse

Code (fw): Select all Collapse
 //     SysRefresh()


(just only one)

test this change please
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: xBrowse - drag - getfocus - error
Posted: Wed Oct 13, 2010 12:12 AM
Mr. Otto

please comment the SysRefresh in METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TXBrowse

Code (fw): Select all Collapse
 //     SysRefresh()


(just one)

test this change please
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: xBrowse - drag - getfocus - error
Posted: Wed Oct 13, 2010 04:50 AM

Hallo Daniel,
thank you so much. The problem is solved.
Best regards,
Otto

Continue the discussion