ButtonBar button with odragcursor problems

ButtonBar button with odragcursor problems

Postby nageswaragunupudi » Wed Feb 06, 2008 5:05 pm

If a button in the buttonbar is also used to start drag operation by assigning a value to its data oDragCursor it is noticed that (1) the buttons bAction block is never executed, (2) mouse click on the button has no effect, (3) in case of 2007 style, when mouse is moved over the button, it is painted in orange color but even after mouse leaves the button the orange color stays till the end of the application (4) in case of non-2007 style the button is never hilighted when mouse is moved over the button. Only drag works.

A sample code is given below for testing all the alternatives. For bitmaps any available bmp files may be used.
Code: Select all  Expand view
#include 'fivewin.ch'

function Main()

   local ownd,oBar
   local oBtn1, oBtn2, oBtn3, oBtn4, oBtn5

   DEFINE WINDOW oWnd
   DEFINE BUTTONBAR oBar OF oWnd SIZE 64,64 3D // 2007
   DEFINE BUTTON oBtn1 OF oBar FILE "UP.BMP","DOWN.BMP" TOP PROMPT "1" FLAT ACTION oWnd:Say( 10, 5, "Btn.1" )
   DEFINE BUTTON oBtn2 OF oBar FILE "UP.BMP","DOWN.BMP" TOP PROMPT "2" FLAT ACTION oWnd:Say( 10, 5, "Btn.2" )
   DEFINE BUTTON oBtn3 OF oBar FILE "UP.BMP","DOWN.BMP" TOP PROMPT "3" FLAT ACTION oWnd:Say( 10, 5, "Btn.3" )
   DEFINE BUTTON oBtn4 OF oBar FILE "UP.BMP","DOWN.BMP" TOP PROMPT "4" FLAT ACTION oWnd:Say( 10, 5, "Btn.4" )
   DEFINE BUTTON oBtn5 OF oBar FILE "UP.BMP","DOWN.BMP" TOP PROMPT "Q" FLAT ACTION oWnd:End()

   oBtn3:oDragCursor := TCursor():New(,'DRAG')
   oBtn3:bDragBegin  := { |r,c,f| nil }

   oWnd:bDropOver := { |u,r,c,f| MsgInfo("Dropped") }

   ACTIVATE WINDOW oWnd

return nil

Issues need to be fixed:

1. In 2007 style, the button should be painted active ( orange color ) only when mouse is over the button and the color to be restored to normal when mouse moves away from the button.

2. Non 2007 style: Button should be highlighted ( like other buttons ) when mouse is moved over the button.

3. When mouse is clicked on the button, (a) second bitmap should be painted (b) button should be painted as clicked like other buttons (c) bAction should be executed if drag does not start.
Regards

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

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 94 guests