Re: XRC modify
Indeed. Thank you! On Sat, Oct 2, 2010 at 10:19 PM, herbert breunung deirdre_s...@web.dewrote: $cb-Clear(); $cb-Append($_) for @strings Am 02.10.2010 16:16, schrieb Laslo Forro: I am reading the material from the link, but I still can not find an easy way to change eg. the number of items of the combobox only before rendering it.(Perhaps my bad, but still...) That is I would think it can be modified when it is an xrc source. But that can be modified with any XML:: . I see it not how to extract a $combo object out of my XRC file and do sg. like $combo-Items(@list_of_items). I might be on the wrong track but new to wxWidgets on a broader scale... On Sat, Oct 2, 2010 at 1:53 PM, herbert breunung deirdre_s...@web.de wrote: i already done this 5 years ago :) you can even include DatePicklrCtr even own widgets via XRC foreignhandler or so, just look up the examples of wxcperl.sf. site cheers I think this isn't possible. XRC isn't designe for multible input files or runtime modification. At startup it generate all Object static. Later you can get the object ref over id and findwindow. In this phase is to late for generate/modify new object. XRC is a nice abstraction, but in wxPerl dosn't work sume object i.e. DatePicklrCtr. Regards Pascal -Original Message- From: herbert breunung deirdre_s...@web.de Sender: deirdre_s...@web.de Date: Fri, 01 Oct 2010 23:52:03 To: wxperl-userswxperl-users@perl.org Subject: Re: XRC modify dynamically: change on runtime, under both links is explained how get the widgez from the ID that is written in the XRC and you can use it as any other widget too. Am 01.10.2010 23:35, schrieb Laslo Forro: Thank you, it was fast. Change dynamically - what do you mean ? Thanx again! Laslo On Fri, Oct 1, 2010 at 11:11 PM, herbert breunung deirdre_s...@web.de wrote: i think you could since XRC is as far I know. 100% XML 1.0, but why not change it dynamically if you want to use that xrc and not change it anyway? http://wxperl.pvoice.org/w/index.php/WxPerlTablet#XRC http://www.himmelblauergarten.de/vortraege/XRC.pdf hope it helps Am 01.10.2010 22:50, schrieb Laslo Forro: Hi there, I have an XRC file with a Combobox widget : object class=wxComboBox name=_project_chooser handler event=EVT_COMBOBOX_combo_event/handler stylewxCB_DROPDOWN|wxCB_READONLY/style selection0/selection focused1/focused content itemNew.../item /content /object Can I change the content part adding new items dynamically using some WxXML* module or it it better using some XML module like XML::Twig and feed it to WxXMLResource? I thought of using WxXML* but I have not got enlightenment how to do it. Thanks for the help in advance! Bests Laslo
wxMAC - SetFrontProcess / ForeGround Application
Hi, The changes to Wx that allow use with the standard Perl executable on Mac have caused me a few issues. Using a syntax editor ( I use Komodo but I would guess Padre etc will have the same problems ) is now impossible as any process spawned to check syntax is brought to the front and given focus - taking it away from my editor. A lesser problem is that you also cannot use your Mac for anything else whilst Wx tests are running (or tests for any module that loads Wx). The attached patch moves the foregrounding code to a function and requires application code to do something like: Wx::MacSetFrontProcess() if Wx::wxMAC(); The question is, is it just me that finds this an issue and would everybody else prefer SetFrontProcess to happen automatically as it does in Wx 0.98? Regards Mark Index: Wx.xs === --- Wx.xs (revision 2982) +++ Wx.xs (working copy) @@ -252,11 +252,6 @@ bool Load( bool croak_on_error = false ) CODE: -#if defined(__WXMAC__) -ProcessSerialNumber kCurrentPSN = { 0, kCurrentProcess }; -TransformProcessType( kCurrentPSN, kProcessTransformToForegroundApplication ); -SetFrontProcess( kCurrentPSN ); -#endif wxPerlAppCreated = wxTheApp != NULL; if( wxPerlInitialized ) XSRETURN( true ); @@ -327,7 +322,18 @@ } OUTPUT: RETVAL +#if defined(__WXMAC__) + void +MacSetFrontProcess() + CODE: +ProcessSerialNumber kCurrentPSN = { 0, kCurrentProcess }; +TransformProcessType( kCurrentPSN, kProcessTransformToForegroundApplication ); +SetFrontProcess( kCurrentPSN ); + +#endif + +void SetConstants() CODE: // this is after wxEntryStart, since
Empty Wx::DatePickerCtrl
Hi Guys, I'd like to create an empty DatePickerCtrl which I understand I have to do with wxDefaultDateTime and wxDP_ALLOW_NONE. I see that wxDefaultDateTime is not exported. What is this? Is there some sort of anonymous array or hash I could pass instead of wxDefaultDateTime? Regards Steve Blank Bkgrd.gif
Re: Empty Wx::DatePickerCtrl
Hi, Wx::DateTime-new() will give you a default time - so: my $dpick = Wx::DatePickerCtrl-new( $parent, -1, Wx::DateTime-new(), wxDefaultPosition, wxDefaultSize, wxDP_ALLOWNONE ); Regards Mark On 09/10/2010 00:32, Steve Cookson wrote: Hi Guys, I'd like to create an empty DatePickerCtrl which I understand I have to do with wxDefaultDateTime and wxDP_ALLOW_NONE. I see that wxDefaultDateTime is not exported. What is this? Is there some sort of anonymous array or hash I could pass instead of wxDefaultDateTime? Regards Steve
Re: Empty Wx::DatePickerCtrl
On 9.10.2010 1:54, Mark Dootson wrote: Hi, Wx::DateTime-new() will give you a default time - so: That will give a today's date, not empty one which he wants. I don't knwo whether that is possible? I also ended up using Wx::DateTime-new()
Re: Empty Wx::DatePickerCtrl
Hi, Wx::DateTime-new() gives you the same as wxDefaultDateTime or wxInvalidDateTime, not the current datetime. What happens when you pass this to Wx::DatePickerCtrl is defined in the docs. i.e. Wx::DatePickerCtrl will convert to the current datetime. However, if you pass style wxDP_ALLOWNONE, then Wx::DatePickerCtrl will contain an invalid datetime - which it indicates using an unchecked checkbox. (on mswin at least) If you don't change the date to a valid one by checking the checkbox, then $pickerctrl-GetValue will return an invalid date. As expected, if you uncheck the checkbox again, the picker control will return an invalid date. Unfortunately, $pickerctrl-IsValid is not currently wrapped, but you can test as my $newdate = $pickerctrl-GetValue; my $invalid = Wx::DateTime-new(); if($newdate-IsEqualTo($invalid)) { #my date is invalid } else { #my date is good } You should always check if your datetime values are valid before using them. -FormatDate will appear work to work on the invalid date. You'll probably get 31 December 1969 (the date part of time_t -1) Hope this helps Regards Mark Regards Mark On 09/10/2010 01:07, Jiří Pavlovský wrote: On 9.10.2010 1:54, Mark Dootson wrote: Hi, Wx::DateTime-new() will give you a default time - so: That will give a today's date, not empty one which he wants. I don't knwo whether that is possible? I also ended up using Wx::DateTime-new()
Re: Empty Wx::DatePickerCtrl
Hi, Checked out how this works across wxMSW, wxGTK and wxMAC. The following does what you want on all platforms: my $dpick = Wx::DatePickerCtrl-new( $parent, -1, Wx::DateTime-new(), wxDefaultPosition, wxDefaultSize, wxDP_ALLOWNONE ); my $date = Wx::DateTime-new(); $dpick-SetValue($date); ... ... # get the value my $newdate = $dpick-GetDate; my $invaliddate = Wx::DateTime-new(); my $dateisvalid = ($newdate-IsEqualTo($invalidate)) ? 0 : 1; Using -SetValue after the constructor gets you what you want. Regards Mark