Gentleman,
Been working on this a couple of hours now and almost cracked it but here is
the scenario:
1. Listbox with multiple items in it
2. Moverbars property set to .T. so you can manually drag an item up or down
the list
Simple so far. We are implementing this on a touch screen and the moverbars are
too small for chunky fingers to accurately navigate to whatever sze you set the
listbox font at - i.e. the moverbars stay the same size.
So I thought, no problem, if I put two buttons outside the list and then feed
the keyboard "{CTRL+UPARROW" ore "CTRL+DNARROW" into the keyboard buffer after
selecting focus to the listbox then I can manually move any item up and down
... this works perfectly ad you can see the selected row moving up or down the
listbox no problem.
Phase 2 SHOULD have been to allow continuous movement of an item in the listbox
by keeping the Up/Down button pressed so I set up a little routine in the
Mousedown event of both the up and down button to sleepfoe 1000 milli seconds
and then send the keystrokes detailed above by a raisevent(This, "Click") and
wralling this in a loop whilst the mouse is pressed. Once again no problem
apart from the line in the listbox is moved but you cannot see it moving
up/down a step at a time. Hence you keep the button pressed and only when you
let go does the item in the listbox appear in the new position.
I have tried resetting focus to the listbox after each keyboard forcing as well
as refreshing the listbox after each forced keystroke but to no avail.
Quite simply I want to see the item moving in the listbox one row at a time
either up or down and not simply when you stop pressing the up/down buttons
outside the listbox, and I can't seem to make it happen despite putting in
sleep/timing loops at various places to slow the movement up so VFP can refresh
the screen more often.
So, in the button "Click" event I have:
* Start of Code
Thisform.List1.SetFocus
keyboard "{CTRL+DNARROW}"
Raiseevent(Thisform.List1, "Refresh")
*
Return
* End of Code
******
And in the button "MouseDown" event I have:
* Start of Code
LPARAMETERS nButton, nShift, nXCoord, nYCoord
declare Sleep in Win32API ;
integer nMilliseconds
nMS=1000
do case
case nButton = 1 && left Button
*
DO WHILE MDOWN()
Sleep(nMS)
Raiseevent(This, "Click")
enddo
*
endcase
*
Return
* End of Code
******
Anyone any ideas?? It seems such a simple exercise to do...
Dave
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.