Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DatePicker Visual Library
Message
From
22/09/2018 08:07:47
 
 
To
22/09/2018 03:50:35
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01662041
Message ID:
01662204
Views:
52
Walter

>Meanwhile I'll try to get everything into a single PRG so everyone can take out whatever they like.

Great! And it seems to be going quite well, so I'll be looking forward to it.

I understand what you mean, I had to take the opposite path: to recreate the date picker outside of our libraries, and insulating it from any dependencies from our framework. Just on my account, there are now two versions of this: I assume everyone else who might use it will set one of his/her own. I believe this happens with any open source project, especially if involving UI of any kind.

>Hi Antonio
>
>
>>Since you already made your experiments, aren't you willing to fork the project and try this approach by yourself?
>
>Its really difficult for me to commit to something like this as freeing up time is quite a challenge. I'm willing to share the techniques, but what we end up with most likely is a bit different from yours (for example, we need translation through our own framework and the color shemes through what is specified in the commandbars library)
>But I already got something substantial working. See picture attached.
>
>More work to be done, but its not rocket science from here.
>The calendar is a toolbar, but the outer borders are stripped because of its placed in a disabled window.
>
>The implementation is kind of ugly in a sense that I cannot hide the calendar window, but have to move it off screen or else it will lose focus upon activating. I'm trying to find a way around that.
>Meanwhile I'll try to get everything into a single PRG so everyone can take out whatever they like.
>
>
>
>Walter,
>
>
>
>
>>
>>>Hi Antonio,
>>>
>>>I spend an hour or two today on finding a solution, and I think I got one:
>>>
>>>Put your calendar form in a toolbar instead. A toolbar does not get focus so no deactivate of the current form. The date control does not even lose focus while you can click any control in the calendar dropdown.
>>>
>>>The disadvantages are the titlebar and borders of the toolbar being visible.
>>>
>>>That can be solved by having a disabled form displaying the toolbar in that form in such manner that you only display the container and not the ugly borders and titlebar.
>>>You position the disabled form in the same was as you're doing now.
>>>
>>>This can be achieved by old FOX2X commands
>>>
>>>
SHOW WINDOW "Toolbar" IN WINDOW "DisabledForm" 
>>>MOVE WINDOW "Toolbar" TO -1, -3
>>>
>>>
>>>You can use SYSMETRIC(3), SYSMETRIC(4) and SYSMETRIC(34) to calculate the exact position you need to move the toolbar to render the titlebar and borders invisible.
>>>
>>>You can capture the keypresses in the textbox control to control the calendar dropdown easily.
>>>
>>>From the limited testing I did today, This should work.
>>>
>>>Walter,
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>Hi, Walter.
>>>>
>>>>If I'm not overestimating the effort involved, that will require a lot of experiments and, I imagine, banging on the wall or running into dead-ends as well. Did you actually tried it with your production code, and observed the nasty effects you anticipated?
>>>>
>>>>>Hi Antonio,
>>>>>
>>>>>The only solution to this problem as far as I can see is to use a disabled form (enabled = .F.). You then are able to present a GUI on a form without having the parent form losing focus.
>>>>>Then the challenge is to make sure mouseclicks and hovering effects work as expected. I can see that work with timers and the good old ON MOUSE CLICK commands, but there definately will be work involved in that.
>>>>>
>>>>>Walter,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Walter
>>>>>>
>>>>>>When possible, I will have a look into the events chain that the date picker fires, and see if there is some form of lightening the class footprint. Most of our applications are MDI, so we normally don't have anything dramatic on the code of these events (our forms and controls are expected to lose focus at any time), but I admit it may constitute a problem. I'll have a look, and if I find anything useful, and significant, or if anyone else does and shares, it will be incorporated into the code.
>>>>>>
>>>>>>>Hi Antonio,
>>>>>>>
>>>>>>>Thanks for putting in this work into this.
>>>>>>>
>>>>>>>It however does not solve on of the most irritating problems:
>>>>>>>- When opening the calendar, the main form loses focus when you get the calendar up.
>>>>>>>
>>>>>>>This could lead to a cascading number of events (e.g. lostfocus, valid, afterrowcolchange, deactivate) possibly causing issues that are very difficult to track, debug and solve.
>>>>>>>
>>>>>>>
>>>>>>>I've played with the thought to make the calendar build into a toolbar, as that is the only window solution that does not take the focus away from the hosting form and its focussed controls.
>>>>>>>I don't think I ever went through the trouble to do this. Perhaps an Idea you could chew on.
>>>>>>>
>>>>>>>Walter,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Dear All
>>>>>>>>
>>>>>>>>Recent threads asked for the availability of date pickers. I decided to isolate the date picker that is part of my company's base classes, and to prepare it to be easily integrated in other people's projects (once again, thanks, Fernando, for your precious FoxBin2Prg - without it, the transposition process would be a real pain).
>>>>>>>>
>>>>>>>>The date (and time) picker uses the VFPX's CalendarCalc classes, and may be used with other 7-day-a-week calendars (like Jewish, Islamic, and Persian calendars - just to mention the ones that have CalendarCalc classes already set for them). The picker also supports event display, through the events mechanism of the CalendarCalc classes.
>>>>>>>>
>>>>>>>>I looked for short versions of the names of months and days of the week in other calendars, but found none. If anyone more familiar with these calendars is able to give some insight on these short forms (like 'jan' for 'January', or 'fri' for 'Friday'), I would appreciate a lot (I'm not comfortable with the current short names for the above mentioned calendars).
>>>>>>>>
>>>>>>>>The date picker is available at the CalendarCalc website, at https://bitbucket.org/atlopes/calendar/, and hopefully it is sufficiently documented to get anyone started (including an example form).
>>>>>>>>
>>>>>>>>Issues may be addressed directly at Bitbucket, or right here, or anywhere else VFP related.
----------------------------------
António Tavares Lopes
Previous
Reply
Map
View

Click here to load this message in the networking platform