Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar control changes 1

Status
Not open for further replies.

SitesMasstec

Programmer
Sep 26, 2010
508
Brasil
Hello colleagues!

I put the calendar control in a form:
Calendar1_dixq4r.jpg

I need to do 2 changes in it:

1) I want the first character of the name of the month to be in capital letter (in the case, "Junho")

2) I want to change the "Today" word, at the bottom of the calendar to the Portuguese correspondent "Hoje". Or to clear completely the line at the bottom.

Is it possible using the Properties of the Calendar control?


Thank you,
SitesMasstec
 
As far as I know, you can't do that with the ActiveX DateTime picker that comes with VFP. However, there are several alternative calendar controls that are written entirely using native VFP controls, with source code provided and which you could modify yourself.

One example here:
I see that the images in the above example show a Spanish version of the calendar. If it is possible to translate it into Spanish, it should also be possible to translate it into Portuguese.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
There's more information about the ctl32 control in Doug Hennig's paper: Using ctl32 to Create a More Modern UI (scroll down to the Date Picker section).

If that control doesn't work for you, I'm sure other forum members will be able to recommend some alternatives. (Many of us have written our own date and datetime pickers.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
In the first place, build an EXE and see what language you get when running it then. While the language of ActiveX controls is not determined by the VFP resource DLLs, within the IDE everything is English. It's worth a try whether the ActiveX DateTimePicker control adapts to the OS language when you run it as an EXE. Well, and make sure your OS language is Portuguese.

Chriss
 
Mike: I downloaded the ctl32 files and Doug Hennig paper about ctl32 control, and I will try to use that control.

Chriss: I created the EXE file but the Date picker control continued in English, except for the month name, "Today" doesn't translate into Portuguese ("Hoje").


Thank you,
SitesMasstec
 
Hello colleagues!

Mike: I am enjoyed to share good news with you:

Calendar2_tjpzcp.jpg


I downloaded the ctl32 control and just throwed the ctl32_datepicker class onto a text box intended for the operator entry for a date.


Thank you,
SitesMasstec
 
But I realized a problem: when I click on a date, the date is displayed on the text box but the calendar only closes itself if I click on another text box:
Calendar3_hzxgqu.jpg


Thank you,
SitesMasstec
 
Doug Hennig Whitepaper said:
Fortunately, ctl32 has a better control called ctl32_DatePicker. As you can see in Figure 2, it has a more modern
appearance. Even better, it’s written entirely in VFP so there are no ActiveX issues and source code is included
so you can make any changes you wish.

As it's fully programmed in VFP you have it in your hands to change the behavior. I totally understand why Carlos Alloatti, the developer of ctl_32 actually does not immediately close the dropdown calendar, because that way you can easily correct your choice if you see you mispicked. Its up to you to change it, but it's no error. If clicking on another control works, then likely also just pressing TAB to focus the next control.

Chriss
 
Pretty sure double-click on a date selects the date and closes it.

Tamar
 
I haven't downloaded and tried to reproduce the problem - because I don't see this as a problem.

But if Tamar is right, then you're only clicking too slow. you just caused two Click events but no DblClick event, SitesMasstec. Then this is your only problem.

Anyway, you could still modify the click event to also close the calendar dropdown.

Chriss
 
Yes, as Chriss suggested, I was clicking too slow (two Click events instead of just one DblClick)! Now, with a real DblClick the calendar closes.

In spite of the fact that a final command
Code:
thisform.txtAgente.SetFocus
the focus remains in the date box ("Data Emissão") and doesn't show value in "Dólar Turismo" box, until I click on the "Agente" text box:
Calendar4_av6xip.jpg



Thank you,
SitesMasstec
 
Keep in mind that you can adjust the speed of a double click by varying the _DBLCLICK system variable. At least, you could do that on your own system. It's probably not a good idea to do for your users, as it overrrides their Windows Setting value.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
SitesMasstec said:
the focus remains in the date box ("Data Emissão") and doesn't show value in "Dólar Turismo" box, until I click on the "Agente" text box:

I don't know why you think the focus has to change after the date is picked. Just because you enter something into the focussed control doesn't move focus to the next control, in very general.

And it's totally unclear why the Dólar Turismo control should get a value from having a date. If you set it in the validate or lostfocus of the Data Emissão control, that hasn't happened yet. If you want the Dólar Turismo to change whenever you pick a date, then that change has to happen in the InteractiveChange and the ProgrammaticChange event of the Data Emissão control, ideally in both. Because picking a date from the dropdown section that date is set as the textbox value which causes a ProgrammaticChange event, not an InteractivChange event. And if you edit the date value in the textbox manually without using the dropdown again, say you change the day part only simply by entering other digits, then that causes the InteractiveChange event. So both of these change events would need code to set Dólar Turismo.



Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top