Forum: wxRuby wxDatePickerCtrl

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
89f9acdcbc663e41e45ce590cd746d6e?d=identicon&s=25 Fabio Petrucci (Guest)
on 2008-12-05 22:54
(Received via mailing list)
Ciao Alex,

is there any chance to have wxDatePickerCtrl support in wxRuby?

cheers,

bio.
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2008-12-05 23:02
(Received via mailing list)
Fabio Petrucci 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
89f9acdcbc663e41e45ce590cd746d6e?d=identicon&s=25 Fabio Petrucci (Guest)
on 2008-12-05 23:39
(Received via mailing list)
> Yeah, I can have a look at it; please file a Feature Request to track it.


done!

thank you.
414d54d2f7ee169e9b3677e0229fd8ba?d=identicon&s=25 Rooby Nooby (rustee)
on 2009-02-16 20:07
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 :)
00109e19a784b64f81b483a5dbec690a?d=identicon&s=25 Chauk-Mean Proum (chauk-mean)
on 2009-02-17 09:57
(Received via mailing list)
Hi,

2009/2/16 Rooby Nooby <lists@ruby-forum.com>:
> 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 :)

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


Chauk-Mean.
414d54d2f7ee169e9b3677e0229fd8ba?d=identicon&s=25 Rooby Nooby (rustee)
on 2009-02-17 12:56
> 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?
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2009-02-17 14:17
(Received via mailing list)
Rooby Nooby 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.
414d54d2f7ee169e9b3677e0229fd8ba?d=identicon&s=25 Rooby Nooby (rustee)
on 2009-02-17 14:45
> 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.
414d54d2f7ee169e9b3677e0229fd8ba?d=identicon&s=25 Rooby Nooby (rustee)
on 2009-03-06 14:16
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?
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2009-03-06 16:18
(Received via mailing list)
Rooby Nooby 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
414d54d2f7ee169e9b3677e0229fd8ba?d=identicon&s=25 Rooby Nooby (rustee)
on 2009-03-06 16:26
Success.  Many thanks for your help, and also for recently sorting out
the bug with the Date Picker.
This topic is locked and can not be replied to.