Pay attention to that FORCE option on DOEVENTS if you want Windows to not 
assume your application has gone unresponsive during some batch process. OTOH 
there can be some significant overhead if you just call it a lot. The strategy 
I've settled on when using DOEVENTS inside some kind of processing loop is to 
wrap it in a IF...ENDIF like:

m.nloop=1
FOR m.nLoop=1 TO 1000
 ....do a bunch of stuff that takes time
 IF MOD(m.nLoop,5)=0
  DOVENTS FORCE
 ENDIF
NEXT

You will want to fine tune your logic about how often you want the DOEVENTS to 
fire.

--

rk
-----Original Message-----
From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Dave Crozier
Sent: Thursday, June 04, 2015 9:40 AM
To: profoxt...@leafe.com
Subject: RE: FW: Programatic moving of items in listbox

Peter,
Not a solution but you set the train of thoughts moving there and liberal 
addition of "doevents" in the code has sorted the problem.

I use doevents that infrequently I thought that it was VFP that was tnot doing 
the refresh as opposed to Windows itself!!

Thanks for the nudge!
Dave


-----Original Message-----
From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of Peter Cushing
Sent: 04 June 2015 14:31
To: profox@leafe.com
Subject: Re: FW: Programatic moving of items in listbox

Hi Dave,

It may be because your are not passing control back to the program so it can do 
the refreshing.  Perhaps you could try moving the item in the listbox only a 
screenful at a time when they have the button pressed, then hand control back 
to the program.  It would then be like a page up/down but they would need to 
press again to move further.

Peter

On 04/06/2015 14:25, Dave Crozier wrote:
> Peter,
> Tried that and no matter how much you delay it makes no difference.
>
> Dave
> -----Original Message-----
> From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of Peter 
> Cushing
> Sent: 04 June 2015 14:16
> To: profox@leafe.com
> Subject: Re: FW: Programatic moving of items in listbox
>
> Hi Dave/Tom,
>
> Have you tried really slowing down to say a second or more to see if you are 
> not giving it enough time to refresh?
>
> Peter
>
> On 03/06/2015 16:08, Tom Dawson wrote:
>> 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 and Tom
>>
>>
>>
>>
>> ---------------------------------------------------------------
>> This communication and the information it contains is intended for the 
>> person or organisation to whom it is addressed. Its contents are 
>> confidential and may be protected in law. If you have received this e-mail 
>> in error you must not copy, distribute or take any action in reliance on it. 
>> Unauthorised use, copying or disclosure of any of it may be unlawful. If you 
>> have received this message in error, please notify us immediately by 
>> telephone or email.
>>
>> Flexipol Packaging Ltd. has taken every reasonable precaution to 
>> minimise the risk of virus transmission through email and therefore any 
>> files sent via e-mail will have been checked for known viruses. However, you 
>> are advised to run your own virus check before opening any attachments 
>> received as Flexipol Packaging Ltd will not in any event accept any 
>> liability whatsoever once an e-mail and/or any attachment is received.
>>
>> It is the responsibility of the recipient to ensure that they have adequate 
>> virus protection.
>>
>> Flexipol Packaging Ltd.
>> Unit 14 Bentwood Road
>> Carrs
>> Industrial Estate
>> Haslingden
>> Rossendale
>> Lancashire
>> BB4 5HH
>>
>> Tel:01706-222792
>> Fax: 01706-224683
>> www.Flexipol.co.uk
>> ---------------------------------------------------------------
>>
>> Terms & Conditions:
>>
>> Notwithstanding delivery and the passing of risk in the goods, the 
>> property in the goods shall not pass to the buyer until the seller 
>> Flexipol Packaging Ltd. ("The Company") has received in cash or 
>> cleared funds payment in full of the price of the goods and all other 
>> goods agreed to be sold by the seller to the buyer for which payment 
>> is then due. Until such time as the property in the goods passes to 
>> the buyer, the buyer shall hold the goods as the seller's fiduciary 
>> agent and bailee and keep the goods separate from those of the buyer 
>> and third parties and properly stored protected and insured and 
>> identified as the seller's property but shall be entitled to resell 
>> or use the goods in the ordinary course of its business. Until such 
>> time as the property in the goods passes to the buyer the seller 
>> shall be entitled at any time
>>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
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/5570530f.1060...@whisperingsmith.com
** 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.
_______________________________________________
Post Messages to: ProFox@leafe.com
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/18725b8cd2d5d247873a2baf401d4ab259749...@ex2010-a-fpl.fpl.LOCAL
** 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.
Report [OT] Abuse: 
http://leafe.com/reportAbuse/18725b8cd2d5d247873a2baf401d4ab259749...@ex2010-a-fpl.fpl.LOCAL
_______________________________________________
Post Messages to: ProFox@leafe.com
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/blupr10mb0451aea76a2a26ee4f3501e3d2...@blupr10mb0451.namprd10.prod.outlook.com
** 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.

Reply via email to