Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When for custom Controls
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00596595
Message ID:
00596653
Views:
20
>>>>>>>>>>is this scroll bar ...
>>>>>>>>>>part of a grid? or a combobox ... or what?
>>>>>>>>>
>>>>>>>>>No I've created a custom control with 3 buttons in it and programmed the functionality of a scroll bar (as in record next/previous/top etc).
>>>>>>>>>
>>>>>>>>>Part of my problem is that the user could be trying to do a number of things when they click on my scrollbar and I need to prevent all of them - hence the fact that I want to do the check in the When/GotFocus of the control before the button within performs its code.
>>>>>>>>
>>>>>>>>Note that we have custom scrollbars just the same, but you seem to approach something differently here; I assume the user clicks on a scrollbar button and during MouseDown scrolling is performed ? and not that another click is needed to stop scrolling ?
>>>>>>>
>>>>>>>Thats correct - so when are you checking that its ok for the user to move from the current record?
>>>>>>
>>>>>>So Caroline, could you be some more specific please; f.e. what is your definition of "scrolling" ? Mine would be : we have some gridrow current (it's visible), and by clicking scroll-up, the current record is shifted to above the grid's boundaries, and all further records come by; letting go of the mouse button stops scrolling, and the active record (current record) is not visible.
>>>>>>
>>>>>>Could you explain some further now please ?
>>>>>
>>>>>Thanks for your interest Peter,
>>>>>
>>>>>In essence I am doing the same just not in a grid. I have a standard record entry form that displays 1 record at a time. I have standard navigation buttons top/next/new/save etc. I also have a scrollbar control to perform the same operations, clicking on the right scroll button moves forward 1 record clicking in the scrollbar move forward 10 records etc, they can also drag the current location to quickly jump a certain distance through the file.
>>>>>
>>>>>What I need to be ably to do is as they select the scrollbar stop anything from happening if the current record has not been saved.
>>>>
>>>>Okay (I hope I understand right) :
>>>>
>>>>As soon as any data is changed (in any control, field, record (?), disable the scrollbar buttons, until Save (or explicit cancel ?) is pressed. Is that the idea ? This BTW could be the in InterActiveChange for each control on the form.
>>>
>>>That is the effect that I want, its just that my navigation buttons work the other way ie After a change if the user presses Next they are asked is they want to save (yes/no/cancel) and I was trying to get the scrollbar to do the same.
>>
>>Hmm... It looks like that your scollbarbutton works too much real-time (activate the scrolling immedeately), right ? So that's why you wanten the When on the scrollbarbuttons, still right ?
>>
>>
>>*** SBButtonGotFocus
>>IF lUpdatePending
>>  *** MessageBox ***
>>  *** call SaveRoutine at Yes
>>  *** RestoreFormRoutine at No
>>ENDIF
>>
>>*** Scroll, or maybe better, just return to form at Save=Yes.
>>
>>Now I assume this is not what you want (because it is too obvious). ??
>
>No I think that is what I want but once the control has the focus then the code for the button that they pressed is run even if I change the focus in the GotFocus it doesn't want to do a nodefault.

Grrrrr ...

Maybe you have a container (or some) for this button ? maybe you trigger the clicks of each explicitly ?
Think of my Timer suggestion again. So, in the GotFocus set this timer only when it's applicable, and leave it at 0 when not. This must work.
Thus, the Timer method now performs the scroll code (calls the according method or whatever).
Previous
Reply
Map
View

Click here to load this message in the networking platform