wxDatePickerCtrl


#1

Ciao Alex,

is there any chance to have wxDatePickerCtrl support in wxRuby?

cheers,

bio.


#2

Fabio P. wrote:

is there any chance to have wxDatePickerCtrl support in wxRuby?

Yeah, I can have a look at it; please file a Feature Request to track
it.

I’ve tried adding the class before and ran into problems. But classes
that were previously difficult can often be solved now as the wrappings
generally have improved.

alex


#3

Yeah, I can have a look at it; please file a Feature Request to track it.

done!

thank you.


#4

May I ask if the wxDatePickerCtrl is now supported in the latest wxRuby?

If so how would you obtain a value from it? Many thanks :slight_smile:


#5

Hi,

2009/2/16 Rooby N. removed_email_address@domain.invalid:

May I ask if the wxDatePickerCtrl is now supported in the latest wxRuby?

Yes it is supported.

If so how would you obtain a value from it? Many thanks :slight_smile:

This is documented at
http://wxruby.rubyforge.org/doc/datepickerctrl.html

Chauk-Mean.


#6

Yes it is supported.

Thank you for that, great news.

This is documented at
http://wxruby.rubyforge.org/doc/datepickerctrl.html

Sorry I should have mentioned that I have already looked at this page
and have tried some of the methods but without success, hence my asking
about the widget being supported. Currently, id_datectrl_from.get_value
produces the following:

#SWIG::TYPE_p_wxDateTime:0x7f0fdf7e70c0

Is this what you would expect, and if so, how would you obtain a date
value from it?

One thing mentioned on this page is “It is only available if
USE_DATEPICKCTRL is set to $1$” - how would I go about checking or
implementing this?


#7

No, it’s a bug. Thanks for the report.

Glad to be of help!

It should be easy to fix - the SWIG typemap for wxDateTime that’s
applied to wxDateTime& needs to be applied to wxDateTime. For some
reason wxWidgets has one class return an C++ object and the other a C++
reference.

Er, yes, that’s just what I thought! Anyway I hope it’s easy to fix and
I look forward to being able to use the datepicker shortly.


#8

Rooby N. wrote:

Sorry I should have mentioned that I have already looked at this page
and have tried some of the methods but without success, hence my asking
about the widget being supported. Currently, id_datectrl_from.get_value
produces the following:

#SWIG::TYPE_p_wxDateTime:0x7f0fdf7e70c0

Is this what you would expect, and if so, how would you obtain a date
value from it?

No, it’s a bug. Thanks for the report. It should return a ruby Time
object (as other classes eg CalendarCtrl do). Ufnortunately you won’t be
able to do anything useful with the current return value.

It should be easy to fix - the SWIG typemap for wxDateTime that’s
applied to wxDateTime& needs to be applied to wxDateTime. For some
reason wxWidgets has one class return an C++ object and the other a C++
reference.

One thing mentioned on this page is “It is only available if
USE_DATEPICKCTRL is set to $1$” - how would I go about checking or
implementing this?

Ignore this.


#9

Does anyone know if there is any way to show the date in a
wxDatePickerCtrl in UK date format (dd/mm/yyyy) rather than the default
mm/dd/yyyy?


#10

Rooby N. wrote:

Does anyone know if there is any way to show the date in a
wxDatePickerCtrl in UK date format (dd/mm/yyyy) rather than the default
mm/dd/yyyy?

Try adding this somewhere early in your App.run / App#on_init code:

Wx::App.run do
Wx::Locale.locale = ‘en_GB’

end

a


#11

Success. Many thanks for your help, and also for recently sorting out
the bug with the Date Picker.