[rt.cpan.org #114552] Unescaped left brace in regex is illegal in regex

2017-05-20 Thread Mark Dootson via RT
Sat May 20 08:08:57 2017: Request 114552 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: Unescaped left brace in regex is illegal in regex
   Broken in: 0.9928
Severity: (no value)
   Owner: Nobody
  Requestors: sre...@cpan.org
  Status: open
 Ticket https://rt.cpan.org/Ticket/Display.html?id=114552 >


Thanks for the patch. Much appreciated. Did in fact fix this in 0.9929


[rt.cpan.org #115097] libwx-perl: Use of the encoding pragma is deprecated

2017-04-17 Thread Mark Dootson via RT
Mon Apr 17 07:47:43 2017: Request 115097 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: libwx-perl: Use of the encoding pragma is deprecated
   Broken in: 0.9928
Severity: (no value)
   Owner: Nobody
  Requestors: cho...@cpan.org, gre...@cpan.org
  Status: open
 Ticket https://rt.cpan.org/Ticket/Display.html?id=115097 >


Thank you.

Fixed in 0.9931

On Wed Nov 09 22:10:49 2016, CHORNY wrote:
> In perl 5.25.6 this leads to error in tests:
> 1..12
> The encoding pragma is no longer supported at t/18_unicode.t line 8.
> BEGIN failed--compilation aborted at t/18_unicode.t line 8.
> 


[rt.cpan.org #119059]

2017-04-17 Thread Mark Dootson via RT
Mon Apr 17 07:45:44 2017: Request 119059 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: (No subject given)
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: prbre...@cpan.org
  Status: new
 Ticket https://rt.cpan.org/Ticket/Display.html?id=119059 >


Added for 0.9931

On Tue Nov 29 14:33:05 2016, PRBRENAN wrote:
> Wx_Exp.pm does not appear to have entries for:
> 
> enum  wxKeyCode {
>   WXK_NONE = 0,
>   WXK_CONTROL_A = 1, 
> 
> described on page:
> 
> http://docs.wxwidgets.org/3.0/defs_8h.html#a41c4609211685cff198618963ec8f77d
> 
> which makes it difficult to use: wxKeyEvent::GetKeyCode()
> 


[rt.cpan.org #120657] Wx_Exp.pm incomplete due to race/missing dependency in Makefile

2017-04-17 Thread Mark Dootson via RT
Mon Apr 17 07:40:29 2017: Request 120657 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: Wx_Exp.pm incomplete due to race/missing dependency in Makefile
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: stefan.bru...@rwth-aachen.de
  Status: new
 Ticket https://rt.cpan.org/Ticket/Display.html?id=120657 >


Hi,

I added this recently but on reflection I'm not sure it is correct or necessary.

Could you provide a description of your build environment?

Of course, nothing under an xspp folder anywhere is static, all files are 
created by xsubpp.

I'm trying to work out how Wx_Exp.pm generation could happen before compilation 
of 'ext' folder contents.

On Sun Mar 19 13:17:42 2017, stefan.bru...@rwth-aachen.de wrote:
> The generation rule for Wx_Exp.pm in
> build/Wx/build/MakeMaker/Any_OS.pm has:
> 
> $exp : wxt_copy_files wxt_binary_\$(LINKTYPE)
> \t\$(PERL) script/make_exp_list.pl $exp @{[$this-
> >files_with_constants]} xspp/
> *.h ext/*/xspp/*.h
> 
> but the dependency only states:
> 
> my %depend = ( _depend_common( $this ),
>  $exp => join( ' ', $this->files_with_constants, ),
> 
> i.e. it is missing the dependency on xspp/*.h and ext/*/xspp/*.h. The
> former
> is not a problem, as it refers to static files, but everything below
> ext/*/
> xspp/ is generate by xsubpp.
> 
> The effect is a Wx_Exp.pm where symbols from single modules (e.g. IPC
> or AUI)
> are omitted, as make_exp_list.pl runs to early.
> 
> Changing the dependency to:
> $exp => join( ' ', $this->files_with_constants, 'subdirs', ),
> 
> solves the issue for me.


[rt.cpan.org #120139] support wxScrolledWindow::ShowScrollbars for wxWidgets >= 2.9.0

2017-04-17 Thread Mark Dootson via RT
Mon Apr 17 06:55:27 2017: Request 120139 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: support wxScrolledWindow::ShowScrollbars for wxWidgets >= 2.9.0
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: st...@stccg.at
  Status: new
 Ticket https://rt.cpan.org/Ticket/Display.html?id=120139 >


Thanks. Added for 0.9931

On Tue Feb 07 14:36:06 2017, st...@stccg.at wrote:
> hi,
> 
> not sure where else to submit a patch for wxPerl?
> 
> anyway, i just added the missing binding for 
> wxScrolledWindow::ShowScrollbars on my dev system and wanted to share.
> 
> Steven
> 
> ---
> 
> diff --git a/Constant.xs b/Constant.xs
> index dfa80fb..f82c25b 100644
> --- a/Constant.xs
> +++ b/Constant.xs
> @@ -2500,6 +2500,11 @@ static double constant( const char* name, int arg 
> )
>   //r( wxSB_SIZEGRIP );
>   r( wxSB_HORIZONTAL );   // scrollbar
>   r( wxSB_VERTICAL ); // scrollbar
> +#if WXPERL_W_VERSION_GE( 2, 9, 0 )
> +r( wxSHOW_SB_ALWAYS );  // scrolledwindow
> +r( wxSHOW_SB_NEVER );   // scrolledwindow
> +r( wxSHOW_SB_DEFAULT ); // scrolledwindow
> +#endif
>   #if WXPERL_W_VERSION_GE( 2, 5, 3 )
>   r( wxSB_NORMAL );   // statusbar
>   r( wxSB_FLAT ); // statusbar
> diff --git a/XS/ScrolledWindow.xs b/XS/ScrolledWindow.xs
> index 28d0992..d1d7a61 100644
> --- a/XS/ScrolledWindow.xs
> +++ b/XS/ScrolledWindow.xs
> @@ -87,6 +87,15 @@ wxScrolledWindow::EnableScrolling( xScrolling, 
> yScrolling )
>   bool xScrolling
>   bool yScrolling
> 
> +#if WXPERL_W_VERSION_GE( 2, 9, 0 )
> +
> +void
> +wxScrolledWindow::ShowScrollbars( horz, vert )
> +wxScrollbarVisibility horz
> +wxScrollbarVisibility vert
> +
> +#endif
> +
>   void
>   wxScrolledWindow::GetScrollPixelsPerUnit()
> PREINIT:
> diff --git a/typemap b/typemap
> index 5ea1e6b..715f5f5 100644
> --- a/typemap
> +++ b/typemap
> @@ -64,6 +64,7 @@ wxUpdateUIMode  T_ENUM
>   wxWindowVariant T_ENUM
>   wxImageResizeQualityT_ENUM
>   wxAlignment T_ENUM
> +wxScrollbarVisibility   T_ENUM
> 
>   wxFindReplaceDialogStyles T_ENUM
>   wxFindReplaceFlags  T_ENUM


[rt.cpan.org #120933] 0.9928: test hangs on t/14_eh_die.t on Strawberry Perl 5.24.1.1 (64bit) Windows 10

2017-04-17 Thread Mark Dootson via RT
Mon Apr 17 06:53:06 2017: Request 120933 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: 0.9928: test hangs on t/14_eh_die.t on Strawberry Perl 5.24.1.1 
(64bit) Windows 10
   Broken in: 0.9928
Severity: (no value)
   Owner: Nobody
  Requestors: ja...@froebe.net
  Status: open
 Ticket https://rt.cpan.org/Ticket/Display.html?id=120933 >


Fixed in 0.9931 (skip this test for Strawberry ).
If you could confirm and mark ticket resolved.
Thankyou


On Tue Apr 04 13:45:34 2017, ja...@froebe.net wrote:
> Platform:  Strawberry Perl 5.24.1.1 (64bit) Windows 10
> Wx version: 0.9928
> 
> test hangs on t/14_eh_die.t Wx window is shown but it doesn't
> die/close as expected. I ended up killing the process which allowed
> the rest of testing to complete successfully.
> 
> 'No tests defined for Wx::Perl extension.'
> 'No tests defined for Wx extension.'
> "C:\Perl\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-
> MTest::Harness" "-e" "undef *Test::Harness::Switches;
>  test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
> t/01_load.t ... ok
> t/02_inheritance.t  ok
> t/03_event.t .. ok
> t/04_userdata.t ... ok
> t/05_timer.t .. ok
> t/06_loadxpm.t  ok
> t/07_overload.t ... ok
> t/08_ovl_func.t ... ok
> t/09_create_delete.t .. ok
> t/10_oor.t  ok
> t/11_twostage.t ... ok
> t/12_pod.t  skipped: Author tests
> t/13_nbksizer.t ... ok
> t/14_eh_die.t . Dubious, test returned 255 (wstat 65280,
> 0xff00)
> Failed 1/6 subtests
> t/15_threads.t  No such signal: SIGSYS at
> C:/Perl/Strawberry/perl/site/lib/Test2/API/Instance.pm line 312.
> No such signal: SIGSYS at
> C:/Perl/Strawberry/perl/site/lib/Test2/API/Instance.pm line 312.
> t/15_threads.t  ok
> t/16_stream.t . ok
> t/17_thread_evt.t . No such signal: SIGSYS at
> C:/Perl/Strawberry/perl/site/lib/Test2/API/Instance.pm line 312.
> No such signal: SIGSYS at
> C:/Perl/Strawberry/perl/site/lib/Test2/API/Instance.pm line 312.
> t/17_thread_evt.t . ok
> t/18_unicode.t  Use of the encoding pragma is deprecated at
> t/18_unicode.t line 8.
> t/18_unicode.t  ok
> t/19_overlay.t  ok
> t/20_ctx_threads.t  No such signal: SIGSYS at
> C:/Perl/Strawberry/perl/site/lib/Test2/API/Instance.pm line 312.
> No such signal: SIGSYS at
> C:/Perl/Strawberry/perl/site/lib/Test2/API/Instance.pm line 312.
> t/20_ctx_threads.t  ok
> t/21_locale.t . ok
> t/22_interface.t .. ok
> t/zz_distrib.t  skipped: Author tests
> 
> Test Summary Report
> ---
> t/04_userdata.t (Wstat: 0 Tests: 65 Failed: 0)
>   TODO passed:   25, 33, 41, 57
> t/14_eh_die.t   (Wstat: 65280 Tests: 5 Failed: 0)
>   Non-zero exit status: 255
>   Parse errors: Bad plan.  You planned 6 tests but ran 5.
> Files=23, Tests=791, 4085 wallclock secs ( 0.20 usr +  0.08 sys =
> 0.28 CPU)
> Result: FAIL
> Failed 1/23 test programs. 0/791 subtests failed.
> dmake.exe:  Error code 255, while making 'test_dynamic'
>   MDOOTSON/Wx-0.9928.tar.gz
>   C:\Perl\STRAWB~1\c\bin\dmake.exe test -- NOT OK
> //hint// to see the cpan-testers results for installing this module,
> try:
>   reports MDOOTSON/Wx-0.9928.tar.gz
> Stopping: 'install' failed for 'M/MD/MDOOTSON/Wx-0.9928.tar.gz'.
> Failed during this command:
>  MDOOTSON/Wx-0.9928.tar.gz: make_test NO


Maintaining Wx and Alien::wxWidgets

2017-04-05 Thread Mark Dootson

Hi,

If there is anyone on the list who has perhaps contributed code patches 
or work in the past and is interested in taking on maintenance of the 
modules, please contact me. There are no other maintainers who 
contribute code at present.


Regards

Mark


Re: Wxperl.com, net and org domain names

2017-04-05 Thread Mark Dootson

All.

It has been an interesting several years working on Wx. I hope a few of 
you gained benefit from my work.


Johan has been for some time promoting the idea that Wx has been 
abandoned. I'm not sure why. But I'm somewhat tired of it.


Therefore  I now feel that it is time that someone else took over and 
carried Wx forward. Johan I believe has full access to sourceforge and 
therefore can sort out any domain redirection etc. It appears he is in 
control of all the domains now except wxperl.it.

He can simply point all the other domains away from wxperl.it.

That's it from me. All the best for the future and I hope you are able 
to take Wx forward.


Best regards

Mark


On 05/04/2017 18:33, Johan Vromans wrote:

On Tue, 17 Jan 2017 23:08:21 -0500, David Kaufman 
wrote:


And I've set myself a calendar reminder to remember to not forget to
send you the authcodes in March :-)

I assume transfer has taken place.

What to do with wxperl.it and wxperl.nl?
My personal opinion is that it would be best to move all sites and services
to wxperl.org, with .net and .com as alternates.

-- Johan


Re: Wxperl.com, net and org domain names

2017-04-05 Thread Mark Dootson

I'll  maintain wxperl.it as I'm currently maintaining Wx.

On 05/04/2017 18:33, Johan Vromans wrote:

On Tue, 17 Jan 2017 23:08:21 -0500, David Kaufman 
wrote:


And I've set myself a calendar reminder to remember to not forget to
send you the authcodes in March :-)

I assume transfer has taken place.

What to do with wxperl.it and wxperl.nl?
My personal opinion is that it would be best to move all sites and services
to wxperl.org, with .net and .com as alternates.

-- Johan


Re: Compatible versions of wxWidgets

2017-03-25 Thread Mark Dootson

Hi Ron

ext/propgrid/PropertyGrid.c isn't distributed with the Wx source, it is 
created during the build. Looks like you're trying to build multiple 
times in the same source tree without cleaning up. This is probably the 
cause of your original issue.


Regards.

Mark

On 25/03/2017 12:50, Ron Grunwald via wxperl-users wrote:

Hi all,

PropertyGrid.c: In function ‘void 
XS_Wx__ColourProperty_SetPlValue(PerlInterpreter*, CV*)’:
PropertyGrid.c:27130:49: error: call of overloaded 
‘wxVariant(wxColour&)’ is ambiguous

 wxVariant value = wxVariant(*col);


The file "ext/propgrid/PropertyGrid.c" contains many, many references 
to wxVariant. As a simple test I commented out lines 27130 & 27131.

i.e.
 wxVariant value = wxVariant(*col);
 THIS->SetValue(value, NULL, flags );

When I re-executed "make", to my surprise, the source file compiled 
successfully. The above line containing the reference to wxVariant is 
the only line giving a compilation error.


Unfortunately, I don't know C++ very well. But it looks like there is 
some kind of incompatibility between wxVariant and wxColour in the 
above source file.


Cheers,

Ron.

On 18 Mar 2017, at 10:09 pm, Ron Grunwald via wxperl-users 
<wxperl-users@perl.org <mailto:wxperl-users@perl.org>> wrote:


Hello all,

I’ve attempted to build wxPerl (Wx 0.9928) with wxWidgets 3.0.2 under 
ActivePerl 5.24.1 for Linux. All went very well until the compilation 
of PropertyGrid. I’ve included an extract of some of the errors below 
this message.


I think the issue that I’ve struck has already been reported under 
https://rt.cpan.org/Public/Bug/Display.html?id=118284 (Perl-Wx can 
not be built with STL variants of wxWidgets).


I’m rather uncertain how to proceed from here. Would anyone have any 
suggestions? Thank you.


Cheers,

Ron.

 EXTRACT OF COMPILE ERRORS 
g++ -pthread   -c -I. -I.. 
-I/mnt/SeaLion/usr/local/lib/Alien/wxWidgets/gtk_3_0_2_uni/lib/wx/include/gtk3-unicode-3.0 
-I/mnt/SeaLion/usr/local/lib/Alien/wxWidgets/gtk_3_0_2_uni/include/wx-3.0 
 -I. -I. 
-I/mnt/SeaLion/usr/local/lib/Alien/wxWidgets/gtk_3_0_2_uni/lib/wx/include/gtk3-unicode-3.0 
-I/mnt/SeaLion/usr/local/lib/Alien/wxWidgets/gtk_3_0_2_uni/include/wx-3.0 
  -I. -I../.. 
-I/mnt/SeaLion/usr/local/lib/Alien/wxWidgets/gtk_3_0_2_uni/lib/wx/include/gtk3-unicode-3.0 
-I/mnt/SeaLion/usr/local/lib/Alien/wxWidgets/gtk_3_0_2_uni/include/wx-3.0 
 -D_REENTRANT -D_GNU_SOURCE -DUSE_SITECUSTOMIZE 
-DPERL_RELOCATABLE_INCPUSH -fno-merge-constants -fwrapv 
-fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" 
-fPIC "-I/mnt/SeaLion/usr/local/ActivePerl-5.24.1/lib/CORE" 
-DWXPL_EXT -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__   
-D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__-DWXPL_EXT 
-D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__   PropertyGrid.c
PropertyGrid.c: In function ‘void 
XS_Wx__ColourProperty_SetPlValue(PerlInterpreter*, CV*)’:
PropertyGrid.c:27130:49: error: call of overloaded 
‘wxVariant(wxColour&)’ is ambiguous

 wxVariant value = wxVariant(*col);
   ^
PropertyGrid.c:27130:49: note: candidates are:
In file included from ../../cpp/helpers.h:19:0,
 from ../../cpp/wxapi.h:170,
 from PropertyGrid.c:23:
/mnt/SeaLion/usr/local/lib/Alien/wxWidgets/gtk_3_0_2_uni/include/wx-3.0/wx/variant.h:283:5: 
note: wxVariant::wxVariant(void*, const wxString&) 

 wxVariant(void* ptr, const wxString& name = wxEmptyString);
 ^
/mnt/SeaLion/usr/local/lib/Alien/wxWidgets/gtk_3_0_2_uni/include/wx-3.0/wx/variant.h:283:5: 
note:   no known conversion for argument 1 from ‘wxColour’ to ‘void*’
/mnt/SeaLion/usr/local/lib/Alien/wxWidgets/gtk_3_0_2_uni/include/wx-3.0/wx/variant.h:256:5: 
note: wxVariant::wxVariant(wchar_t, const wxString&) 

 wxVariant(wchar_t val, const wxString& name = wxEmptyString);
 ^


Ron Grunwald
ron...@yahoo.com.au <mailto:ron...@yahoo.com.au>
http://www.dvlcorner.org <http://www.dvlcorner.org/>

On 26 Feb 2017, at 10:07 pm, Ron Grunwald via wxperl-users 
<wxperl-users@perl.org <mailto:wxperl-users@perl.org>> wrote:


Hello all,

This is really useful information - thank you. Would it be possible 
to update the FAQ on the wxPerl wiki?


Cheers,
Ron.

On 25 Feb 2017, at 12:43 am, bubnikv . <bubn...@gmail.com 
<mailto:bubn...@gmail.com>> wrote:


I am using 3.0.3-beta1 on Windows / Linux / OSX, as it support some 
new flags for instantiating an OpenGL widget, namely it supports 
anti-aliasing. 3.1 introduced many changes in the definition of the 
base classes (ints replaced by enums and such), which broke the 
Perl bindings.


Vojtech


On Fri, Feb 24, 2017 at 5:35 PM, Mark Dootson 
<mark.doot...@znix.com <mailto:mark.doot..

Re: Compatible versions of wxWidgets

2017-02-24 Thread Mark Dootson

Hi,

No, wiki is out of date. Current stable release of wxWidgets is 3.0.2.

On 24/02/2017 14:31, Ron Grunwald via wxperl-users wrote:

Hello all,

The FAQ on the wxPerl wiki (http://wiki.wxperl.nl/index.php?title=FAQ) 
states that the current stable release of wxWidgets to use with wxPerl 
is 2.8.12. Is this still the case given that the latest release of 
wxWidgets is 3.1.0?


Cheers,
Ron.

Ron Grunwald
ron...@yahoo.com.au 
http://www.dvlcorner.org







Re: wxPerl crashes on Windows when installed into a localized path

2017-02-16 Thread Mark Dootson

Hi,

I think you can fix it for Wx at least by expanding the BEGIN block at 
the top of slicr3.pl to include the following.
In the Wx case, the loading fails because you cannot add a wide 
character string to $ENV{PATH}.
The snippet assumes you are actually using 'msw_3_0_2_uni_gcc_3_4' 
flavour of wxWidgets.

I'll fix the issue for Wx in the next release.

BEGIN {
use FindBin;
use lib "$FindBin::Bin/lib";

package Wx;

our $wx_path;
foreach ( @INC ) {
if( -d "$_/Alien/wxWidgets/msw_3_0_2_uni_gcc_3_4" ) {
  $wx_path = "$_/Alien/wxWidgets/msw_3_0_2_uni_gcc_3_4/lib";
  last;
}
}

if( $wx_path && $^O =~ /mswin/i ) {
   require Win32;
   $wx_path = Win32::GetShortPathName( $wx_path );
}
}

package main;







On 16/02/2017 17:20, bubnikv . wrote:


It seems the perl itself is broken and the core perl dynaloader fails 
to work, if the perl was started with long names. For example, running 
slic3r with the following slic3r.bat fails:


"%~dp0\perl5.24.0.exe" "%~dp0\slic3r.pl " %*

It works though, if one replaces the magic %~dp0 with %~dps0:

"%~dps0\perl5.24.0.exe" "%~dps0\slic3r.pl " %*

That way both the paths of the perl.exe and slic3r.pl 
 use the 8.3 characters only per directory entry.



For the reference, this is the original github issue:

https://github.com/prusa3d/Slic3r/issues/133


I think this may be interesting to some, but it seems not to be a 
wxPerl issue per se, so I think I will stop rumbling about it here :-)



On Thu, Feb 16, 2017 at 4:55 PM, bubnikv . > wrote:


I analyzed the crash further. It is sufficient to load any of the
following modules to get perl crashing, when the perl is installed
in a folder with local characters:

use Wx::DND;
use Wx::GLCanvas;
use Wx::GLCanvas qw(:all);
use Wx::Grid;
use Wx::Html;
use Wx::Print;


On Thu, Feb 16, 2017 at 2:42 PM, bubnikv . > wrote:

Hello.

I am supporting and ehancing a fork of Slic3r, one of the main
applications for fused filamet 3D printing.
http://slic3r.org/
https://github.com/prusa3d/Slic3r/releases


It is likely one of the largest wxPerl applications, combining
perl, wxWidgets and a lot of custom C++ code.

Our customers have currently issues running Slic3r on Windows,
when installed into a path with localized characters, for
example Russian. This often happens if one installs Slic3r
into his home directory.

I verified that wxPerl outright crashes, when installed into a
localized directory on Windows 10 64bit and Strawberry Perl
5.24.0, tested with wxdemo.

Is there a chance that this will be looked into by someone,
please? Or has been wxPerl abandoned and I am left to provide
a fix myself?

Thanks,
Vojtech







Re: NewFromPNGData

2016-03-24 Thread Mark Dootson


Not anywhere I can test this at the moment but as I recall:

open my $fh, '<', \$buffer;

my $bitmap = Wx::Bitmap->new(
Wx::Image->new( $fh, wxBITMAP_TYPE_PNG)
);



On 24/03/2016 10:44, James Lynes wrote:

Hello All:

It seems that Wx::Bitmap NewFromPNGData is not wrapped(didn't see any 
reference to it in bitmap.xs).


wxWidgets defines it as:

public:
// Create a new wxBitmap from the PNG data in the given buffer
static wxBitmap NewFromPNGData(const void* data, size_t size);

What's involved in getting this wrapped?

Thanks,
James






Wx 0.9928 Released

2015-12-20 Thread Mark Dootson

Hi,

Wx 0.9928  has been released to CPAN.

This fixes a Wx::Timer memory leak.

Regards

Mark



Re: Wx::Perl seems to be leaking memory

2015-05-21 Thread Mark Dootson

Hi Steve,

$app-Yield does not cause 'idle time' to happen - so 'Destroyed' 
objects are not cleaned up during that call. As you have seen, on 
multiple calls the total number of SVs does not increase so no memeroy 
leak there.


However, in constructing an example to demonstrate this I think I may 
have found the cause of your issues.


Every Wx::Timer event or call to an overridden 'Notify' method leaks 1 
SV. I don't have a solution but will work on it over the weekend.


Regards

Mark


On 21/05/2015 11:54, Steve Cookson wrote:

Hmm..,

On 20/05/15 17:49, Steve Cookson - gmail wrote:
If I create a few controls in a dialog, delete the dialog, use 
$app-Yield for the background processing to take place, I still end 
up with more Perl objects after the deletion than before. 


Well actually, although the count builds up for the first two calls.  
After the third call, although it says it's loosing 5 pointers per 
call, it is not, because the total number of pointers remains the 
same.  So I suppose that is OK.


I have switched off my background processing using Wx::Timer and all 
my memory creep stops.  So unless you think the 5 pointers matter (and 
maybe it doesn't), I'm going to switch to looking at the Wx::Timer 
background code as potentially a more productive avenue.


Thanks

Steve.




Re: Wx::Perl seems to be leaking memory

2015-05-11 Thread Mark Dootson

Hi,

See 
http://docs.wxwidgets.org/3.0/classwx_window.html#a6bf0c5be864544d9ce0560087667b7fc


details for wxWindow::Destroy.

As you have determined, top level windows you create need to be 
destroyed with $win-Destroy;


The C++ structure for a Wx::Frame contains a reference to the associated 
Perl SV. So that SV won't go away until the C++ structure is deleted - 
which will never happen until your event loop is running.


Hope this helps.

Mark


On 11/05/2015 14:32, Steve Cookson wrote:

Hi Guys,

I started to talk about this on Perl Monks, you may have seen it here:

http://www.perlmonks.org/?node_id=1125580

An anonymous monk posted some code that showed just about every call 
to Wx leaking a scalar or two.  I've played about with the posted code 
and there is a copy attached to this email.


The main part of the code, here:

$count1 =  Devel::Leak::NoteSV($handle);
for(1..100){
my $f=Wx::Frame-new( undef ,-1,goner );
my $p=Wx::Panel-new (undef ,-1 );
#my $b=Wx::Button-new ( $f ,-1 );
#my $t=Wx::TextCtrl-new($f, -1, );
#$t-Destroy;
#$b-Destroy;
#$i-Destroy;
$p-Destroy;
$f-Destroy;
}

$count2 =  Devel::Leak::CheckSV($handle);

seems to show that if you do not -Destroy a Wx object, it will not go 
out of scope naturally and even if you do destroy a Wx::Frame object, 
it will not go out of scope.  The monk also tried Weaken and undef, 
with the same results.


Please have a look at this and make sure that I have not (or the 
Anonymous Monk has not), made some fundamental error.


I have checked it both in 2.8.11 and 3.0.2 with the same results.

I look forward to hearing your feedback,

Regards

Steve.




Re: Wx::Perl seems to be leaking memory

2015-05-11 Thread Mark Dootson

Hi,

A top level window is a Wx::Frame or a Wx::Dialog - or any class that 
derives from them. You can find which built in classes are top level 
windows from http://docs.wxwidgets.org/3.0/classwx_top_level_window.html


You don'thave to explicitly destroy children ( controls ) of your top 
level windows. A Wx::Panel is just a type of control - not a top level 
window.


Note that if you choose to make them so in their contstructors, top 
level windows can be children of other top level windows. In which case, 
destroying the parent will destroy all children too.


An approach that can be used in an application with many Wx::Frames is 
to add an EVT_CLOSE handler to your Wx::Frame derived class and have the 
frame call $self-Destroy in your EVT_CLOSE handler. That way whenever a 
frame is closed, it will be properly deleted during idle time.


Hope it helps.

Mark
On 11/05/2015 17:05, Steve Cookson wrote:

Hi Mark,

Thanks for this.  So the short answer was that I had indeed made a 
fundamental error.  I should update PM.


Maybe I knew all this once upon a time, but I had definitely forgotten 
it long since!!  It explains why I had leaks all over the place.  Some 
of which must have been quite big because of embedded scrolling photos 
and other stuff.


Can I just clarify what is meant by toplevel.  I guess it means 
anything that groups controls that you would normally expect to 
disapear because of going out of scope: any Dialog, Panel or Frame 
with children or indeed a tree of descendants.  Or does it just mean 
the application main frame?


And if a whole tree goes out of scope simultaneously, eg controls in 
sizers on panels within panels in a dialog, is it enough to Destroy 
the dialog?


Thanks again,

Regards,

Steve.

On 11/05/15 11:52, Mark Dootson wrote:

Hi,

See 
http://docs.wxwidgets.org/3.0/classwx_window.html#a6bf0c5be864544d9ce0560087667b7fc


details for wxWindow::Destroy.

As you have determined, top level windows you create need to be 
destroyed with $win-Destroy;


The C++ structure for a Wx::Frame contains a reference to the 
associated Perl SV. So that SV won't go away until the C++ structure 
is deleted - which will never happen until your event loop is running.


Hope this helps.

Mark


On 11/05/2015 14:32, Steve Cookson wrote:

Hi Guys,

I started to talk about this on Perl Monks, you may have seen it here:

http://www.perlmonks.org/?node_id=1125580

An anonymous monk posted some code that showed just about every call 
to Wx leaking a scalar or two.  I've played about with the posted 
code and there is a copy attached to this email.


The main part of the code, here:

$count1 =  Devel::Leak::NoteSV($handle);
for(1..100){
my $f=Wx::Frame-new( undef ,-1,goner );
my $p=Wx::Panel-new (undef ,-1 );
#my $b=Wx::Button-new ( $f ,-1 );
#my $t=Wx::TextCtrl-new($f, -1, );
#$t-Destroy;
#$b-Destroy;
#$i-Destroy;
$p-Destroy;
$f-Destroy;
}

$count2 =  Devel::Leak::CheckSV($handle);

seems to show that if you do not -Destroy a Wx object, it will not 
go out of scope naturally and even if you do destroy a Wx::Frame 
object, it will not go out of scope.  The monk also tried Weaken and 
undef, with the same results.


Please have a look at this and make sure that I have not (or the 
Anonymous Monk has not), made some fundamental error.


I have checked it both in 2.8.11 and 3.0.2 with the same results.

I look forward to hearing your feedback,

Regards

Steve.









[rt.cpan.org #103129] build failure with wx 2.8 on Ubuntu 14.04: wxComboBox has no member RemoveSelection

2015-03-26 Thread Mark Dootson via RT
Thu Mar 26 15:00:31 2015: Request 103129 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: build failure with wx 2.8 on Ubuntu 14.04: wxComboBox has no 
member RemoveSelection
   Broken in: 0.9926
Severity: Critical
   Owner: MDOOTSON
  Requestors: dol...@cpan.org
  Status: open
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=103129 


This should be fixed in Wx 0.9927 which has been uploaded to CPAN

On Thu Mar 26 05:01:42 2015, DOLMEN wrote:
 Hi,
 
 I'm using wx 2.8 packaged by Ubuntu 14.04.
 
 Wx 0.9926 fails to build with the following error:
 
 
 /home/omengue/.plenv/versions/5.20.1/bin/perl5.20.1
 /home/omengue/.plenv/versions/5.20.1/lib/perl5/5.20.1/ExtUtils/xsubpp
 -nolinenumbers -noprototypes -typemap
 /home/omengue/.plenv/versions/5.20.1/lib/perl5/5.20.1/ExtUtils/typemap
 -typemap typemap Controls.xs  Controls.xsc  mv Controls.xsc Controls.c
 Warning: duplicate function definition 'GetSelection' detected in
 XS/ComboBox.xs, line 184
 Warning: duplicate function definition 'SetSelection' detected in
 XS/ComboBox.xs, line 203
 g++ -pthread -c -I. -I.
 -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8
 -I/usr/include/wx-2.8 -fwrapv -fno-strict-aliasing -pipe -fstack-protector
 -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2
 -DVERSION=\0.9926\ -DXS_VERSION=\0.9926\ -fPIC
 -I/home/omengue/.plenv/versions/5.20.1/lib/perl5/5.20.1/x86_64-linux/CORE
 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ Controls.c
 Controls.c: In function ‘void XS_Wx__ComboBox_RemoveSelection(CV*)’:
 Controls.c:33633:8: error: ‘class wxComboBox’ has no member named
 ‘RemoveSelection’
 THIS-RemoveSelection();
 ^
 make: *** [Controls.o] Erreur 1
 MDOOTSON/Wx-0.9926.tar.gz
 /usr/bin/make -- NOT OK
 
 
 --
 Olivier Mengué - http://perlresume.org/DOLMEN - https://gratipay.com/dolmen/





[rt.cpan.org #102269] Makefile.PL dies because of change in Getopt::Long: Option spec cannot be used with pass_through

2015-03-26 Thread Mark Dootson via RT
Thu Mar 26 15:05:19 2015: Request 102269 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: Makefile.PL dies because of change in Getopt::Long: Option spec 
 cannot be used with pass_through
   Broken in: (no value)
Severity: (no value)
   Owner: MDOOTSON
  Requestors: ppi...@redhat.com
  Status: open
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=102269 


Fixed in Wx 0.9926

On Mon Feb 23 14:04:25 2015, jvrom...@squirrel.nl wrote:
 On Sat, 21 Feb 2015 14:52:57 -0500 Petr Pisar via RT bug...@rt.cpan.org
 wrote:
 
  Getopt-Long-2.43 made simultaneous use of pass_through and  options
  illegal. Unfortunately, build/Wx/build/Options.pm does so, and hence the
  build dies
 
 Getopt-Long-2.45 reverts this change. However, it would be a good idea to
 verify if the combination of  and pass_though is really intended.
 
 -- Johan





[rt.cpan.org #101449] Possible bug in Wx::

2015-03-26 Thread Mark Dootson via RT
Thu Mar 26 15:08:03 2015: Request 101449 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: Possible bug in Wx::
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: d...@optusnet.com.au
  Status: new
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=101449 


This was caused by incompatibility with clang build in recent Xcode.

Resolved in 0.9926 

On Sat Jan 10 20:06:48 2015, d...@optusnet.com.au wrote:
 Hi
 
 When using cpan install Wx make fails and install not possible
 
 Details:
 
 Wx-0.9923
 
 perl -v
 This is perl 5, version 12, subversion 5 (v5.12.5) built for darwin-
 thread-multi-2level
 
 uname -a
 Darwin David-Johnsons-MacBook-Pro-2.local 14.0.0 Darwin Kernel Version
 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-
 2782.1.97~2/RELEASE_X86_64 x86_64
 
 Results of cpan install Wx
 
 cpan install Wx
 Going to read '/Users/david/.cpan/Metadata'
   Database was generated on Fri, 09 Jan 2015 07:17:02 GMT
 Running install for module 'Wx'
 Running make for M/MD/MDOOTSON/Wx-0.9923.tar.gz
 Checksum for /Users/david/.cpan/sources/authors/id/M/MD/MDOOTSON/Wx-
 0.9923.tar.gz ok
 
 CPAN.pm: Going to build M/MD/MDOOTSON/Wx-0.9923.tar.gz
 
 Checking if your kit is complete...
 Looks good
 'WX' is not a known MakeMaker parameter name.
 Writing Makefile for Wx::PerlTest
 Writing Makefile for Wx::RichText
 Writing Makefile for Wx::Print
 Writing Makefile for Wx::DateTime
 Writing Makefile for Wx::Html
 Writing Makefile for Wx::Media
 Writing Makefile for Wx::Help
 Writing Makefile for Wx::XRC
 Writing Makefile for Wx::DataView
 Writing Makefile for Wx::Grid
 Writing Makefile for Wx::STC
 Writing Makefile for Wx::AUI
 Writing Makefile for Wx::IPC
 Writing Makefile for Wx::Socket
 Writing Makefile for Wx::DND
 Writing Makefile for Wx::Calendar
 Writing Makefile for Wx::WebView
 Writing Makefile for Wx::PropertyGrid
 Writing Makefile for Wx::MDI
 Writing Makefile for Wx::DocView
 Writing Makefile for Wx::FS
 Writing Makefile for Wx::Ribbon
 Writing Makefile for Wx::Perl::SplashFast
 Writing Makefile for Wx::Perl::Carp
 Writing Makefile for Wx::Perl::TextValidator
 Writing Makefile for Wx::Perl
 Writing Makefile for Wx
 Writing Makefile for Wx
 
 ==
 For installation instructions and further help please see
 docs/INSTALL.pod
 
 For command line switches help use:
 perl Makefile.PL --help
 ==
 
 /opt/local/bin/perl5.12 script/make_v_cback.pl  cpp/v_cback_def.h
 /opt/local/bin/perl5.12 script/copy_files.pl files.lst
 cp cpp/overload.h blib/lib/Wx/cpp/overload.h
 cp cpp/wxapi.h blib/lib/Wx/cpp/wxapi.h
 cp cpp/constants.h blib/lib/Wx/cpp/constants.h
 cp cpp/helpers.h blib/lib/Wx/cpp/helpers.h
 cp cpp/setup.h blib/lib/Wx/cpp/setup.h
 cp cpp/v_cback_def.h blib/lib/Wx/cpp/v_cback_def.h
 cp cpp/streams.h blib/lib/Wx/cpp/streams.h
 cp cpp/chkconfig.h blib/lib/Wx/cpp/chkconfig.h
 cp cpp/compat.h blib/lib/Wx/cpp/compat.h
 cp Opt blib/arch/Wx/build/Opt.pm
 cp cpp/v_cback.h blib/lib/Wx/cpp/v_cback.h
 cp cpp/event.h blib/lib/Wx/cpp/event.h
 cp typemap blib/lib/Wx/typemap
 cp cpp/e_cback.h blib/lib/Wx/cpp/e_cback.h
 touch wxt_copy_files
 cp lib/Wx/Event.pm blib/lib/Wx/Event.pm
 cp build/Wx/build/MakeMaker/Win32_MinGW.pm
 blib/lib/Wx/build/MakeMaker/Win32_MinGW.pm
 cp build/Wx/build/MakeMaker.pm blib/lib/Wx/build/MakeMaker.pm
 cp build/Wx/Overload/Driver.pm blib/lib/Wx/Overload/Driver.pm
 cp build/Wx/Overload/Handle.pm blib/lib/Wx/Overload/Handle.pm
 cp lib/Wx/App.pm blib/lib/Wx/App.pm
 cp build/Wx/build/MakeMaker/Hacks.pm
 blib/lib/Wx/build/MakeMaker/Hacks.pm
 cp lib/Wx/Mini.pm blib/lib/Wx/Mini.pm
 cp build/Wx/build/MakeMaker/Any_wx_config.pm
 blib/lib/Wx/build/MakeMaker/Any_wx_config.pm
 cp build/Wx/build/MakeMaker/Core.pm
 blib/lib/Wx/build/MakeMaker/Core.pm
 cp lib/Wx/Timer.pm blib/lib/Wx/Timer.pm
 cp build/Wx/XSP/Overload.pm blib/lib/Wx/XSP/Overload.pm
 cp build/Wx/build/Options.pm blib/lib/Wx/build/Options.pm
 cp lib/Wx/Locale.pm blib/lib/Wx/Locale.pm
 cp lib/Wx/NewClass.pod blib/lib/Wx/NewClass.pod
 cp build/Wx/build/Utils.pm blib/lib/Wx/build/Utils.pm
 cp lib/Wx/Api.pod blib/lib/Wx/Api.pod
 cp build/Wx/XSP/Enum.pm blib/lib/Wx/XSP/Enum.pm
 cp build/Wx/build/MakeMaker/MacOSX_GCC.pm
 blib/lib/Wx/build/MakeMaker/MacOSX_GCC.pm
 cp lib/Wx/Thread.pod blib/lib/Wx/Thread.pod
 cp lib/Wx/Loader.pod blib/lib/Wx/Loader.pod
 cp lib/Wx/ArtProvider.pm blib/lib/Wx/ArtProvider.pm
 cp build/Wx/XSP/Event.pm blib/lib/Wx/XSP/Event.pm
 cp build/Wx/build/MakeMaker/Any_OS.pm
 blib/lib/Wx/build/MakeMaker/Any_OS.pm
 cp lib/Wx/RadioBox.pm blib/lib/Wx/RadioBox.pm
 cp lib/Wx/Menu.pm blib/lib/Wx/Menu.pm
 cp build/Wx/XSP/Virtual.pm blib/lib/Wx/XSP/Virtual.pm
 cp Wx.pm blib/lib/Wx.pm
 cp build/Wx/build/MakeMaker/Win32.pm
 blib/lib/Wx/build/MakeMaker/Win32.pm
 cp build/Wx/build/MakeMaker/Win32_MSVC.pm
 

[rt.cpan.org #78355] Build Issues

2015-03-26 Thread Mark Dootson via RT
Thu Mar 26 15:11:41 2015: Request 78355 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: Build Issues
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: mmun...@gmail.com
  Status: stalled
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=78355 


Resolved with patches for wxWidgets 2.9.4 - fixed in later wxWidgets

On Fri Sep 28 15:40:26 2012, MDOOTSON wrote:
 This is an issue with release 2.9.4 of wxWidgets. If Alien::wxWidgets 0.61 
 + builds wxWidgets for you, 2.9.4 is patched with change backported from 
 wxWidgets trunk. For pre-built wxWidgets, 2.9.4 will fail.
 
 Stalled until wxWidgets 2.9.5




[rt.cpan.org #99325] DLLs not stripped under Windows

2015-03-26 Thread Mark Dootson via RT
Thu Mar 26 15:33:16 2015: Request 99325 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Alien-wxWidgets
 Subject: DLLs not stripped under Windows
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: ralf.neuba...@wido.bv.aok.de
  Status: new
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=99325 


Hi,

Normally on windows the dlls should be stripped by the build process but that 
is currently failing.

To strip your installed DLLs:

cd 
C:\strawberry5.18.1.1-32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib

attrib -r *.dll
strip *.dll
attrib +r *.dll




On Mon Oct 06 07:38:07 2014, ralf.neuba...@wido.bv.aok.de wrote:
 Hi,
 
 the auto-built libs and DLLs under Windows are very big:
 
 c:\dir C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib
  Volume in Laufwerk C: hat keine Bezeichnung.
  Volumeseriennummer: 8666-333F
 
 Verzeichnis von C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib
 
 26.06.2014  19:20DIR  .
 26.06.2014  19:20DIR  ..
 26.06.2014  19:20   579 build.cfg
 27.05.2013  01:5895.232 libgcc_s_sjlj-1.dll
 27.05.2013  01:58   860.160 libstdc++-6.dll
 26.06.2014  19:04 4.546.054 libwxbase30u.a
 26.06.2014  19:04   421.148 libwxbase30u_net.a
 26.06.2014  19:15   141.770 libwxbase30u_xml.a
 26.06.2014  19:00   202.080 libwxexpat.a
 26.06.2014  19:00   147.598 libwxjpeg.a
 26.06.2014  19:14 3.829.006 libwxmsw30u_adv.a
 26.06.2014  19:17 1.209.486 libwxmsw30u_aui.a
 26.06.2014  19:1211.270.024 libwxmsw30u_core.a
 26.06.2014  19:19   220.466 libwxmsw30u_gl.a
 26.06.2014  19:14 1.774.158 libwxmsw30u_html.a
 26.06.2014  19:14   286.924 libwxmsw30u_media.a
 26.06.2014  19:18 2.027.510 libwxmsw30u_propgrid.a
 26.06.2014  19:17   744.170 libwxmsw30u_ribbon.a
 26.06.2014  19:18 2.943.190 libwxmsw30u_richtext.a
 26.06.2014  19:19 2.420.332 libwxmsw30u_stc.a
 26.06.2014  19:15   726.214 libwxmsw30u_webview.a
 26.06.2014  19:16 1.459.622 libwxmsw30u_xrc.a
 26.06.2014  19:00   229.324 libwxpng.a
 26.06.2014  19:0080.586 libwxregexu.a
 26.06.2014  19:00   457.672 libwxtiff.a
 26.06.2014  19:0085.458 libwxzlib.a
 26.06.2014  19:20DIR  wx
 26.06.2014  19:04 4.318.770 wxbase30u_gcc_custom.dll
 26.06.2014  19:04   387.638 wxbase30u_net_gcc_custom.dll
 26.06.2014  19:15   350.238 wxbase30u_xml_gcc_custom.dll
 26.06.2014  19:14 3.305.276 wxmsw30u_adv_gcc_custom.dll
 26.06.2014  19:17 1.176.927 wxmsw30u_aui_gcc_custom.dll
 26.06.2014  19:1211.161.717 wxmsw30u_core_gcc_custom.dll
 26.06.2014  19:19   329.623 wxmsw30u_gl_gcc_custom.dll
 26.06.2014  19:15 1.709.144 wxmsw30u_html_gcc_custom.dll
 26.06.2014  19:14   391.571 wxmsw30u_media_gcc_custom.dll
 26.06.2014  19:18 1.740.233 wxmsw30u_propgrid_gcc_custom.dll
 26.06.2014  19:17   925.681 wxmsw30u_ribbon_gcc_custom.dll
 26.06.2014  19:18 3.022.088 wxmsw30u_richtext_gcc_custom.dll
 26.06.2014  19:19 3.111.484 wxmsw30u_stc_gcc_custom.dll
 26.06.2014  19:15   512.178 wxmsw30u_webview_gcc_custom.dll
 26.06.2014  19:16 2.176.565 wxmsw30u_xrc_gcc_custom.dll
   39 Datei(en), 70.797.896 Bytes
 
 The code and data is smaller:
 
 c:\size C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib\*.dll
textdata bss dec hex filename
   9035915481000   92907   16aeb C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib\libgcc_s_sjlj-
 1.dll
  826328   301203744  860192   d2020 C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib\libstdc++-
 6.dll
 2877788   16644   22432 2916864  2c8200 C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib\wxbase30u_gcc_custom.dll
  143311   119525800  161063   27527 C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib\wxbase30u_net_gcc_custom.dll
  1956186572 968  203158   31996 C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib\wxbase30u_xml_gcc_custom.dll
 1649814   737409704 1733258  1a728a C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib\wxmsw30u_adv_gcc_custom.dll
  558741   319203688  594349   911ad C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib\wxmsw30u_aui_gcc_custom.dll
 6921746   54948  189068 7165762  6d5742 C:\strawberry5.18.1.1-
 32\perl\site\lib\Alien\wxWidgets\msw_3_0_0_uni_gcc_3_4\lib\wxmsw30u_core_gcc_custom.dll
   94098   180081192  113298   1ba92 C:\strawberry5.18.1.1-
 

Re: Future of wxperl.it

2015-01-05 Thread mark . dootson
 

This message is to confirm the successful renewal of wxperl.it for 1
year(s).
The new expiration date is 2016-03-03 22:59:59.

On 2015-01-05 17:48, Alexander xb wrote: 

 Who is maintaining it now? 
 
 How much are the fees? I might be willing to participate, looks like a 
 valuable resource to me. /Alex 
 
 On Mon, Jan 5, 2015 at 9:21 AM, Johan Vromans jvrom...@squirrel.nl wrote:
 
 Hi,
 
 On 2013-03-03, Mark Dootson allocated wxperl.it [1] to function as the 
 starting
 point of all wxPerl related web information. He choose a .it domain in
 honour to Mattia Barbon, who is italian.
 
 2015-03-03, two months from now, wxperl.it [1] will expire.
 
 What shall we do with it? If we want to keep it, someone will have to pay
 the fees...
 
 -- Johan
 

Links:
--
[1] http://wxperl.it


[rt.cpan.org #99607] Issue using wxTextEntryBox

2014-10-27 Thread Mark Dootson via RT
Mon Oct 27 15:05:08 2014: Request 99607 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: Issue using wxTextEntryBox
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: pwnbusiness2...@centurylink.net
  Status: open
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=99607 


Hi,

Your issue with Wx::TextEntryBox arises from the basic way wxWidgets handles 
applications and windows.

The basic rule is that the main application loop will exit when no more 
instances of Wx::TopLevelWindow ( e.g. Wx::Frame and Wx::Dialog ) exist in the 
application.

Top level windows (Frames and Dialogs) must be explicitly destroyed.

$dialog_Destroy;

unless your code causes them to be destroyed by some other method (such as 
being a child of another TopLevelWindow when it is destroyed or the automatic 
behaviour when you close the window using system menus / buttons).

In your example, none of these things happens so the application loop never 
exits. Your Wx::TextEntryDialog has no parent so continues to exist after you 
close your Frame.

Dialogs designed for modal usage, such as Wx::TextEntryDialog, need to have a 
valid parent to work properly, or be created as  a special case without a 
parent.

When you create the dialog and pass in the Wx::Panel as the parent the 
following things happen.

Dialogs need top level parents so the wxWidgets code determines the parent of 
Wx::Panel - your frame - and checks if that is a valid parent. It isn't - a 
parent top level window needs to be visible on the display to be a valid parent 
for a dialog. So the dialog is created without a parent. When you close the 
$frame, the TextEntryDialog is left hanging around so the main application loop 
never exits.

In this situation, wxWidgets will use anything you have set as the top window 
(wxTheApp-SetTopWindow) but your example does not do this.

In standard usage you would always do:

my $dialog = Wx::textEntryDialog-new();
my $result = $dialog-ShowModal;
# .. get stuff from dialog
$dialog-Destroy;

so your particular issue would not arise.

With regard to the different in implementation between Wx:TextEntryDialog and 
Wx::SingleChoiceDialog, it is indeed because of the use of client data. The 
wxPerl implementation allows you to pass a reference to an array of anything 
(so maybe references to objects) so a C++ class is required to maintain the 
correct reference counts on the Perl SVs for the array ref.

Hope it helps

Mark
















 






Re: Wx::Event::EVT_AUINOTEBOOK_BEGIN_DRAG stopped workind

2014-09-16 Thread mark . dootson
 

Hi, 

A fix for this committed to SVN. Release probably at the weekend as I
have a lot of other Wx things to catch up on. 

Regards 

Mark 

On 2014-09-13 12:56, herbert breunung wrote: 

 thank you very much for your efforts i bookmark that link.
 please let me know when there will be some change on that front,
 because i plan to do even more stressful things on wx and expect to find even
 more bugs :)
 
 best
 herbert
 
 On 09/12/2014 07:20 PM, Steve Cookson wrote:
 Hi Herbert, I'm still looking at this. I expanded this a bit more. I can get 
 the following to work: EVT_AUINOTEBOOK_PAGE_CHANGING 
 EVT_AUINOTEBOOK_PAGE_CHANGED EVT_AUINOTEBOOK_DRAG_DONE 
 EVT_AUINOTEBOOK_TAB_RIGHT_DOWN EVT_AUINOTEBOOK_TAB_RIGHT_UP 
 EVT_AUINOTEBOOK_BG_DCLICK EVT_AUINOTEBOOK_PAGE_CLOSED But not these: 
 EVT_AUINOTEBOOK_PAGE_CLOSE EVT_AUINOTEBOOK_BUTTON EVT_AUINOTEBOOK_BEGIN_DRAG 
 EVT_AUINOTEBOOK_END_DRAG EVT_AUINOTEBOOK_DRAG_MOTION 
 EVT_AUINOTEBOOK_ALLOW_DND (Actually, I can't see how to activate this). And I 
 don't have a middle button to test: EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN 
 EVT_AUINOTEBOOK_TAB_MIDDLE_UP And: EVT_AUINOTEBOOK_CANCEL_DRAG is not 
 wrapped. It looks like a wxWidgets problem. See here from 2011: 
 https://groups.google.com/forum/#!msg/wx-users/8lflty8iDJo/5-r_qLcP2MIJ [1] 
 Regards Steve. On 12/09/14 14:24, herbert breunung wrote: ah thanks maybe it 
 only worked but drag done is fine, but without the info where dragging 
 started useless. as i also didnt found m
 ethods
of the event object in sources im currently a bit helpless how to achieve that. 
maybe soemthing went wrong in the XS mapping? unfortunately i also dont have 
any mouse events on the bar itself. the little program grew, its on: 
https://bitbucket.org/lichtkind/kephra/src/d993a2380d71b9449bd6e47d36b8f1a415c71b47/lib/docbar.pl?at=sp1
 [2] and thanks for your work Hi Herbert, I'm using Kubuntu 14.04. On 11/09/14 
16:22, herbert breunung wrote: just noticed because a kephra feature stopped 
working. this is the example Well I think you're right. But for me it NEVER 
worked. EVT_AUINOTEBOOK_END_DRAG too. I have no idea why. I gave up some time 
ago and I only use: EVT_AUINOTEBOOK_DRAG_DONE instead of END_DRAG and I avoid 
using BEGIN_DRAG. It means a bit more validation afterwards. I also use: 
EVT_AUINOTEBOOK_PAGE_CHANGING EVT_NOTEBOOK_PAGE_CHANGED Which also work. It 
would be useful to find out why, but I never really had time. Maybe when I get 
a chance. Does your END_DRAG work? Regards S
 teve
 

Links:
--
[1]
https://groups.google.com/forum/#!msg/wx-users/8lflty8iDJo/5-r_qLcP2MIJ
[2]
https://bitbucket.org/lichtkind/kephra/src/d993a2380d71b9449bd6e47d36b8f1a415c71b47/lib/docbar.pl?at=sp1

Moving to wxWidgets 3.0 as the standard install.

2013-10-07 Thread Mark Dootson

Hi All,

I'll be playing catch up over the next few weeks with all things Wx but 
I wanted to give the earliest possible notice of a change to the default 
version of wxWidgets that will be compiled under Alien::wxWidgets. The 
first release candidate for wxWidgets 3.0 is out today and I'd expect 
the full release within the next couple of weeks. This will be followed 
closely by a release of Alien::wxWidgets and Wx that allows you to build 
with wxWidgets 3.0 ( and 2.9.5 for that matter ).
I intend to make wxWidgets 3.0 the default (instead of an option ) with 
the first release of Alien::wxWidgets after 1 January 2014.

wxWidgets 2.8.x versions will continue to be supported.

Regards

Mark





Re: Bug in printing under Windows

2013-07-03 Thread Mark Dootson

Hi,

The 'error' in the wxperl_demo is in the 'OnPrintPage' method. This 
should return a true value. For correct operation in Windows just return 
a true value from this method.


GetPageInfo works fine on all platforms as far as I am aware.

Regards

Mark


On 03/07/2013 08:01, Arpad Szasz wrote:

  Hello,

  I think I found a bug when printing from the example Miscellanea -
Printing in
wxperl_demo.pl http://wxperl_demo.pl: the example correctly prints 2
pages in Linux but only one page
in Windows (tested on XP). I believe Wx::Printout::GetPageInfo() has no
effect
under Windows.

  Does a workaround exist?

  Thanks!

--
  Best regards,
  Árpád Szász




Re: how to useMemoryFileHandler ?

2013-06-28 Thread Mark Dootson

Hi Herbert,

On 26/06/2013 18:11, herbert breunung wrote:

greetings comrads
I  have seen the XRC custom example in Wx::Demo and did



 Wx::MemoryFSHandler::AddTextFile( 'file.xpm', 'EOB' );



 my $ed = Wx::TextCtrl-new($frame, -1,'');
 $ed-LoadFile('memory:file.xpm');

but i get just error also loading into the bitmap doesn't work.
Any Suggestions?

Thanks a lot
Herbert aka lichtkind



I had to look at the wxWidgets source to figure out what is happening here.

It turns out that you cannot use the name of a memory file anywhere that 
you can use a filename. Only some specific methods accept the name of a 
'memory' file. Internally, only some 'Load' methods use wxFileSystem and 
streams. For these methods, passing the name of a 'memory' file will 
work. In addition to the XRC method in Wx::Demo, 
Wx::HtmlWindow-LoadPage() will accept a 'memory' file.


Other methods, such as Wx::TextCtrl-LoadFile, are implemented as thin 
wrappers around the operating system file open / read functions. So in 
these cases 'memory:file.xpm' is not going to work.


I don't see anywhere in the documentation that you can tell which 
methods use filestreams though :(


For information, I have attached an example of how you can get a file 
handle to a memory file and read the content. It all looks pointless 
though and there seems multiple better ways to structure this in Perl.


Hope it helps

Mark

#-
#/usr/bin/perl

package MyFrame;
use strict;
use warnings;
use Wx qw( :textctrl :sizer :panel :window);
use Wx::FS;
use base qw( Wx::Frame );

sub new {
my $class = shift;
my $self = $class-SUPER::new( @_ );
my $mainpanel = Wx::Panel-new($self, -1, [-1,-1], [-1,-1], 
wxTAB_TRAVERSAL|wxBORDER_NONE);

my $text = Wx::TextCtrl-new($mainpanel, -1, , [-1,-1],[-1,-1]);

# Fairly pointless use of Virtual File System directly

# Create Virtual File System
{
my $content = 'The quick brown fox jumped over the lazy dog';
Wx::FileSystem::AddHandler( Wx::MemoryFSHandler-new );
Wx::MemoryFSHandler::AddTextFile( 'sample.txt', $content );
}

# Get file content from virtual filesystem
{
my $fs = Wx::FileSystem-new;
my $mfile = $fs-OpenFile('memory:sample.txt');
my $fh = $mfile-GetStream;
my $textcontent = '';
while($fh) {
$textcontent .= $_;
}
$text-ChangeValue($textcontent);
}

# Clean up VS
{
Wx::MemoryFSHandler::RemoveFile( 'sample.txt' );
}

my $panelsz = Wx::BoxSizer-new(wxVERTICAL);
my $framesz = Wx::BoxSizer-new(wxVERTICAL);

$panelsz-Add($text, 1, wxEXPAND|wxALL, 0);
$mainpanel-SetSizer($panelsz);
$framesz-Add($mainpanel, 1, wxEXPAND|wxALL, 0);
$self-SetSizer($framesz);

$self-Center;
return $self;
}

package MyApp;
use strict;
use warnings;
use Wx;
use Wx::FS;
use base qw( Wx::App );

sub OnInit {
my $self = shift;
my $win = MyFrame-new(undef, -1, 'Wx::FS Test');
$self-SetTopWindow($win);
$win-Show(1);
return 1;
}

package main;
use strict;
use warnings;

my $app = MyApp-new;
$app-MainLoop;





















Re: Simple Line Graphs

2013-06-28 Thread Mark Dootson

Hi James,

On 24/06/2013 20:23, James Lynes wrote:

Should be easy to
pull the generated file into a PaintDC if you don't want to launch an
outboard file viewer. I may or may not get to that.


I added a simple viewer to your code by:
1. changing your Graph method a little
2. adding display classes DisplayDialog and DisplayPanel

I though it would be useful to demo getting the raw data from your GD 
object and displaying it in a Wx::Panel without needing to save to a 
file. It also removes the need for an external viewer and is cross platform.


Hope it helps

Mark

#! /home/pete/CitrusPerl/perl/bin/perl

# ImpedanceGraph.pl
# Impedance calculator for Ls  Cs with graphic display
#
# Calculates the impedance for a range of frequencies and graphs.
#Graph and save_chart borrowed(stolen) from GD::Graph sample51.pl
#
# James M. Lynes, Jr.
# Last Modified: June 24, 2013
#
package main;
use strict;
use warnings;
my $app = App-new();
$app-MainLoop;

package App;
use strict;
use warnings;
use base 'Wx::App';
sub OnInit {
Wx::InitAllImageHandlers();
my $frame = Frame-new();
$frame-Show(1);
}

package DisplayPanel;
use strict;
use warnings;
use Wx qw(:everything);
use base qw(Wx::Panel);

use Wx::Event qw( EVT_PAINT );


sub new {
	my ($class, $parent, $bitmap) = @_;
	my $self = $class-SUPER::new($parent, -1, 
		wxDefaultPosition, 
		[ $bitmap-GetWidth, $bitmap-GetHeight ], 
		wxBORDER_NONE);
	
	$self-{bitmap} = $bitmap;
	EVT_PAINT($self, \OnEvtPaint);
	return $self;
}

sub OnEvtPaint {
	my ($self, $event) = @_;
	my $dc = Wx::PaintDC-new($self);
$dc-DrawBitmap($self-{bitmap}, 0,0,0);
}
	

package DisplayDialog;
use strict;
use warnings;
use Wx qw(:everything);
use base qw(Wx::Dialog);

sub new {
	my($class, $parent, $image) = @_;
	
	my $self = $class-SUPER::new($parent, -1, 'GD::Graph Image Display');
	
	my $bitmap = Wx::Bitmap-new($image);
	my $canvas = DisplayPanel-new($self, $bitmap);
	
	my $sizer = Wx::BoxSizer-new(wxVERTICAL);
	$sizer-Add($canvas,1,wxEXPAND|wxALL,0);
	$self-SetSizerAndFit($sizer);
	return $self;
	
}


package Frame;
use strict;
use warnings;
use Wx qw(:everything);
use base qw(Wx::Frame);
use Wx::Event qw(EVT_BUTTON EVT_CHOICE);
use GD::Graph::lines;
use Data::Dumper;

sub new {
my($self) = @_;

$self = $self-SUPER::new(undef, -1, L or C Impedance Graph, 
  wxDefaultPosition, wxDefaultSize);

my @Inductors = (nH, uH, mH);
my @Capacitors = (pF, nF, uF);
$self-{lmultiplyer} = 1E-09;
$self-{cmultiplyer} = 1E-12;
$self-{freqs} = [1, 10, 100, 1000, 1, 10, 100, 1000, 1, 10];

$self-{st1} = Wx::StaticText-new($self, -1, Inductor Value, Wx::Point-new(25,50),
   wxDefaultSize, wxALIGN_LEFT);
$self-{st2} = Wx::StaticText-new($self, -1, Capacitor Value, Wx::Point-new(25,100),
   wxDefaultSize, wxALIGN_LEFT);

$self-{st5} = Wx::StaticText-new($self, -1, Enter an L or C. Impedance Sweep will be Graphed,
   Wx::Point-new(25,15), wxDefaultSize, wxALIGN_LEFT);
 
$self-{tc1} = Wx::TextCtrl-new($self, -1, , Wx::Point-new(150,50), Wx::Size-new(100,20));
$self-{tc2} = Wx::TextCtrl-new($self, -1, , Wx::Point-new(150,100), Wx::Size-new(100,20));
$self-{tc1}-SetValue(0);
$self-{tc2}-SetValue(0);

$self-{lc} = Wx::Choice-new($self, 1, Wx::Point-new(250, 50), wxDefaultSize, \@Inductors);
$self-{cc} = Wx::Choice-new($self, 2, Wx::Point-new(250, 100), wxDefaultSize, \@Capacitors);

$self-{bt1} = Wx::Button-new($self, 4, Graph Cs, Wx::Point-new(25,200), wxDefaultSize);
$self-{bt1} = Wx::Button-new($self, 5, Graph Ls, Wx::Point-new(150,200), wxDefaultSize);
$self-{bt1} = Wx::Button-new($self, 6, Clear All, Wx::Point-new(25,150), wxDefaultSize);
$self-{bt2} = Wx::Button-new($self, wxID_CLOSE, Exit, Wx::Point-new(25,300), wxDefaultSize); 

EVT_BUTTON($self, 4, \CalcC);
EVT_BUTTON($self, 5, \CalcL);
EVT_BUTTON($self, 6, \ClearAll);
EVT_BUTTON($self, wxID_CLOSE, \Close);
EVT_CHOICE($self, 1, \ChoiceL);
EVT_CHOICE($self, 2, \ChoiceC);

return $self;
}

sub CalcC {
my($self, $event) = @_;
my @values;
my $C = $self-{tc2}-GetValue * $self-{cmultiplyer};
if($C == 0) {return};
foreach my $F (@{$self-{freqs}}) {
my $I = 1/(6.28 * $C * $F);
push(@values, $I);
}
$self-Graph(\@values);
}

sub CalcL {
my($self, $event) = @_;
my @values;
my $L = $self-{tc1}-GetValue * $self-{lmultiplyer};
if($L == 0) {return};
foreach my $F (@{$self-{freqs}}) {
my $I = 6.28 * $L * $F;
push(@values, $I);
}
$self-Graph(\@values);
}

sub ChoiceL {
my($self, $event) = @_;
if($self-{lc}-GetSelection == 0) {$self-{lmultiplyer} = 1E-09};
if($self-{lc}-GetSelection == 1) {$self-{lmultiplyer} = 1E-06};
if($self-{lc}-GetSelection == 2) {$self-{lmultiplyer} = 1E-03};
}

Re: Finding the selected text in a ComboBox

2013-06-27 Thread Mark Dootson

Hi,

wxComboBox::GetSelection isn't wrapped at all - you are just getting the 
result from the inherited method wxControlWithItems::GetSelection.


I'm not sure why the wxWidgets 2.9.x docs have a wxPerl note saying this 
is wrapped.


Wx 0.9923 with this fixed coming soon. (Code is in SVN but as wxComboBox 
implementation is different across platforms and wxWidgets versions, I 
still have an amount of testing to do.)


Regards

Mark



On 28/06/2013 03:17, Ian Macdonald wrote:

Hi,

In 2.8.10, the GetSelection method in ComboBox seems to be returning the
selected index of the current row, rather than the range of text indices
selected in the text control.

Is there some way of finding this out without going to 2.9? We're on the
verge of a big release so I'd rather not do that right now.

Thanks,

--
Ian Macdonald




Re: Finding the selected text in a ComboBox

2013-06-27 Thread Mark Dootson

Hi,

On 28/06/2013 05:34, Ian Macdonald wrote:

Hi Mark,

Thanks for the info. So in 2.8, there's no way of getting this for the
moment?

Ian


Sorry, no. It isn't implemented for 2.8 or 2.9 and I don't see any other 
way of getting a selected range from the wxTextCtrl.


Regards

Mark



Re: Fw: Is Wx::DateTime fully implemented in WxPerl?

2013-06-22 Thread Mark Dootson

Hi,

First and foremost, the date parsing methods are not implemented in the 
wxPerl for the 2.9.x branch of wxWidgets. This is because the API for 
these methods changed completely from the 2.8 branch to the 2.9 branch. 
When the 2.9 branch was first created, the code you quoted was added to 
wxPerl simply to allow compilation with the new wxWidgets branch. I 
imagine the intention was to return to the code and implement the 2.9.x 
API at some point.


For myself, and I would guess previously Mattia, a full implementation 
on Wx::DateTime is a pretty low priority.


My view would be that you should use one of the many excellent Perl 
module groups for Date Time manipulation to parse and calculate date 
values. Use Wx::DateTime objects only to pass your values to and from 
the GUI methods and functions as necessary.


Not that it would have helped you in this case, but you have written 
code based on the 2.8.x wxWidgets API which would not work with the 
2.9.x API anyway.


I'll make sure that the date parsing functions are on the 'todo' list, 
but I would highly recommend using your favourite dedicated Perl 
DateTime module set instead.


Regards

Mark




On 22/06/2013 15:22, Helen Craigman wrote:

In DateTime.xsp:
https://metacpan.org/source/MDOOTSON/Wx-0.9922/ext/datetime/XS/DateTime.xsp
lines 120-128, you find:
#if WXPERL_W_VERSION_LT( 2, 9, 0 )
 wxString ParseFormat( wxString date,
 wxString format = wxDefaultDateTimeFormat,
 const wxDateTime dateDef = wxDefaultDateTimePtr );
 wxString ParseDate( wxString date);
 wxString ParseDateTime( wxString date);
 wxString ParseTime( wxString date);
 wxString ParseRfc822Date( wxString date);
#endif
What does that mean in respect of my OP?
Many TIA
Helen

- Original Message -
*From:* Helen Craigman mailto:ga0...@gmail.com
*To:* wxperl-users mailto:wxperl-users@perl.org
*Sent:* Saturday, 22 June, 2013 13:05
*Subject:* Is Wx::DateTime fully implemented in WxPerl?

Dear esteemed wxPerl experts

Is Wx::DateTime fully implemented in WxPerl?
These three statements work fine:
use Wx::DateTime;
#...
$date_to_wx = Wx::DateTime-new;
# ...
$time_from_ctrl-SetValue($time_from_wx); # (where $time_from_ctrl
is a Wx::TimePickerCtrl)
# ...
$time_from_ctrl-GetValue($time_from_wx);
But, when trying one of these:
$timeformat = '%T';
#...
$time_from_wx = Wx::DateTime-ParseFormat('0:0:0', $timeformat);
or trying:
$time_from_wx = Wx::DateTime-ParseTime('0:0:0');
it bumps with: Can't locate object method ParseFormat via package
Wx::DateTime at ... line ...
(Same for ParseTime).
ParseTime and ParseFormat are wxWidgets DateTime methods.
Am I missing something, or calling with a wrong syntax?
Where can you find all implemented methods for wxPerl Wx::DateTime?
Many TIA
Helen
NB My system: Windows 7, Citrus Perl 5.16.3, wxWidgets 2.9.4





Re: Fwd: Wx::PlValidator: It seems it doesn't return GetWindow correctly

2013-06-19 Thread Mark Dootson

Hi,

On 17/06/2013 08:22, Helen Craigman wrote:


But, When I go, according to your suggestion:
$panel2-InitDialog;
It bumps with:
Can't locate object method InitDialog via package Wx::Panel at ...
etc.
Should I add something?


Indeed you are right. The InitDialog method is missing from wxPerl. It 
will be in the next release.
However, in the meantime it is simple to implement your own equivalent ( 
which is just a copy of what the C++ code does)


sub MyInitDialog {
my $self = shift;
$self-TransferDataToWindow();
# Nudge window to update.
$self-UpdateWindowUI(Wx::wxUPDATE_UI_RECURSE());
}


1. Why are validators implemented using cloning? Why is it necessary?


It is part of the wxWidgets internal implementation to allow passing 
events across wxWidgets threads. The wxPerl implementation simply wraps 
the underlying C++ implementation.




2. It's interesting to note that the need ( a must) to call GetValidator
is not mentioned in the (scarce) documentation (neither in the general
wxWidgets or wxPython one).


In normal usage you would not need to call GetValidator. Your validator 
and its methods are called as a result of library or code calls to the 
wxWindow methods TransferDataToWindow, Validate and 
TransferDataFromWindow. In all those cases there is never a need to call 
GetValidator.


Hope it helps.


Mark








Re: Fwd: Wx::PlValidator: It seems it doesn't return GetWindow correctly

2013-06-16 Thread Mark Dootson
 wxICON_ERROR);
use parent -norequire, 'Wx::PlValidator';# Classe de base
sub new {# Constructeur
   my $class = shift;
   my $var_r = shift;# Ref de la variable associe
   my $this = $class-SUPER::new;
   $this-{var_r} = $var_r;# Pour consultation ultrieure
   return $this;
} # end sub new
sub Clone {# Indispensable pour les Validators car ils sont clon?s en
interne
   my $this = shift;
   my $new = MyValidator-new( # Transmet la reference a la variable associe
$this-{var_r} );
   return $new;
} # end sub Clone
sub Validate {# Appel?e par Wx::Dialog-Validate
   my( $this, $dialog ) = @_;
   my $V_var = $this-GetWindow-GetValue;# La methode GetWindow
retourne le widget concerne
 # Verification personnalisee
 if ($V_var !~ /^[A-Z ]+$/) {# ici uniquement des caracteres
alphabetiques majuscules et l'espace
Wx::MessageBox( Erreur: $V_var n'est pas une valeur admissible., #
Affichage d'un Pop-up informatif
Error, wxOK|wxICON_ERROR, undef );
return 0;# Signale notre probleme au Dialog
 }
 1;# Signale que tout va bien
} # end sub Validate
sub TransferFromWindow {# Copie le contenu du controle dans la variable
associe
 my $this = shift;
 ${$this-{var_r}} = $this-GetWindow-GetValue;
 1;# Signale que tout va bien
} # end sub TransferFromWindow
sub TransferToWindow {# Copie le contenu de la variable associ?e dans le
controle
 my $this = shift;
 $this-GetWindow-SetValue( ${$this-{var_r}} );
 1;# Signale que tout va bien
} # end sub TransferToWindow
1;
# end package MyValidator;#--- end package MyValidator

package main;# --  package
main::
use strict;
use warnings;
# ...
# déclaration et initialisation de la variable interne associée au Validator
$main::text_value = 'FOO BAR';
my $app = Wx::SimpleApp-new;
my $frame = MyForm-new;
$frame-Show(1);
$app-MainLoop;
1;



On Sun, Jun 16, 2013 at 4:48 AM, Mark Dootson mark.doot...@znix.com
mailto:mark.doot...@znix.com wrote:

Hi,


On 15/06/2013 22:23, Helen Craigman wrote:

Dear esteemed WxPerl experts and users:
I have been trying to incorprate a validator on a TextCtrl
widget, using
PlValidator (following this:

..

This gives the error: Can't call method SetValue on an undefined
value at... etc.


As far as my own usage is concerned, classes derived from
Wx::PlValidator work perfectly.

For me to either help you to get your Wx::PlValidator derived class
working, or identify some bug in Wx::PlValidator, you would have to
post some code that can be run and demonstrates the failure you are
experiencing.

The code snippet you have posted doesn't show a validator being
assigned to a Wx::TextCtrl - so it cannot be an accurate
representation of the code that fails for you. You clearly have
worked out how a Validator should work if you get as far as the
error reported,  and you probably just need a simple adjustment in
your code to make it work. But without seeing the actual failing
code I have no clue what might be causing the failure.

I feel that I am always giving negative answers to the Wx questions
you ask on this list and Perl Mongers - and I feel really bad about
this as you have clearly figured out 99% of what is required yourself.

I can't help if you don't post some actual code - or even a snippet
taken from actual code. I'd guess you are missing a Clone method in
your derived class, but who knows. The code you posted can't be the
code you are running.

Regards

Mark









Re: Wx::Notebook drag and drop freezes tab in Linux.

2013-06-16 Thread Mark Dootson

Hi Steve,

I can't repeat this.
I've tested wxWidgets 2.9.4 and wxWidgets 2.8.12 on Fedora 17 32 bit.

What is your Linux distro / wxWidgets version / Wx version?

I am a bit surprised I can't repeat it as there are plenty of reports on 
the wxWidgets bug list for wxAUI concerning tab focus / mouse capture etc.


Regards

Mark


On 11/06/2013 15:01, Steve Cookson wrote:

Hi Guys,

We've got a little glitch here which at first I thought was my own, but
now I find it's in wxperl_demo.pl too.

Steps to reproduce on Linux:

1) Execute wxperl_demo.pl

2) If you open  AUI managed window

3) Resize the window so you can easily see all the tabs

4) Drag tab one past tab two.

5) Now click on tab two - tab two is frozen.

If you now clip on tab three, tab two is freed up again.

Until this latter action, -GetSelection returns the value pre-drag.
-GetPageIndex() seems to work, but as I no-longer know which page I'm
using, it's not of much use.

In the meantime I've added a -SetSelection(0) after drag and drop, at
least it my own malfunction and it's clear how to work around it.

Regards

Steve





Re: Wx::PlValidator: It seems it doesn't return GetWindow correctly

2013-06-15 Thread Mark Dootson

Hi,

On 15/06/2013 22:23, Helen Craigman wrote:

Dear esteemed WxPerl experts and users:
I have been trying to incorprate a validator on a TextCtrl widget, using
PlValidator (following this:

..

This gives the error: Can't call method SetValue on an undefined
value at... etc.


As far as my own usage is concerned, classes derived from 
Wx::PlValidator work perfectly.


For me to either help you to get your Wx::PlValidator derived class 
working, or identify some bug in Wx::PlValidator, you would have to post 
some code that can be run and demonstrates the failure you are experiencing.


The code snippet you have posted doesn't show a validator being assigned 
to a Wx::TextCtrl - so it cannot be an accurate representation of the 
code that fails for you. You clearly have worked out how a Validator 
should work if you get as far as the error reported,  and you probably 
just need a simple adjustment in your code to make it work. But without 
seeing the actual failing code I have no clue what might be causing the 
failure.


I feel that I am always giving negative answers to the Wx questions you 
ask on this list and Perl Mongers - and I feel really bad about this as 
you have clearly figured out 99% of what is required yourself.


I can't help if you don't post some actual code - or even a snippet 
taken from actual code. I'd guess you are missing a Clone method in your 
derived class, but who knows. The code you posted can't be the code you 
are running.


Regards

Mark





Re: Threads

2013-05-31 Thread Mark Dootson

Hi Johan,

Would it be possible to extract and post an example of code that core 
dumps? I'd like to check if this is a Wx problem that can be fixed.


Regards

Mark

On 31/05/2013 09:14, Johan Vromans wrote:

Hi,

I'm trying to use threads from a Wx program. Unfortunately, the only
results I get so far are core dumps. Apparently I'm doing something
wrong.

To improve my understanding how this works, does anyone have a simple
working example of a wxPerl program that uses threads?

Thanks,

-- Johan





Re: wx-perl and Mac OS X

2013-05-28 Thread Mark Dootson

Hi,

You must build wxWidgets with Alien::wxWidgets. wxWidgets 2.9.4 is 
broken as far as wxPerl usage is concerned and must be patched.


Regards

Mark

On 28/05/2013 19:11, Frank Schima wrote:

Hello,


I'm trying to get wx-perl working on Mac OS X via Macports. I have
created ports for p5-wx and p5-wx-demo. However, the demo crashes with a
segmentation fault. I was hoping someone on this list could help me fix
it. To replicate the problem, do the following on a Mac running Mac OS X
10.8.3.

1. Install Macports [1].
2. sudo port install perl5 +perl5_16
3. sudo port install p5.16-wx-demo
4. perl /opt/local/bin/wxperl_demo.pl-5.16

Feedback or questions on my steps are welcome!


Cheers!
Frank

[1] http://www.macports.org/install.php




Re: Trying to trigger wxEVT_TREELIST_ITEM_CHECKED programmatically: not implemented?

2013-05-24 Thread Mark Dootson

Hi Helen,

On 24/05/2013 04:43, Helen Craigman wrote:

Hi wxPerl-users
I am using wxPerl with wxWidgets 2.9.5. I am using TreeListCtrl, and need
  to implement triggering EVT_COMMAND_TREELIST_ITEM_CHECKED
  programmatically.


In Wx we don't change state of anything by raising events. To change 
state in our code, we call the object methods. To change the checked 
state of a wxTreeListItem


use Wx qw( :checkbox );


$wxtreelistctrl-CheckItem(
$wxtreelistitem,
wxCHK_CHECKED
);

$wxtreelistctrl-CheckItem(
$wxtreelistitem,
wxCHK_UNCHECKED
);


---
For either wxEVT_TREELIST_ITEM_CHECKED or
  wxEVT_COMMAND_TREELIST_ITEM_CHECKED, compilation fails with the error:


wxEVT_TREELIST_ITEM_CHECKED is not exported by the Wx module



As noted above, the wxEVT_TREELIST_ITEM_CHECKED constant is not exported 
at it has no practical use in user code.


Hope it helps

Mark





Fwd: Re: Trying to trigger wxEVT_TREELIST_ITEM_CHECKED programmatically: not implemented?

2013-05-24 Thread Mark Dootson

Hi,

On 24/05/2013 11:19, Helen Craigman wrote:

Hi Mark




In my code, I do use the CheckItem method, and that's working fine.
The issue is, after I change the item check state, the event handler
for EVT_TREELIST_ITEM_CHECKED does not get
triggered,


Yes, this particular event is only triggered when the change is caused
by the user interface. That is a wxWidgets design decision /feature /
bug - depending on your view. The behaviour is documented though.


Studing the documentation, I undestood that the way to
have the event handler invoked, is to programatically raise the command
event (in this case: EVT_TREELIST_ITEM_CHECKED).


No. (as noted previously). You can created your own custom events but
'mimicking' a built in event is not the way to go. An actual
wxTreeListEvent derives from wxNotifyEvent - you would really need to
create the event properly.



Now an event handler has this in the beginning:
Quote --
my( $this, $event ) = @_;
  $item = $event-GetItem;
Unquote ---

So, since  it's looking for an event object, I don't know how to call it,
except for raising EVT_TREELIST_ITEM_CHECKED.
And in order to raise the event programatically, you need
wxEVT_TREELIST_ITEM_CHECKED.

By the way, other command event constants do get exported in wxPerl
(for example wxEVT_COMMAND_CHECKBOX_CLICKED).


true, but this isn't to allow end user usage, rather it it just the way
the event 'macro' sub routines are implemented for this particular event.



How do you propose I should do it?


sub handle_item_change {
   my($self, $item) = @_;
   # do stuff with $item;
}

sub on_event_item_checked {
   my($self, $event) = @_;
   my $item = $event-GetItem;
   $self-handle_item_change( $item );
}

sub set_item_state_by_code {
   my($self, $item, $newstate) = @_;
   $self-{treelist}-CheckItem($item, $newstate);
   $self-handle_item_change( $item );
}


Regards

Mark
























Re: Strawberry Perl 5.16.3 with wxWidgets 2.9.4 and wxPerl latest

2013-05-12 Thread Mark Dootson

Hi,

Building Wx for Strawberry is V simple. I've no idea why HelenCr is 
having problems. Anyhow, I have been through the process of building 
with Strawberry, found that it works perfectly ok - and posted to Perl 
Monks.


Cheers

Mark

On 11/05/2013 22:42, James Lynes wrote:

Thanks Johan.

I have also suggested installing Citrus Perl on the PM thread and an AM
has suggested ppm several times. No idea why HelenCr continues to try
and build it herself. For my part I'm just trying to be helpful and
maybe learn something in the process.

Thanks again for the response.

James


On Sat, May 11, 2013 at 5:03 PM, Johan Vromans jvrom...@squirrel.nl
mailto:jvrom...@squirrel.nl wrote:

James Lynes jmlyne...@gmail.com mailto:jmlyne...@gmail.com writes:

  Has anyone successfully built Strawberry Perl 5.16.3 with
wxWidgets 2.9.4
  and wxPerl .9921?

My *personal* advice is to not bother with Strawberry, but install
Citrus Perl which gives you 5.16.3 and Wx 2.9.4 cpmplete out of the box.

-- Johan






Re: wxString and UTF-8, utf8 etc etc etc again

2013-05-02 Thread Mark Dootson

Hi,

On 02/05/2013 10:34, Johan Vromans wrote:


The question is: do we consider wxWidgets to be 'external world'. That
answer is most likely 'yes'. But more important: do we consider wxPerl
to be 'external world'? I'd say 'no'. Therefore, what I'd expect to pass
to a wxPerl routine is a string in Perl's internal encoding. The wxPerl
wrapper should take care of encoding the string into whatever encoding
wxWidgets requires.

Compare this to {some, several, many, all} DBD drivers that handle the
internal/UTF-8 conversions transparently.

Alternatively, it's an (almost) equally good decision to require all
strings passed to a wxPerl routine to be encoded in UTF-8. For a program
that is correctly equipped to handle multibyte encoded strings it will
not make a difference.

-- Johan


I'd agree with that. For Wx 0.9922 I've changed the conversion to 
wxString so that it always uses a UTF-8 conversion.


At least I'm assuming that's what SvPVutf8_nolen does. It seems to, and 
the docs say it does. Contrary advice from perlapi utf8 gurus most 
welcome. Essentially I want


char * buffer = SomePerlApi( SV );
where buffer is the address at the start of a stream of UTF-8 octets.
I think SvPVutf8_nolen( SV ) does the job.

In testing this change though, I had to go back to Perl 5.8.9 to 
contrive a case where it made any difference. Even there, it might be an 
issue with older module versions - but given it was Perl 5.8.9 I was not 
inclined to investigate further.


So I'd say from testing that wxPerl already handled things transparently 
and continues to do so.


In short, I think that

my $string = decode( $someencoding, $externaldata );

or

my $string = $some_other_Perl_string;

# ... optionally some string operations on $string

$wxobject-SetValue( $string );

Should always work and if it doesn't it is a probably a bug in wxPerl. 
This is regardless of utf8 flags etc etc. It should just work from an 
end user perspective.


If someone demonstrates an instance where the above doesn't work, I'll 
endeavour to get it fixed.



Cheers

Mark












































Re: Can we print UTF-8 chars in Wx::TextCtrl fields?

2013-05-01 Thread Mark Dootson

Hi,

On 01/05/2013 07:34, Johan Vromans wrote:

Mark Dootson mark.doot...@znix.com writes:


On 30/04/2013 19:19, Johan Vromans wrote:


We may assume that the Perl string is in Perl's internal encoding.


No we may not.


In that case you'll run into all kinds of encoding problems anyway.


If you attempt any string operations, indeed you will.



See e.g. perlunitut.


I kind of like the existing solution which doesn't break existing code
all over the place and simply requires the coder to be specific about
the format of the data they are sending.


My main concern is: If I have correctly decoded string data, will it
work when passed to wxWdigets. For example:

   $orig = readline($datafile);
   $line = decode( 'utf8', $orig );
   $w = Wx::StaticText-new( ... );
   $w-SetLabel($line);

If an explicit utf8::upgrade were required in this case, my feelings
tell me something is wrong.


Well, this morning I'm inclined to agree that this ought to be the case. 
At least for:


$orig = readline($datafile);
$line = decode( 'UTF-8', $orig );
$w = Wx::StaticText-new( ... );
$w-SetLabel($line);

On the other hand I'm reluctant to introduce something that I'm certain 
will break someone's code somewhere ( which is the entire basis for my 
objection to making a change. )


So, my thinking is that I'll change it for builds against wxWidgets 
2.9.x and above and announce on this list and in docs that strings 
passed for wxString must be valid UTF-8.


I'll probably just use SvPVutf8_nolen on everything if this tests ok. 
(For info of casual reader - the force part in SvPVutf8_force refers  to 
changing the SV to have a pv ( string ) representation only - nothing to 
do with utf8. You would use it if you expected the C / C++ code might 
change the value directly so it would force Perl to re-evaluate the next 
time you used the SV in a number context. In our code the pv value will 
never be changed directly.)


For anyone interested, the relevant code is in cpp/helpers.h wrapped in 
a three part if/else


#if defined(wxUSE_UNICODE_UTF8)  wxUSE_UNICODE_UTF8

// Mac OSX and Linux

#elif wxUSE_UNICODE

// Windows

#else

// 2.8 ANSI build ( ignore it )

#endif

Macros

WXCHAR_INPUT, WXCHAR_OUTPUT, WXSTRING_INPUT, WXSTRING_OUTPUT

are used via the typemap.

Functions wxPli_wxChar_2_sv and wxPli_wxString_2_sv are also used 
throughout the Wx code.


You will note that the return value from a wxString or multibyte char is 
always flagged as utf8.



Regards

Mark
























Re: Can we print UTF-8 chars in Wx::TextCtrl fields?

2013-05-01 Thread Mark Dootson

Octavian,

I loaded up a Windows XP system, installed ActivePerl 5.14.5, and found 
the issue.


The 'Arial' font on your system is not the same as the 'Arial' font on 
my Windows Vista machine. Whether this is because I have a version of MS 
Office installed which comes with enhanced fonts or it is a Vista vs XP 
issue I am not sure.


Anyway, a little experimentation found me a font installed by default on 
Windows XP systems that does seem to have a more extensive set of glyphs.


If you use the font 'Microsoft Sans Serif' everything should then work. 
( assuming you have XP Service Pack 2 installed )


Microsoft Sans Serif - from wikipedia

--

Windows XP - SP1 = Version 1.10 of the font includes 1119 glyphs (1209 
characters, 26 blocks), supporting Unicode ranges Alphabetic 
Presentation forms, Arabic, Arabic Presentation forms A-B, Cyrillic, 
General Punctuation, Greek and Coptic, Hebrew, Latin Extended-A, Latin 
Extended-B, Latin Extended Additional, Mathematical Operators, Thai. 
Supported code pages include 1250-1258, Macintosh US Roman, 874, 864, 
862, 708. Font is smoothed at 0-6 points, hinted at 7-14 points, hinted 
and smoothed at 15 and above points. OpenType features includes init, 
isol, medi, fina, liga for default Arabic script.


Windows XP - SP2 = Version 1.41 of the font includes 2257 glyphs (2301 
characters, 28 blocks), which extended Unicode ranges to include 
Combining Diacritical Marks, Currency Symbols, Cyrillic Supplement, 
Geometric Shapes, Greek Extended, IPA Extensions, Number Forms, Spacing 
Modifier Letters. New OpenType scripts include Arabic MAR script. 
Additional OpenType features includes rlig for Arabic scripts.


Windows Vista - Version 5.00 - includes 3053 glyphs (2788 characters, 36 
blocks), which extended Unicode ranges to include Arabic Supplement, 
Combining Diacritical Marks Supplement, Combining Half Marks, Latin 
Extended-C, Latin Extended-D, Phonetic Extensions, Phonetic Extensions 
Supplement, Specials, Superscripts and Subscripts. New OpenType scripts 
include Arabic URD (Urdu), Cyrillic (default), Hebrew (default), Latin 
(default, Romanian), Thai (default). Additional OpenType features 
includes ccmp, mark, mkmk for Arabic scripts; locl for Arabic URD (Urdu) 
script; mark, mkmk for default Cyrillic; dlig, ccmp, mark for default 
Hebrew; ccmp, mark, mkmk for Latin scripts; locl for Romanian Latin; 
ccmp, mark, mkmk for Thai.


--

I have attached an amended test.pl that works for me on a basic Windows 
XP install with ActivePerl 5.14.5. The only change absolutely required 
from your last test zip is to change the name of the font to

'Microsoft Sans Serif'.

Regards

Mark

On 01/05/2013 06:34, Octavian Rasnita wrote:

I have tried this but it still displays squares instead of UTF-8 chars.
(I deleted the line with decode() and I set the font to Arial.)

The new test file is at:

http://maestrodex.ro/static/test3.zip

--Octavian

- Original Message - From: Mark Dootson mark.doot...@znix.com
To: Octavian Rasnita orasn...@gmail.com
Cc: steveco.1...@gmail.com; wxperl-users@perl.org
Sent: Tuesday, April 30, 2013 10:43 PM
Subject: Re: Can we print UTF-8 chars in Wx::TextCtrl fields?



Hi,

Comment out the line

  $text = decode('utf8', $text );

you do not need it.

Change the font name requested to 'Arial'.

Everything should work.

I'll try to figure out if there's a way to query a font to check if it
has glyphs for particular code points. The old Font Encoding setting
seems useless here.

Regards

Mark



On 30/04/2013 20:29, Octavian Rasnita wrote:

Hi Mark,

I tried your suggestion and I removed the constant wxVSCROLL  from the
attributes of Wx::TextCtrl constructor, but the UTF-8 encoded chars
still appear as squares.
I use Windows XP Pro and ActivePerl 5.14.2.
(I need to use ActivePerl and not another distribution because I need to
create a COM server with this application.)

Then I tried adding:
utf8::upgrade( $text );
then
$textfield-AppendText( $text );

But no difference. Those chars still appear as squares.

Then I also added:

use Encode;
$text = decode('utf8', $text );
utf8::upgrade( $text );

But this time it gave the following error:

Cannot decode string with wide characters at D:/usr/lib/Encode.pm
line 176.

The scalar $text is obtain from an SQLite database and I connect to it
using:

my $dbh = DBI-connect(dbi:SQLite:test.db);
$dbh-do(PRAGMA cache_size = 8);
$dbh-do(PRAGMA synchronous = OFF);
$dbh-{sqlite_unicode} = 1;

The new cod with the SQLite db is at:

http://maestrodex.ro/static/test2.zip

I selected the record from this DB in command line and I've seen that
the special char ț appears as 2 chars, so I think the char is added
well in DB.

--Octavian

- Original Message - From: Mark Dootson
mark.doot...@znix.com
To: steveco.1...@gmail.com; wxperl-users@perl.org
Sent: Monday, April

Re: Can we print UTF-8 chars in Wx::TextCtrl fields?

2013-05-01 Thread Mark Dootson

Hi,

On 01/05/2013 16:49, steveco.1...@gmail.com wrote:


Well all this just serves to deepen my confusion.

1) What is the difference between:

$line = decode( 'UTF-8', $orig );

and

$line = decode( 'utf8', $orig );


Always use
decode( 'UTF-8', $orig );

'UTF-8' means what it says.

In my opinion, 'utf8' means something really quite like utf8 in all but 
a few respects but which isn't UTF-8 and is a left over from the dog's 
breakfast of Perl Unicode string handling, encoding and source code 
handling that took a decade to fix.


Perl's documents currently refer to UTF-8 as 'strict UTF-8'. There's no 
sanity to it. Why the docs don't just say 'utf8' is really a left over 
from an era of big mistakes, I don't know.



Why did the latter not work for Octavian?


It isn't the difference between 'utf8' and 'UTF-8' that caused 
Octavian's code to fail.




2) Mark, your earlier logic seemed clear and unassailable, yet now you seem
to change your mind.


I got worn down. It is, after all a community project. The logic seemed 
clear and unassailable to me too. When faced with an argument that 
simply ignores everything you say you are left with the option of 
repeating yourself for ever, ignoring the opposite argument, or giving 
up and agreeing. Life is short so I gave up and agreed. I always try to 
take the approach that even if the other fellow is wrong in principle, 
what exactly would be the downside to agreeing. It leaves you with the 
time and energy available to go on repeating yourself forever on the 
important stuff.


It won't break much I don't think.


I use:  $line = decode( 'utf8', $orig );

and I never have a problem, but according to this logic that is luck.

I accept this and I am happy to use utf8::upgrade($string);

I think we should assume that in the general case there will always be some
Perl processing before wxWidgets sees the string.

The general case is:

1 - Retrieve data from file or database (this maybe automatically decoded or
not, depending on the database and the driver);
2 - Do something to it (thus may be a null operation);
3 - Pass to wxWidgets to display to user.

To conserve string lengths and string processing (eg a simple alphabetical
sort in utf8).  If there is to be decoding, it must take place at between 1
and 2 above.

When you say:


So, my thinking is that I'll change it for builds against wxWidgets
2.9.x and above


What does it mean?  That you will include utf8::upgrade($string) in the
interface?


No, the code will just assume that the string passed is valid UTF-8 and 
attempt to convert it to a wxString accordingly. It will never call the 
libc option.




I can't see any harm in this.  Just setting a character bit to 1 before an
operation and again later at worst just seems redundant.

But if we have the position where decode is called twice, this will create
problems for me.  A doubly decoded value gets corrupted and becomes a
diamond with a question mark in it, or some such value.


Hope above assures you this won't happen. (We won't be double decoding.)

Cheers

Mark



Re: Wx = 0.9918 build errors because of missing typemap

2013-05-01 Thread Mark Dootson

Hi,

Indeed there are some missing specs in the typemap template.

Strange that yours is the only report where this bug manifests itself ( 
that is, 'make' decides the typemap needs to be rebuilt. )


Anyhow, attached patch for 0.9921 fixes it.

There are a few other things I wish to complete before releasing 0.9922 
but that should be in the next couple of days.


Regards

Mark


On 28/04/2013 16:12, Bjørn Forsman wrote:

Hi,

I have build errors with Wx = 0.9918. They all fail because of a
missing typemap:

0.9918 = Could not find a typemap for C type 'wxPlFontEnumerator *'
0.9919 = Could not find a typemap for C type 'wxRegionIterator *'
0.9920 = Could not find a typemap for C type 'wxRegionIterator *'
0.9921 = Could not find a typemap for C type 'wxRegionIterator *'

0.9917 builds fine.

Here is a bit more build context, with Wx 0.9921 (don't mind the weird
path names, I'm on NixOS):

building Wx.c
/nix/store/clfzsf6gi7qh5i9c0vks1ifjam47rijn-perl-5.16.2/bin/perl
/nix/store/clfzsf6gi7qh5i9c0vks1ifjam47rijn-perl-5.16.2/lib/perl5/5.16.2/ExtUtils/xsubpp
  -nolinenumbers -noprototypes  -typemap
/nix/store/clfzsf6gi7qh5i9c0vks1ifjam47rijn-perl-5.16.2/lib/perl5/5.16.2/ExtUtils/typemap
-typemap typemap  Wx.xs  Wx.xsc  mv Wx.xsc Wx.c
Could not find a typemap for C type 'wxRegionIterator *'.

Please put me in Cc, I'm not subscribed to the list.

Best regards,
Bjørn Forsman

Index: /builder/Wx/trunk/typemap.tmpl
===
--- typemap.tmpl(revision 3477)
+++ typemap.tmpl(revision 3478)
@@ -5,7 +5,7 @@
 ## Modified by:
 ## Created: 29/10/2000
 ## RCS-ID:  $Id$
-## Copyright:   (c) 2000-2010 Mattia Barbon
+## Copyright:   (c) 2000-2013 Mattia Barbon
 ## Licence: This program is free software; you can redistribute it and/or
 ##  modify it under the same terms as Perl itself
 #
@@ -158,6 +158,7 @@
 wxDialog *  O_WXOBJECT
 wxControl * O_WXOBJECT
 wxButton *  O_WXEVTHANDLER
+wxCommandLinkButton *   O_WXEVTHANDLER
 wxStaticText *  O_WXEVTHANDLER
 wxStaticLine *  O_WXEVTHANDLER
 wxTextCtrl *O_WXOBJECT
@@ -365,9 +366,11 @@
 wxAnimation *   O_WXOBJECT_THR
 wxFontMapper *  O_NON_WXOBJECT
 wxFontEnumerator *  O_NON_WXOBJECT_THR
+wxPlFontEnumerator *O_NON_WXOBJECT_VXSP_THR
 wxNativeFontInfo *  O_NON_WXOBJECT_THR
 wxFont *O_WXOBJECT_THR
 wxRegion *  O_WXOBJECT_THR
+wxRegionIterator *  O_WXOBJECT_THR
 wxIcon *O_WXOBJECT_THR
 wxIconBundle *  O_NON_WXOBJECT
 wxIconLocation *O_NON_WXOBJECT


wxString and UTF-8, utf8 etc etc etc again

2013-05-01 Thread Mark Dootson

Hi,

perldoc for the module Encode says:

-
CAVEAT: When you run $string = decode(utf8, $octets) , then $string 
might not be equal to $octets. Though both contain the same data, the 
UTF8 flag for $string is on unless $octets consists entirely of ASCII 
data on ASCII machines or EBCDIC on EBCDIC machines.

-

None of my machines can be ASCII or EBCDIC by whatever definition this 
doc entry uses as my testing on a variety of platforms shows that on 
Perl 5.8.8 through Perl 5.16.2 the above is most certainly not true.

I shouldn't be surprised really. What exactly is an ASCII machine?

Anyhow, I find that after

$string = decode(utf8, $octets)

$string always has the utf8 flag set, even if $octets is entirely ASCII 
data.


So ...

my $string = decode(utf8, $octets);

...do whatever string operations in Perl

$wxobject-SetValue($string);

will always work OK just providing something you did in
...do whatever string operations in Perl
didn't strip the utf8 flag off. Not that you'd know if it did.

Clear as mud?

For me too.

For myself, if I were writing code that handled multibyte char sets in 
existing Wx releases I would do


my $string = decode(UTF-8, $octets);

...do whatever string operations in Perl

utf8::upgrade($string);
$wxobject-SetValue($string);

If you believe that utf8::upgrade($string) is not necessary, then don't 
use it. If you're belief is correct, all will work fine.


The more I think about this and actually test what happens, the more I 
lean towards just always expecting string values that get passed to 
wxPerl wrappers to be UTF-8. By that I mean don't bother to test if Perl 
thinks it is UTF-8 or not, just attempt to convert the data buffer 
assuming that it is. I think I'll do it for the next release of Wx.


Then stuff is much simpler and easy for user to understand and fits with 
current dogma on how stuff should work.


The bottom line for anyone thinking 'is there something I'll have to 
change in my code?' - the answer is no. Unless it breaks. In which case 
- complain here.


Cheers

Mark








































Re: wxString and UTF-8, utf8 etc etc etc again

2013-05-01 Thread Mark Dootson

Hi,

On 02/05/2013 00:17, Steve Cookson wrote:


Or just

sub libDecode ($$){
return decode(@_);
}

At least all the things that might go wrong will all be here.


You're unduly worried ( probably my fault ).

my $string = decode($encoding, $binary);

Is fine.

Cheers

Mark











Re: Can we print UTF-8 chars in Wx::TextCtrl fields?

2013-05-01 Thread Mark Dootson

Hi,

On 01/05/2013 20:14, Octavian Rasnita wrote:

Yep, good to know.

It would be nice if WxPerl would announce somehow that a font doesn't
have the necessary glifs (maybe with a warning).


Nice to have, but there is no reasonable and practical implementation I 
can think of. I am aware of how to check if a given font has a 
particular glyph technically - but it is non trivial. This also won't 
tell me if the operating system font handler will correctly substitute a 
glyph from elsewhere. And, it isn't part of wxWidgets.


It's only a problem in decade old Windows XP anyway. Elsewhere if you 
just accept the default GUI font for text type controls all will be the 
best it can be.



And btw, if the constant wxVSCROLL  is not necessary, (do I understood
correctly that it is not necessary under Linux either?) and if it
creates problems under Windows, it would be helpful if it would give an
error when it is used, or it would be helpful if it would be skipped at
least under platforms that have a problem with it.


Not quite that simple. It is really just a number that gets added to a 
flags mask. It isn't unique. The number might actually mean something. 
It just doesn't mean wxVSCROLL in this context.


I suppose it might be possible to manually go through the wxWidgets code 
and check what the acceptable flags are for every class. But we'd have 
to re-do it for every wxWidgets release. For me, that is too much 
maintenance burden.


Sorry I couldn't add these but hope you understand why.

Regards

Mark




Re: Can we print UTF-8 chars in Wx::TextCtrl fields?

2013-04-30 Thread Mark Dootson

Hi,

On 30/04/2013 15:38, Johan Vromans wrote:




2. This data is the current default format fro wxWidgets.


Which I understand it may work if you're lucky.


I am of the opinion that this bit ( WXSTRING_INPUT ) already works as
well as it can do if given an SV and no other params. I certainly
would not want to change it to force all input to be valid UTF-8.
There is absolutely no reason to do so.


Forcing valid UTF-8 will enhance both cases to will allways work. This
sounds like a good reason to me.


Only if the input actually is valid UTF-8. Something only the Perl coder 
can know / ensure. It isn't a requirement of the wxWidgets library.



[ ... on upgrade ... ]
I don't think there's a coding error just because I use
utf8::upgrade($string). I don't need utf8::upgrade for my Perl code. I
need it to allow me to tell wxWidgets what's in $string.



I understand this to mean: always do a utf::upgrade *before* passing a
string to wxWidgets. For me this is a signal that upgrading should take
place on the Perl - wxWidgets boundary and not in the user program.


No, it means do a utf::upgrade before passing a string that you know 
contains valid UTF-8 to ensure the scalar is marked as such.



I appreciate your view may be different and you're entitled to think
mine is wrong.


My knowledge of the hairy details of Perl and Unicode is not sufficient
to tell what/who is wrong or right. Hence my urge to understand.


I don't believe there is an actual wrong or right. I know that forcing 
the input to be marked as utf8 at the Perl = wxWidgets boundary will 
break any existing code that passes buffers that aren't valid UTF-8. It 
makes assumptions about the data buffer passed that are not universally 
true.


I think you are getting focused on the concept that 'decode' alone is 
enough and everything else should just work. I don't see this as the 
issue at all. I don't really care about the internals of decode and 
Perl's unicode handling. It doesn't matter here.


I am simply saying that one can achieve consistent results when calling 
wxWidgets methods if one is explicit about the data format of the data 
buffers passed.


If there is a buffer known to contain valid UTF-8, then a simple 
shortcut is utf8::upgrade($string);


If I read your proposal correctly, you want to demand that all data 
buffers that may get passed to the wxString conversion function are 
valid UTF-8?


Hope I'm not missing the point.

Regards

Mark














Re: Can we print UTF-8 chars in Wx::TextCtrl fields?

2013-04-30 Thread Mark Dootson

Hi,

Comment out the line

  $text = decode('utf8', $text );

you do not need it.

Change the font name requested to 'Arial'.

Everything should work.

I'll try to figure out if there's a way to query a font to check if it 
has glyphs for particular code points. The old Font Encoding setting 
seems useless here.


Regards

Mark



On 30/04/2013 20:29, Octavian Rasnita wrote:

Hi Mark,

I tried your suggestion and I removed the constant wxVSCROLL  from the
attributes of Wx::TextCtrl constructor, but the UTF-8 encoded chars
still appear as squares.
I use Windows XP Pro and ActivePerl 5.14.2.
(I need to use ActivePerl and not another distribution because I need to
create a COM server with this application.)

Then I tried adding:
utf8::upgrade( $text );
then
$textfield-AppendText( $text );

But no difference. Those chars still appear as squares.

Then I also added:

use Encode;
$text = decode('utf8', $text );
utf8::upgrade( $text );

But this time it gave the following error:

Cannot decode string with wide characters at D:/usr/lib/Encode.pm line 176.

The scalar $text is obtain from an SQLite database and I connect to it
using:

my $dbh = DBI-connect(dbi:SQLite:test.db);
$dbh-do(PRAGMA cache_size = 8);
$dbh-do(PRAGMA synchronous = OFF);
$dbh-{sqlite_unicode} = 1;

The new cod with the SQLite db is at:

http://maestrodex.ro/static/test2.zip

I selected the record from this DB in command line and I've seen that
the special char ț appears as 2 chars, so I think the char is added
well in DB.

--Octavian

- Original Message - From: Mark Dootson mark.doot...@znix.com
To: steveco.1...@gmail.com; wxperl-users@perl.org
Sent: Monday, April 29, 2013 4:32 PM
Subject: Re: Can we print UTF-8 chars in Wx::TextCtrl fields?



Hi,

A Perl scalar has a character buffer to store character or byte data.
This data can be interpreted and stored by Perl in one of two formats:

1. Perl's internal data format
2. A number octets (bytes) representing a UTF-8 encoded string.

Internally it is just a memory buffer. Each scalar has a utf8 flag.
This tells Perl internally how to interpret its data buffer. Either as
Perl's internal data format or as UTF-8 encoded text. If the utf8 flag
is on, Perl regards the buffer as UTF-8 encoded text. If the utf8 flag
is off, Perl regards the buffer as containing data in Perl's internal
format.

So, say I load some binary data that I know is text encoded using
'ISO-8859-1'.

Then I would do:

my $string = decode('ISO-8859-1', $binary);

This gets $string which contains data in Perl's internal format. The
utf8 flag for the scalar '$string' is off As you have noted below, I
can't pass '$binary' to any of Perl's string functions. The results
will be unpredictable and mostly bad.

The evil starts due to some special features when we use decode to
convert a UTF-8 encoded string.

my $string = decode('utf8', $binary);

If $binary can be converted to $string using single byte characters,
then $string will be in Perl's internal data format and marked as
such. (utf8 flag off). If $binary contains multiple byte characters
the $string will contain a series of bytes representing a UTF-8
encoded string and the scalar '$string' will have the utf8 flag on.

Within Perl it should not matter whether the scalar is marked UTF-8 or
not - so long as the utf8 flag correctly reflects what's in the
scalar's data buffer.

The problem comes when we come to pass the data to the wxWidgets library.

The source macro that does this is:

#define WXSTRING_INPUT( var, type, arg ) \
  var =  ( SvUTF8( arg ) ) ? \
   wxString( SvPVutf8_nolen( arg ), wxConvUTF8 ) \
 : wxString( SvPV_nolen( arg ), wxConvLibc );


So basically, if the scalar is marked as 'utf8' then it gets converted
into a wxString as such. If not, you're at the mercy of libc and local
system settings. It may work. It may not.


Solution - your conversion of external data should be

 my $string = decode($encoding, $binary);
 utf8::upgrade($string);

This should be platform independent and work - always. Perl's string
functions should all work OK on $string.

The key points

my $string = decode('utf8', $binary);

It depends on the content of $binary whether $string has the utf8 flag
set.

my $string = decode('utf8', $binary);
utf8::upgrade( $string );

$string always has utf8 flag set. You could just do
utf8::upgrade($binary) but that would be a special case for when
$binary actually contains UTF-8 bytes. The two step method applies to
any encoding.

Perl can't know that a scalar contains UTF-8 encoded text unless you
tell it.

The statement:

'use utf8;' Is not needed anywhere here of course as it indicates that
the source code is encoded in UTF-8. Nothing more. Functions
utf8::upgrade etc. are always available.

If you have a list of scalars containing strings as in

@combo_options

then the same applies - to each individual scalar / string in the list.


Hope it helps.


Mark


On 29/04/2013 12:29, steveco.1...@gmail.com wrote:


Hi Mark

Re: Can we print UTF-8 chars in Wx::TextCtrl fields?

2013-04-29 Thread Mark Dootson

I would guess you are working on Windows?

wxVSCROLL isn't in the list of styles available for wxTextCtrl. It isn't 
needed. Remove it and all works OK.


It seems you can get away with it on Linux - but not on Windows.

For the Wx::Font you can just do

 my $font = Wx::Font-new( $FontSize}, wxFONTFAMILY_SWISS,
 wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, 0, Arial);

Cheers

Mark




On 22/04/2013 20:51, Octavian Rasnita wrote:

Hi,

I have a text field defined as:

$self-{defs} = Wx::TextCtrl-new(
$self-{panel},
-1,
,
wxDefaultPosition,
[ 500, 400 ],
wxTE_MULTILINE | wxTE_READONLY | wxVSCROLL | wxTE_PROCESS_ENTER |
  wxTE_RICH2
);

And I am trying to set a font for it using:

my $font = Wx::Font-new( $FontSize}, wxFONTFAMILY_SWISS,
wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL, 0, Arial Unicode MS,
wxFONTENCODING_SYSTEM );

my $style = Wx::TextAttr-new;
$style-Wx::TextAttr::SetFont($font);
$self-{defs}-SetDefaultStyle($style);

But if I print UTF-8 chars in this field, it prints squares instead of
special UTF-8 chars (non ASCII).
Should it work this way and the text might be wrong UTF-8 encoded?

I also read in the WxPerl documentation:


The known font encodings are:
...
wxFONTENCODING_UTF8,// UTF-8 Unicode encoding


So I tried to change wxFONTENCODING_SYSTEM with wxFONTENCODING_UTF8 in
the code above.
But this just makes WxPerl to pop up a window that tells:


Wx::SimpleApp: unknown encoding
No font for displaying text in encoding 'Unicode 8 bit (UTF-8)'
found.Would you like to select a font to be used for this encoding
(otherwise the text in this encoding will not be shown correctly)?
Yes No


So I created another small program to find which are the available
encodings:

use Wx ':everything';
use Data::Dump 'pp';
my $enum = Wx::FontEnumerator-new;
my @encodings = $enum-GetEncodings;
print pp \@encodings;

And the result was:

[
  WINDOWS-1250,
  WINDOWS-437,
  unknown-87,
  WINDOWS-1252,
  WINDOWS-1255,
  WINDOWS-1256,
  WINDOWS-1253,
  WINDOWS-1254,
  WINDOWS-1257,
  WINDOWS-1251,
  unknown--1,
  WINDOWS-874,
  unknown--1,
  WINDOWS-932,
  WINDOWS-949,
  unknown--1,
  WINDOWS-936,
  WINDOWS-950,
]

So there is no encoding that contains UTF-8 in its name.
Does this mean that WxPerl can't print UTF-8 texts?

Or there is something else I need to do?

In the same documentation page, when describing the constructor of the
Wx::Font object, it describes the encoding parameter as:


encoding

An encoding which may be one of
wxFONTENCODING_SYSTEM
wxFONTENCODING_DEFAULT
wxFONTENCODING_ISO8859_1...15
wxFONTENCODING_KOI8
wxFONTENCODING_CP1250...1252


In this list of possible encodings appear only these items, and no one
that includes UTF8.

Eventually, is there an example of writing text with a certain font that
supports UTF-8?

Thanks.

--Octavian





Re: Can we print UTF-8 chars in Wx::TextCtrl fields?

2013-04-29 Thread Mark Dootson

Hi,

If your Perl scalar contains UTF-8 encoded text and is marked as such, 
then you shouldn't need any decoding functions. (Well, that is how it is 
supposed to work. If it doesn't, it is a bug).


So, yes - if your scalars contain UTF-8 encoded text and are marked as 
such, that's all you should need.


Regards

Mark


On 29/04/2013 10:25, steveco.1...@gmail.com wrote:

Hi Mark,

Are you saying that you don't need some form of utf8 decode function in
wxPerl?

And that it should work perfectly without it?

Regards

Steve





Re: Can we print UTF-8 chars in Wx::TextCtrl fields?

2013-04-29 Thread Mark Dootson

Hi,

On 29/04/2013 20:06, Johan Vromans wrote:


I'd say this is the wrong approach. The solution is to adjust the
WXSTRING_PUT macro to check for the utf8 flag and handle accordingly.

-- Johan


That's exactly what it does, unless I've misunderstood.

Regards

Mark




Re: ComboBox and utf8

2013-04-28 Thread Mark Dootson

Hi,

Where a wxWidgets method expects a wxString, the translation from the 
Perl SV to a wxString uses the same code throughout the entire library.


As part of the translation, wxPerl checks if the SV you pass has the 
utf8 flag set.


The problem just might be that DBD::Pg is not returning what you think 
it is.


To check, in your code that fails when you pass $yourstring to a wxPerl 
method, do


utf8::upgrade($yourstring);

first.

If this fixes your problem, you have your answer.

Cheers

Mark


On 26/04/2013 12:39, Jiří Pavlovský wrote:

Hello,

I have a problem with ComboBox and utf8 data.
For example string Derviş is displayed like Dervi + 2 weird characters.

If I just create a test case, paste the mentioned string into the code
and 'use utf8' then it works.

But these strings are coming from db and DBD::Pg is set to convert them
to the perl internal encoding.

Also there seem no to be a problem with other controls.
Wx::Perl::ListCtrl displays it correctly.

Thanks.





Re: Alien::wxWidgets fails on 5.16.3 OSX 10.7

2013-04-24 Thread Mark Dootson

Hi,

The WiKi instructions are for forcing a 32 bit carbon build of wxWidgets 
2.8.12. They worked with XCode up to around 4.3 I think but some extras 
are required for latest XCode.


So, assuming you want to stick with your 32 bit Perl and wxWidgets 
2.8.12 you need to build Alien::wxWidgets from the command line with


perl Build.PL \
 --wxWidgets-version=2.8.12 \
 --wxWidgets-source=tar.gz \
 --wxWidgets-build=1 \
 --wxWidgets-build-opengl=1 \
 --wxWidgets-extraflags= CFLAGS='-arch i386' CXXFLAGS='-arch i386'
  CPPFLAGS='-arch i386' LDFLAGS='-arch i386'
  OBJCFLAGS='-arch i386' OBJCXXFLAGS='-arch i386'

--with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk 


  --with-macosx-version-min=10.6


You could also choose to build a 32 bit cocoa wxWidgets 2.9.4

perl Build.PL \
 --wxWidgets-version=2.9.4 \
 --wxWidgets-source=tar.bz2 \
 --wxWidgets-build=1 \
 --wxWidgets-build-opengl=1 \
 --wxWidgets-extraflags= CFLAGS='-arch i386' CXXFLAGS='-arch i386'
  CPPFLAGS='-arch i386' LDFLAGS='-arch i386'
  OBJCFLAGS='-arch i386' OBJCXXFLAGS='-arch i386'

--with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk 


  --with-macosx-version-min=10.6
  --with-osx_cocoa 



If you had built a standard 64 bit Perl for MacOSX the Alien::wxWidgets 
would have installed a 64 bit cocoa wxWidgets 2.9.4 without intervention 
from yourself. This is the default.



Regards

Mark






On 25/04/2013 00:35, breno wrote:

Hi Mark, hi everyone!

I know you probably sigh every time someone talks about this particular
subject on the list, but I also know you strive to make wxPerl awesome and
easy to install, so I had to share:

I was at the wiki (thanks for putting it back online!!) looking at the best
way to install WxPerl on a Mac. I have a OS X version 10.7.5, so here's
what I did:

perlbrew install perl-5.16.3 \
-Dcc=gcc \
-Dld=g++ \
-Dusethreads \
-Duseithreads \
-Duseshrplib \
-Accflags=-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
\
-Accflags=-mmacosx-version-min=10.6 \
-Accflags=-arch i386 -DUSE_SITECUSTOMIZE -Duselargefiles
-fno-merge-constants \
-Aldflags=-Wl,-search_paths_first -arch i386 \
-Aldflags=-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
-mmacosx-version-min=10.6 \
-Alddlflags=-Wl,-search_paths_first -arch i386 \
-Alddlflags=-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
-mmacosx-version-min=10.6

It installed ok. Just to make sure, here's the output of perl -V:
http://paste.scsys.co.uk/244097

The path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX,platform/Developer/SDKs/MacOSX10.7.sdk
exists on my system (which has Xcode 4.6.2 4H1003, btw).

However, when I tried installing Alien::wxWidgets, this is what I got:

http://paste.scsys.co.uk/244096

Any clues as to what exactly am I doing wrong?

Thanks! And thanks again for all the amazing work!

garu





Re: [rt.cpan.org #84634] old version of wxWidgets

2013-04-16 Thread Mark Dootson via RT
Tue Apr 16 03:53:01 2013: Request 84634 was acted upon.
Transaction: Correspondence added by mark.doot...@znix.com
   Queue: Alien-wxWidgets
 Subject: Re: [rt.cpan.org #84634] old version of wxWidgets
   Broken in: 0.64
Severity: Wishlist
   Owner: Nobody
  Requestors: cho...@cpan.org
  Status: new
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=84634 


Hi

On 14/04/2013 21:43, Alexandr Ciornii via RT wrote:


 Alien::wxWidgets should detect that installed version of wxWidgets is too old 
 and propose to fetch and install a new version.


Possibly. Alien::wxWidgets has never guaranteed any particular version 
of wxWidgets nor a wxWidgets built in any particular way. Perhaps by 
default Alien::wxWidgets should give you a fixed and predictable 
wxWidgets build. The issue needs fixing. I'm just undecided on how at 
this particular moment.




Re: [rt.cpan.org #84633] typo in message

2013-04-15 Thread Mark Dootson via RT
Mon Apr 15 20:16:26 2013: Request 84633 was acted upon.
Transaction: Correspondence added by mark.doot...@znix.com
   Queue: Wx
 Subject: Re: [rt.cpan.org #84633] typo in message
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: cho...@cpan.org
  Status: new
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=84633 


Hi,

On 14/04/2013 21:38, Alexandr Ciornii via RT wrote:

 Message is Alien::wxWidgets minimum supported version 2.007001 is missing.
 You will need to re-run Makefile.PL after it is installed..
 Shouldn't it be wxWidgets and version 2.7.1?

Indeed. Thanks for pointing this out.





Wx-0.9919 Released with IPC support

2013-04-14 Thread Mark Dootson

Hi,

Wx-0.9919 has been uploaded to CPAN with the addition of support for the 
Inter Process Communication classes wxServer, wxClient and wxConnection.


It is implemented using DDE on Windows and sockets on other platforms. 
You can use UNIX sockets or INET sockets on none Windows platforms - but 
UNIX sockets are recommended for many reasons.


One caveat to usage on Windows is that prior to Alien::wxWidgets 0.64 
(released yesterday) wxWidgets on Windows was built without IPC support 
so if you want IPC on Windows you will need to install and build 
wxWidgets / Alien::wxWidgets again before building Wx. On other 
platforms your existing wxWidgets install should be OK.


Many of the methods in wxWidgets take parameters of the style 
'databuffer, databuffersize'. For the wxPerl implementation there is no 
'databuffersize' param.


Nearly all available methods are covered in the attached ipcservice.pl 
file which includes code for both a server and a client.


Tested for wxWidgets 2.8.12 and 2.9.4 on Windows, Linux and MacOSX, it 
provides useful lightweight bi-directional messaging between wxPerl 
applications.


Note: don't use it for DDE conversations with MSExcel or whatever. You 
should use Win32::OLE instead.


The changes entry for the release is:

0.9919 Sat Apr 13 2013
- Makefile checks for supported Wx version
- Fixed wxUSE_DATAVIEWCTRL constant ( rt#84566 )
- wrapped wxRegionIterator
- wrapped IPC - wxConnection / wxServer / wxClient


I'll update the website, Citrus packages, PPMs and write a Wiki entry 
during the coming week.


Hope it helps.

Mark











#!/usr/bin/perl

# This example contains code for both a Server
# application and a Client application. The
# code is in the same file simply for
# convenience. Start a server app with.
#
# perl ipcservice.pl

# The server spawns a single client. You can
# start extra clients either using the button
# in the server app or from the command line:
#
# perl ipcservice.pl client
#
# The Server uses packages:
# MyServerConnection
# MyServer
# MyServerApp
# MyCommonFrame
# MyServiceHelper
#
# The Client uses packages
# MyClientConnection
# MyClient
# MyClientApp
# MyCommonFrame
# MyServiceHelper
# MyCustomEvent

use Wx::IPC;



package MyServiceHelper;



use strict;
use warnings;

sub new {
my $class = shift;
my $self = bless {}, $class;
return $self;
}

sub create_service_name {
my($self, $basename) = @_;
# Our service name will be a unix domain socket
# or an arbitrary DDE name on windows.
# We also have to end up with the same path
# on the client and the server, of course.

# We are going to have 1 instance only
# but it would be possible to create
# some form of scheme where multiple
# instances created some filesystem
# directory that a client could query
# for available running instances
# and their service names.

my $servicedir;

if( $^O =~ /^mswin/i ) {
require Win32;
my $FOLDER_LOCAL_APPDATA = 0x001C;
$servicedir = Win32::GetFolderPath($FOLDER_LOCAL_APPDATA, 1);
$servicedir = Win32::GetShortPathName($servicedir);
$servicedir =~ s/\\/\//g;
$servicedir .= '/wxIPC';
} elsif( $^O =~ /^darwin/i ) {
$servicedir = $ENV{HOME} . '/Library/Application Support/wxIPC';
} else {
$servicedir = $ENV{HOME} . '/.wxIPC';
}

mkdir($servicedir, 0700) unless -d $servicedir;
chmod(0700, $servicedir);
my $servicename = qq($servicedir/$basename);
return $servicename;
}



package MyServerConnection;


use strict;
use warnings;
use Wx qw( wxTheApp :ipc );
use base qw( Wx::Connection );
use Storable;

sub new {
my $class = shift;
my $self = $class-SUPER::new( @_ );
return $self;
}

sub clientid {
my $self = shift;
return $self-{_clientid} if defined($self-{_clientid});
$self-{_clientid} = 'clientid_' . Wx::NewId;
return $self-{_clientid};
}

sub OnExecute {
my($self, $topic, $data, $format) = @_;
Wx::LogMessage(qq(Server Received Execute : $topic : $data : $format ));
# This is only here for 2.8.x compatibility.
# On 2.9.x and above only override Exec
# In this example we'll just pass on to Exec in this
# module. (i.e. NOT SUPER);
return $self-OnExec($topic, $data);
}

sub OnExec {
my($self, $topic, $data) = @_;
Wx::LogMessage(qq(Server Received Exec : $topic : $data  ));
return 1;
}

sub OnPoke {
my($self, $topic, $item, $data, $format) = @_;
# differ handling based on $item value
if($item eq 'Poke Data') {
my $info = Storable::thaw($data);
Wx::LogMessage('Server Received Poked Data name: %s : clientpid: %s',
   $info-{name}, $info-{clientpid});
} else {
Wx::LogMessage(qq(Server Received Poke : $topic : $item: $data : $format ));
  

Re: Wx test failures on OSX Lion [SOLVED]

2013-04-08 Thread Mark Dootson

Hi

On 08/04/2013 04:57, Wallace Winfrey wrote:

On Thu, Apr 4, 2013 at 2:07 PM, Mark Dootson mark.doot...@znix.com wrote:


Google harder :-)


Are you referring to this thread?

http://www.nntp.perl.org/group/perl.wxperl.users/2012/02/msg8353.html

If so, I should have mentioned I had read it. I had also read this thread:

http://www.nntp.perl.org/group/perl.wxperl.users/2012/08/msg8492.html


Sorry Wallace, I wasn't really suggesting you had not tried hard enough. 
Google is always pot-luck. One point this is discussed is


http://www.nntp.perl.org/group/perl.wxperl.users/2012/12/msg8630.html

but that comes nowhere near the top of any reasonable search you might do.


Just so we're clear though, wxPerl at this point more or less needs a
custom build of wxWidgets 2.9.4, is that correct? Out of curiosity,
and I'm sure you've discussed this before, but - in your opinion, are
the deficiencies currently present in wxWidgets likely to remain in
the future?


It's a wxWidgets bug in 2.9.4 - already fixed in wxWidgets trunk, and it 
is that patch / code that Alien::wxWidgets uses.



If so, and maybe this is such an edge case that it's not worth the
effort, but would it be useful to alert the user to this condition
when they're building Alien::wxWidgets? Is it possible to test an
existing wxWidgets installation for the conditions that prevent a
successful Wx build (or make test, as the case may be) ?


I know that with my previous note you would not have asked this question 
but it is worth answering anyway. For this problem, it isn't possible to 
test without linking and running something against the wxWidgets library 
so that may as well be wxPerl.


Whether I should have put in a 'possible problem warning'? - probably 
but I'm fairly sure readers would never read it until the Wx build tests 
failed anyway and only then in a few cases. My excuse is that when 2.9.5 
is released this problem goes away.


Best Regards

Mark







Wx 0.9918 Released to CPAN

2013-04-04 Thread Mark Dootson

Hi,

Wx 0.9918 has been released and all binary distributions updated.

http://www.wxperl.it/2013/04/wx-09918-released.html

Cheers

Mark



[rt.cpan.org #84435] no matching function for call to wxFontEnumerator::GetEncodings

2013-04-04 Thread Mark Dootson via RT
Thu Apr 04 15:01:29 2013: Request 84435 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: no matching function for call to wxFontEnumerator::GetEncodings
   Broken in: 0.9918
Severity: Normal
   Owner: Nobody
  Requestors: cho...@cpan.org
  Status: new
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=84435 


Hi,

I've not been ensuring or testing wxWidgets-2.6 compatibility for quite some 
time. I think dropping 2.6 compatibility was discussed on the mailing list in 
early 2011.

I'll update the Makefile.PL in the next Wx release so it fails with an 
informative message early.

Thanks

Mark


On Thu Apr 04 14:44:52 2013, CHORNY wrote:
 Wx.c: In function ‘void XS_Wx__FontEnumerator_IsValidFacename(CV*)’:
 Wx.c:15104: error: ‘IsValidFacename’ is not a member of
 ‘wxFontEnumerator’
 Wx.c: In function ‘void
 XS_Wx__FontEnumerator_GetEncodingsMethod(CV*)’:
 Wx.c:15181: error: no matching function for call to
 ‘wxFontEnumerator::GetEncodings(wxString)’
 /usr/include/wx-2.6/wx/fontenum.h:76: note: candidates are:
 wxArrayString* wxFontEnumerator::GetEncodings()
 Wx.c: In function ‘void
 XS_Wx__FontEnumerator_GetEncodingsStatic(CV*)’:
 Wx.c:15209: error: no matching function for call to
 ‘wxFontEnumerator::GetEncodings(wxString)’
 /usr/include/wx-2.6/wx/fontenum.h:76: note: candidates are:
 wxArrayString* wxFontEnumerator::GetEncodings()
 Wx.c: In function ‘void
 XS_Wx__FontEnumerator_GetFacenamesMethod(CV*)’:
 Wx.c:15265: error: no matching function for call to
 ‘wxFontEnumerator::GetFacenames(wxFontEncoding, bool)’
 /usr/include/wx-2.6/wx/fontenum.h:71: note: candidates are:
 wxArrayString* wxFontEnumerator::GetFacenames()
 Wx.c: In function ‘void
 XS_Wx__FontEnumerator_GetFacenamesStatic(CV*)’:
 Wx.c:15301: error: no matching function for call to
 ‘wxFontEnumerator::GetFacenames(wxFontEncoding, bool)’
 /usr/include/wx-2.6/wx/fontenum.h:71: note: candidates are:
 wxArrayString* wxFontEnumerator::GetFacenames()
 
 





Re: Wx test failures on OSX Lion

2013-04-04 Thread Mark Dootson

Hi,

On 04/04/2013 20:43, Wallace Winfrey wrote:

I am trying to build Wx 0.9918 with my perlbrew-managed 5.16.2
(w/threads) install, and I get the following failures during the test.
Is there something I'm missing? The Google was unhelpful in assisting
me in my search for resolution.


Google harder :-)

Without seeing your full build output, this is a bit of a stab in the 
dark, but I'll guess you built and installed your own wxWidgets or are 
using the system installed wxWidgets?


Download the Alien wxWidgets source, extract and do

perl Build.PL

you want to build wxWidgets 2.9.4. This may not be the default if 
Alien::wxWidgets picks up some other build.


then
perl Build
perl Build test
perl Build install

After that your Wx build and install should work.

Reasons for failure - wxWidgets 2.9.4 is broken as far as wxPerl is 
concerned - Alien::wxWidgets build applies back-ported patches. 
wxWidgets series 2.8.x requires a lot of hoop jumping in your Perl Brew 
if you really want the 2.8.x wxWidgets version.


Regards

Mark



Re: use Wx 0.15 qw[:allclasses]; etc

2013-04-03 Thread Mark Dootson

Hi,

On 03/04/2013 17:00, Steve Cookson wrote:


Question 1: Does it really need two use stricts, clearly you can never
have enough, but doesn't the first one have a greater scope than the
second is not necessary.


I imagine in is just template code for a package that gets you the extra 
strict.



Question 2: on use Wx, again, doesn't the first use Wx just cause a
crash if you have wxWidgets less than 0.15, which is unlikely these
days, but use Wx qw[:everything]; should be enough?


It's a wiki entry:

http://wiki.wxperl.nl/WxEXPORTS

Also,

use Wx qw[ :everything ];

imports everything into the current namespace - which in your wxGlade 
example is 'package appointments'.


Let's imagine for a moment that instead of use Wx qw[ :allclasses]; at 
the top of the script it had use Wx qw[ :everything ]; there too.


Consider the exported constant wxBORDER_NONE.

You would have two instances of this:

main::wxBORDER_NONE
appointments::wxBORDER_NONE

and which, if any, got used when your code contained the bare 
wxBORDER_NONE would depend on package scope.


So in default package main, main::wxBORDER_NONE would get used, in 
package appointments, appointments::wxBORDER_NONE would get used. 
Anywhere else, bare wxBORDER_NONE is an error.



Cheers

Mark




















Re: Wx::DatePickerCtrl display issue.

2013-04-02 Thread Mark Dootson

Hi,

This is just an implementation detail. If you set the style flag 
wxDP_ALLOWNONE (as the wxperl_demo does ) then you will get the check 
box in Windows. There has to be a way for you to indicate 'no date' and 
using the native Windows control this would seem to be the only way.


On Linux, the control used there allows you to edit the date directly so 
you can simply delete the date and have an empty box to indicate no date.


It seems a bit of a clunky interface to me, but that's how it is 
implemented. If I had a reason to collect user input and a date field 
were optional, I think I'd use an entirely separate check box to 
indicate whether a date was included and enable/ disable a calnedar ctrl 
from that.


Hope it helps.

Mark

On 02/04/2013 13:49, Steve Cookson wrote:

Hi Guys,

My Wx::DatePickerCtrl is displaying a select tickbox next to it under
Windows.  Is this Normal?  I don't get it under Linux and I don't recall
having it under windows before.

Do you guys have it?

It's easily reproducible in wxperl_demo.pl under Wx::DatePickerCtrl

I get a control like this:

X dd/mm/

Where the 'X' is a tickbox.

What do you think?

Regards

Steve





Re: Formatting the Column Headers of a ListCtrl

2013-03-28 Thread Mark Dootson

Hi,

It isn't implemented in wxWidgets - probably because the library 
attempts to either use the native platform controls or mimic them as 
closely as possible. If you cannot do it with a native control, you most 
likely can't do it in wxWidgets. I doubt this is seen as a missing 
feature so you're unlikely to see it implemented in the future.


Wx::Grid is the way to go to do what you want.

By the way, I noticed on Perl Monks some information regarding how 
Wx::ListCtrl handles a large number of items.


For that you need to use the wxLC_VIRTUAL|wxREPORT style. See the 
Wx::Demo where the virtual list control reports 100,000 items.


For a Wx::Grid control with a large number of items, you should use a 
custom Wx::GridTable. The example in Wx::Demo reports 100,000 columns by 
100,000 rows.


Hope it helps. Sorry no positive answer on the column formatting.

Regards

Mark


On 28/03/2013 23:40, James Lynes wrote:

Steve:

Thanks for taking a look! I haven't found anything else either. I think
it's a long standing issue.

I did mock-up an alternate solution using wxGrid(attached). It's a lot
more visually flexible, but not sure if it will fit into the  OPs plans.
We'll see.

Thanks again, James


On Thu, Mar 28, 2013 at 3:06 PM, steveco.1...@gmail.com
mailto:steveco.1...@gmail.com wrote:

__
Good Afternoon Florida,
Hi James, I've had a look at your code thinking that it was an easy
fix and I have the same as you.
I guess the silence from other quarters implies that they too
haven't found anything else.
I can't really spend any more time on this now, but if I do get a
minute I'll have another look.
Good luck,
Regards
Steve


*From:* James Lynes [mailto:jmlyne...@gmail.com
mailto:jmlyne...@gmail.com]
*Sent:* 27 March 2013 15:42
*To:* wxperl-users@perl.org mailto:wxperl-users@perl.org
*Subject:* Formatting the Column Headers of a ListCtrl

Good Afternoon(in Florida at least):

I have been trying to help a Perl Monks poster with the question:
How do you change the color and font of a ListCtrl column header?
It's been interesting archeology so far!

It seems that Wx::ListItem-SetTextColour
-SetBackgroundColour
-SetFont
calls don't work when applied to a ListCtrl::InsertColumn(col, item)
call. They work fine when applied to an item. SetText and SetWidth
also work fine with InsertColumn.

I found a post on the wxWidgets wiki saying as much and suggesting a
work around of setting the color and font on the ListCtrl and then
changing the color and font of the items as they are created. This
kinda works except for setting the background of the column header.
The font, font size and text color do get set as directed(on my
CitrusPerl 5.16/2.8x installation). And the items get set as
directed. See the attached test code.

Is this issue fixed in 2.9.x? Any other ideas on changing the
column header font/text color/background color? Any better work-arounds?

Thanks for your time and experience.

James








Update to wxPerl Web Site

2013-03-07 Thread Mark Dootson

All,

I've updated the wxPerl web site links to a new site as explained here:

http://www.wxperl.it/2013/03/wxperl-online-pages-update.html

This makes it much simpler for me to update the site regularly.

As noted in the post above, the old pages have not gone away and can be 
accessed at


http://wxperl.sourceforge.net/home.html

Regards

Mark



Re: Update to wxPerl Web Site

2013-03-07 Thread Mark Dootson

Hi,

On 07/03/2013 22:42, steveco.1...@gmail.com wrote:


Is this now the wxPerl main homepage?


Yes it is. Existing links should redirect there OK.

I hope to post useful stuff regularly.

wxPerl has also started tweeting notifications and updates as @wxPerl

  :-)

Regards

Mark


Re: Update to wxPerl Web Site

2013-03-07 Thread Mark Dootson

Hi,

On 08/03/2013 07:32, Johan Vromans wrote:

Mark Dootson mark.doot...@znix.com writes:


wxPerl has also started tweeting notifications and updates as @wxPerl


Is it possible (an irssi plugin?) to inject these tweets into the wxperl
irc?

-- Johan



I have no idea but will investigate in due course. Hopefully someone 
else will have the answer.


Re: Getting information from EVT_LIST_ITEM_RIGHT_CLICK

2013-03-05 Thread Mark Dootson

Oops!

Attached updated code uses ListCtrl-GetItemRect to determine correct 
offset when control is scrolled.


Cheers

Mark

On 05/03/2013 20:14, Dave Hayes wrote:

On 02/04/13 19:45, Mark Dootson wrote:

Hi,

A small update to previous code. On wxGTK EVT_LIST_ITEM_RIGHT_CLICK
events are generated even if a right click in the wxListCtrl is not on
an item. Amended attachment handles this.



I've run into a bug with your implementation.

If you add enough columns to invoke the horizontal scrollbar, this
breaks what you wrote. Instead, columns will be reported with 0 being
the visible scrolled column, which is not the actual column.

Googling around a bit seems to indicate that it's impossible to get a
scroll event from a ListCtrl at 2.8. So how would I detect that the
ListCtrl is scrolled horizontally?
#
# Description:  wxListCtrl Test
# Created   Mon Feb 04 15:01:53 2013
# svn id$Id:$
# Copyright:Copyright (c) 2013 Mark Dootson
# Licence:  This program is free software; you can redistribute it 
#   and/or modify it under the same terms as Perl itself
#

package MainWindow;
use strict;
use warnings;
use Wx qw( :id :misc :window :sizer :panel :listctrl );
use base qw( Wx::Frame );
use Wx::Event qw(
EVT_LIST_ITEM_SELECTED EVT_LIST_ITEM_DESELECTED
EVT_LIST_ITEM_ACTIVATED EVT_LIST_ITEM_FOCUSED
EVT_LIST_ITEM_RIGHT_CLICK 
);


sub new {
my $class = shift;
my $self = $class-SUPER::new( @_ );

my $mainpanel = Wx::Panel-new($self, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxBORDER_NONE );
my $list = Wx::ListCtrl-new($mainpanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL  );
my $mainsizer = Wx::BoxSizer-new(wxVERTICAL);
my $panelsizer = Wx::BoxSizer-new(wxVERTICAL);

$panelsizer-Add($list,1,wxALL|wxEXPAND, 0);
$mainpanel-SetSizer($panelsizer);
$mainsizer-Add($mainpanel,1,wxALL|wxEXPAND, 0);
$self-SetSizer($mainsizer);

for (my $i = 0; $i  9; $i++) {
$list-InsertColumn($i, qq(Col $i), wxLIST_FORMAT_LEFT, 100);
}

for (my $i = 0; $i  40; $i++) {
$list-InsertStringItem($i, qq(R${i}C0));
for(my $n = 1; $n  9; $n++ ) {
$list-SetItem($i, $n, qq(R${i}C${n}));
}
}

EVT_LIST_ITEM_SELECTED($self, $list, \OnItemSelected);
EVT_LIST_ITEM_DESELECTED($self, $list, \OnItemDeselected);
EVT_LIST_ITEM_ACTIVATED($self, $list, \OnItemActivated);
EVT_LIST_ITEM_FOCUSED($self, $list, \OnItemFocused);
EVT_LIST_ITEM_RIGHT_CLICK($self, $list, \OnItemRightClick);

return $self;
}

sub OnItemSelected {
my($self, $event) = @_;
$event-Skip(1);

print q(EVT_LIST_ITEM_SELECTED) . qq(\n);

}

sub OnItemDeselected {
my($self, $event) = @_;
$event-Skip(1);

print q(EVT_LIST_ITEM_DESELECTED) . qq(\n);
}

sub OnItemActivated {
my($self, $event) = @_;
$event-Skip(1);

print q(EVT_LIST_ITEM_ACTIVATED) . qq(\n);
}

sub OnItemFocused {
my($self, $event) = @_;
$event-Skip(1);

print q(EVT_LIST_ITEM_FOCUSED) . qq(\n);
}

sub OnItemRightClick {
my($self, $event) = @_;
$event-Skip(1);
print q(EVT_LIST_ITEM_RIGHT_CLICK) . qq(\n);

my $listctrl  = $event-GetEventObject;
my $point = $event-GetPoint();

my ($itemindex, $flags, $subindex) = $listctrl-HitTest($point);

# return if not valid $itemindex;
return if (!defined($itemindex) || $itemindex == -1 );

if( !Wx::wxMSW() ) {
# $subindex only populated on wxMSW
$subindex = $self-_get_generic_subitem( $itemindex, $listctrl, $point );
}

print qq($itemindex, $flags, $subindex\n);
my $text = $listctrl-GetItem($itemindex, $subindex)-GetText;
print qq(Right clicked text: $text\n);
}

sub _get_generic_subitem {
my($self, $itemindex, $listctrl, $point) = @_;

# iterate through columms and check if $point-x is within that column width

# offset for scrolled content
my $offsetrect = $listctrl-GetItemRect($itemindex);
my $left = $offsetrect-x;

for(my $i = 0; $i  $listctrl-GetColumnCount; $i ++) {
my $right = $left + $listctrl-GetColumnWidth($i);
if($point-x = $left  $point-x = $right) {
return $i;
} else {
$left = $right + 1;
}
}

Wx::LogError('Could not determine column in right click');
return 0;
}


package Application;
use strict;
use warnings;
use Wx;

use base qw( Wx::App );


sub OnInit {
my $self = shift;

my $mwin = MainWindow-new(undef, -1, 'Test wxListCtrl' );

$self-SetTopWindow($mwin);
$mwin-Show(1);
}

package main;

my $app = Application-new;
$app-MainLoop;


1;


SVN Repository Change

2013-03-04 Thread Mark Dootson

All,

Yesterday I upgraded the sourceforge tools to the current versions. An 
unexpected effect of this was that the URLs for the repository changed.


The web site has been updated with the new URLs but for info the new 
command to checkout for example the wxPerl trunk to wxperl-trunk is


svn co https://svn.code.sf.net/p/wxperl/code/wxPerl/trunk wxperl-trunk

anonymous checkout would be

svn co http://svn.code.sf.net/p/wxperl/code/wxPerl/trunk wxperl-trunk

The browse root for all wxPerl related source is

http://sourceforge.net/p/wxperl/code

The old URLs still seem to work - but they will not contain any commits 
since the change over.


Regards

Mark


Re: CitrusPerl release 5.16.1

2013-02-28 Thread Mark Dootson

Hi,

On 28/02/2013 09:36, Johan Vromans wrote:

Mark Dootson mark.doot...@znix.com writes:


Citrus Perl downloads are back with the release of Citrus Perl 5.16.1.


Any plans for 5.16.2?



I was waiting around for Perl 5.18 - but I suppose that may be a few 
months away.


I'll look at re-rolling Citrus and all the Wx PPMs with the latest Wx 
over the next couple of weeks.


Regards

Mark


Re: SetTextColor on Wx::MenuItem?

2013-02-27 Thread Mark Dootson

Hi,

Are you on Windows? SetTextColour is only available on wxMSW.

Assuming the code below is not a direct copy paste, are you sure you're 
using


SetTextColour

and not

SetTextColor


Regards

Mark

On 27/02/2013 23:15, Dave Hayes wrote:

This is odd...

  $ perl
  use Wx qw(:everything);
  my $menuitem = Wx::MenuItem-new($menu, Wx::NewId(), '', '',
wxITEM_SEPARATOR);
  $menuitem-SetTextColour();
  Can't locate object method SetTextColour via package Wx::MenuItem
at - line 3.

I see this function in the XS file so...I'm curious why this doesn't work?


Re: Wx Test Failures with 2.9.4 on Strawberry Perl

2013-02-26 Thread Mark Dootson

Hi,

On 22/02/2013 12:32, Smylers wrote:


If I compile Wx using Strawberry 5.14.3, should that module then work if
deployed to something still on 5.14.2.1?


I think you may encounter problems. I'm almost certain that the libgcc 
and libstdc++ that your Wx/wxWidgets will need to load cannot coexist in 
the same process with the libgcc that your Perl will have loaded. You 
could try, but I would expect it to fail.



Smylers

[*1] Ironically I chose Dwim Perl over Strawberry was because it comes
with Wx, so I thought that would make life simpler. Unfortunately
wxWidgets 2.8 has some regressions in terms of user interface behaviour
when compared with the ancient version people were using, so it turns
out I don't want to use the Wx that comes with Dwim Perl anyway ...


You could check with Gabor when he intends the next release of Dwim 
Perl. I imagine he will wait for Perl / Strawberry 5.18 at this point in 
time.


If you have many users, and you are happy compiling your own wxWidgets / 
Wx, I would recommend distributing them using PAR::Dist; On Windows, 
creating a PAR distribution is a 1-liner, as is the installation command 
for end users. Of course, you'd have to switch to a different release of 
Strawberry.


A final possibility - you may be able to fix your issues with the 2.8 
version of wxWidgets. What are the issues you have exactly? For example, 
the default build with Alien::wxWidgets includes version 2.6 
compatibility, but you can switch that off at compile time.


Regards

Mark


Re: Wx Test Failures with 2.9.4 on Strawberry Perl

2013-02-21 Thread Mark Dootson

Hi,

You need a more recent Strawberry.

5.14.2.1 (November 2011) as included with DWIM Perl contains a gcc tool 
chain that is not compatible with Wx / wxWidgets 2.9.x builds.


5.14.3 (October 2012) onwards or any 5.16 Strawberry release are compatible.

I'm sure the issue is to do with C++ exception handling in wxWidgets 
2.9.x and using SJLJ exceptions.


The gcc in 5.14.2.1 always links the C++ library statically which 
invariably causes problems with exceptions across dlls.


As gcc on Windows from 4.5.x onwards solves this problem and current 
Strawberry releases have a compatible gcc (4.6.3), it is not on my list 
to noodle around with this further.


Regards

Mark

On 21/02/2013 16:44, Smylers wrote:

The Wx module's tests are failing for me with wxWidgets 2.9.4 on Dwim
Perl (which is Strawberry Perl 5.14 bundled with some other stuff) on
Windows 7.

Any suggestions for fixing this (or the next step in debugging it)
gratefully received.

I built and installed wxWidgets 2.9.4 using the Alien::wxWidgets module,
and that all went fine. Then I set WXDIR and WXWIN, and compiling the Wx
module (version 0.9917) appears to go OK. But then some of the tests
fail -- full output pasted at the end. For each failing test program a
Windows error window pops up saying 'perl.exe has stopped working:
Windows is collecting more information about the problem'.

Running prove directly on the first .t file that files _mostly_ gives
this output (along with one of those perl.exe crash windows):

   C:\Dwimperl\perl\bin\perl C:\Dwimperl\perl\bin\prove.bat -v t\03_event.t
   t\03_event.t ..
   1..17
   ok 1 - event succesfully received
   ok 2 - no object destroyed
   ok 3 - still no object destroyed
   Dubious, test returned 5 (wstat 1280, 0x500)
   Failed 14/17 subtests

   Test Summary Report
   ---
   t\03_event.t (Wstat: 1280 Tests: 3 Failed: 0)
 Non-zero exit status: 5
 Parse errors: Bad plan.  You planned 17 tests but ran 3.
   Files=1, Tests=3,  2 wallclock secs ( 0.09 usr +  0.17 sys =  0.27 CPU)
   Result: FAIL

However, on a few attempts it has successfully run all 17 tests and
given a PASS at the end -- even when run consecutively just by pressing
Up then Enter, a FAIL may be followed by a PASS or vice versa.

   dmake test
   dmake:  Warning: -- Found file corresponding to virtual target 
[cpp\ovl_const.cpp].
   dmake:  Warning: -- Found file corresponding to virtual target 
[cpp\ovl_const.h].
   C:\Dwimperl\perl\bin\perl.exe -MExtUtils::Command::MM -e test_harness(0, 
'blib\lib', 'blib\arch') t/*.t
   t/01_load.t ... ok
   t/02_inheritance.t  ok
   t/03_event.t .. Dubious, test returned 5 (wstat 1280, 0x500)
   Failed 14/17 subtests
   t/04_userdata.t ... ok
   t/05_timer.t .. ok
   t/06_loadxpm.t  ok
   t/07_overload.t ... ok
   t/08_ovl_func.t ... Dubious, test returned 5 (wstat 1280, 0x500)
   Failed 230/230 subtests
   t/09_create_delete.t .. Dubious, test returned 5 (wstat 1280, 0x500)
   Failed 8/8 subtests
   t/10_oor.t  Dubious, test returned 5 (wstat 1280, 0x500)
   Failed 42/58 subtests
   t/11_twostage.t ... Dubious, test returned 5 (wstat 1280, 0x500)
   Failed 2/2 subtests
   t/12_pod.t  skipped: Author tests
   t/13_nbksizer.t ... Dubious, test returned 5 (wstat 1280, 0x500)
   All 3 subtests passed
   t/14_eh_die.t . Dubious, test returned 5 (wstat 1280, 0x500)
   All 6 subtests passed
   t/15_threads.t  ok
   t/16_stream.t . Dubious, test returned 5 (wstat 1280, 0x500)
   Failed 8/8 subtests
   t/17_thread_evt.t . Dubious, test returned 5 (wstat 1280, 0x500)
   All 2 subtests passed
   t/18_unicode.t  Dubious, test returned 5 (wstat 1280, 0x500)
   All 12 subtests passed
   (less 4 skipped subtests: 8 okay)
   t/19_overlay.t  Dubious, test returned 5 (wstat 1280, 0x500)
   All 1 subtests passed
   t/20_ctx_threads.t  skipped: no GraphicsContext
   t/21_locale.t . ok
   t/22_interface.t .. Dubious, test returned 5 (wstat 1280, 0x500)
   All 1 subtests passed
   t/zz_distrib.t  skipped: Author tests

Doing exactly the same thing with wxWidgets 2.8.12 works fine, with all
tests passing. (I compiled both versions at once in different
directories, using local::lib to keep them separate, so am reasonably
confident I used the same commands with each.)

I only deviated from Wx's INSTALL.pod in using dmake (which seems to
come with Strawberry Perl) rather than nmake (which doesn't).

Here's the full test output:

   Test Summary Report
   ---
   t/03_event.t(Wstat: 1280 Tests: 3 Failed: 0)
 Non-zero exit status: 5
 Parse errors: Bad plan.  You planned 17 tests but ran 3.
   t/04_userdata.t (Wstat: 0 Tests: 65 Failed: 0)
 TODO passed:   25, 33, 41, 57
   t/08_ovl_func.t (Wstat: 1280 Tests: 0 Failed: 0)
 Non-zero exit status: 5
 Parse errors: Bad plan.  You planned 230 

Re: Modality and new windows

2013-02-15 Thread Mark Dootson

Hi,

I should just add regarding Wx::PlComboPopup usage, the C++ class 
wxComboPopup has the protected member m_combo that allows you to access 
the wxComboCtrl. In wxPerl that is available via:


$cmbpopup-GetComboCtrl;

I should add a line using that to the demo.

Cheers

Mark


Any views on locale handling and wxWidgets 2.9.0

2013-02-05 Thread Mark Dootson

Hi All,

As raised in a recent Wx bug ticket, wxWidgets from version 2.9.0 
automatically sets the locale to the users current locale. Formally in 
wxWidgets 2.8.x, the locale by default was 'C'.


The problem arises because in addition to loading gettext translation 
files, the wxWidgets implementation for SetLocale also calls the C 
library setlocale() function. This affects printf, sprintf et al.


A problem therefore arises in that perl makes calls to standard C 
library functions when formatting numbers ( this is regardless of any 
'use locale', or 'no locale' statements. ) Number formatting always uses 
underlying C library functions. The statements 'use locale', or 'no 
locale' make no difference here.


So, if my locale is 'de' then when Wx starts, the C library locale gets 
set accordingly.


my $var = 8.3;
print $var;

will output 8,3 to the terminal. Formatting uses ',' as the fractional 
separator.


Within $var the string representation will be '8,3'

This, whilst possibly correct, isn't what Perl users will be expecting 
at all.


Therefore, I have a fix in SVN code that overrides the automatic setting 
of locale ( by the method suggested in wxWidgets docs ) - so by default 
it remains at LC_ALL = 'C'.


I think wxPerl users would do 99% of I/O via Perl so I don't think 
there's a lot of scope for this approach to cause many problems in the 
wxWidgets libraries.


If you want to set the locale you can do so explicitly.
You can then also reset just the locale for number formatting to 'C' if 
that is what you require as suggested in the original bug post.


use POSIX qw( setlocale, LC_NUMERIC );
.
setlocale(LC_NUMERIC, 'C');

This code applies equally regardless of which wxWidgets version is being 
used.


Anyone feel strongly that we shouldn't adopt this approach?

Regards

Mark














Re: wxLC_VIRTUAL and EVT_LIST_ITEM_RIGHT_CLICK

2013-02-05 Thread Mark Dootson

Hi Jeff,

On 05/02/2013 10:50, Jeff wrote:

Thanks Mark.
Yes, we are using virtual.  Did I mention  we get around that by sensing
key EVT_KEY_UP and checking if GetKeyCode is 306. If it is we call our
item selected callback.


Interesting.

I found I needed the code below in a virtual list ctrl class to handle 
common cases I came across. The control intercepts mouse and keyboard 
events and then raises its own event that a parent window can connect to.


#-
# Selection Change Event Handling
#-

sub _get_selected_key {
my $self = shift;
my $selectedkey = $self-GetSelectedItemCount . 'k' . 
$self-GetFirstSelected;

return $selectedkey;
}

sub OnItemSelected {
my($self, $event) = @_;
$event-Skip(1);

if(!$self-HasFlag(wxLC_SINGLE_SEL)) {
my $previousitem = $self-cpmousedownflag;
$self-cpmousedownflag(-1);
return if ($self-GetFirstSelected == $previousitem);
}

my $newevent = CP::Wx::Event::VirtualSelection-new($self-GetId);
$self-AddPendingEvent($newevent);
}

sub OnItemDeselected {
my($self, $event) = @_;
$event-Skip(1);
my $newevent = CP::Wx::Event::VirtualSelection-new($self-GetId);
$self-AddPendingEvent($newevent);
}

sub OnMouseDown {
my($self, $event) = @_;
$event-Skip(1);

$self-cpmousedownflag(-1);

my($item, $flags) = $self-HitTest( $event-GetPosition );

if($item == Wx::wxNOT_FOUND) {
# make deselection work
if($self-ClearSelections) {
if(!$self-HasFlag(wxLC_SINGLE_SEL)) {
my $newevent = Wx::CommandEvent-new( 
cpEVT_ID_VIRTUAL_KEYBOARD, $self-GetId );

$newevent-SetString($self-_get_selected_key);
$self-AddPendingEvent($newevent);
}
}
return;
}

return if $self-HasFlag(wxLC_SINGLE_SEL);

# suppress spurious item selection events on multiple clicks

if(   ( $self-GetSelectedItemCount == 1 )
( $self-IsSelected($item) )
   ) {
$self-cpmousedownflag($item);
} else {
$self-cpmousedownflag(-1);
}

# If Mouse Action may result in a multiple selection,
# we need to raise an event

if($event-ShiftDown  $event-LeftDown ) {
my $newevent = CP::Wx::Event::VirtualSelection-new($self-GetId);
$self-AddPendingEvent($newevent);
}

return;
}

sub OnKeyboardInput {
my($self, $event) = @_;
$event-Skip(1);
return if $self-HasFlag(wxLC_SINGLE_SEL);

given( $event-GetKeyCode ) {
when( [ WXK_LEFT, WXK_RIGHT, WXK_UP, WXK_DOWN, WXK_SCROLL, 
WXK_PAGEUP, WXK_PAGEDOWN, WXK_END, WXK_HOME ] ) {

my $modifiers = $event-GetModifiers;
if($modifiers == wxMOD_SHIFT) {
my $newevent = Wx::CommandEvent-new( 
cpEVT_ID_VIRTUAL_KEYBOARD, $self-GetId );

$newevent-SetString($self-_get_selected_key);
$self-AddPendingEvent($newevent);
}
}
default {
# do nothing
}
}
}

sub OnVirtualKeyboard {
my($self, $event) = @_;
if($event-GetString ne $self-_get_selected_key) {
my $newevent = CP::Wx::Event::VirtualSelection-new($self-GetId);
$self-AddPendingEvent($newevent);
}
}


Re: Getting information from EVT_LIST_ITEM_RIGHT_CLICK

2013-02-04 Thread Mark Dootson

Hi,

On 31/01/2013 22:41, Dave Hayes wrote:

Hello. I'm trying to get the text, column, and item index on a right
click in a Wx::ListCtrl. The item index works perfectly. However, I
can't seem to get any other information. Here's a very abbreviated idea
of what I am doing:


I can answer this by pulling a couple of 'rabbits out of a hat' in the 
form of undocumented method calling and some extra code for none wxMSW 
platforms.


The method $event-GetPoint() will return the mouse position.

The method $listctrl-HitTest($point) actually returns three items, the 
third of which is the subitem, or column index.


The method $listctrl-GetItem actually accepts two params, the second 
being the column number (default 0).


So to get the column text that was clicked the following ought to work:

my $point = $event-GetPoint();
my $listctrl = $event-GetEventObject;
my($itemindex, $flags, $subitemindex) = $listctrl-HitTest($point);
my $text = $listctrl-GetItem($itemindex, $subitemindex)-GetText;
print qq(Right clicked text: $text\n);

Alas, the third return item from $listctrl-HitTest is only implemented 
on Windows, so we need a separate method to determine the column clicked 
on wxGTK for example. It is quite simple to implement - an 
implementation is contained in the attached code.


Hope it helps.

Regards

Mark
#
# Description:  wxListCtrl Test
# Created   Mon Feb 04 15:01:53 2013
# svn id$Id:$
# Copyright:Copyright (c) 2013 Mark Dootson
# Licence:  This program is free software; you can redistribute it 
#   and/or modify it under the same terms as Perl itself
#

package MainWindow;
use strict;
use warnings;
use Wx qw( :id :misc :window :sizer :panel :listctrl );
use base qw( Wx::Frame );
use Wx::Event qw(
EVT_LIST_ITEM_SELECTED EVT_LIST_ITEM_DESELECTED
EVT_LIST_ITEM_ACTIVATED EVT_LIST_ITEM_FOCUSED
EVT_LIST_ITEM_RIGHT_CLICK 
);


sub new {
my $class = shift;
my $self = $class-SUPER::new( @_ );

my $mainpanel = Wx::Panel-new($self, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxBORDER_NONE );
my $list = Wx::ListCtrl-new($mainpanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL  );
my $mainsizer = Wx::BoxSizer-new(wxVERTICAL);
my $panelsizer = Wx::BoxSizer-new(wxVERTICAL);

$panelsizer-Add($list,1,wxALL|wxEXPAND, 0);
$mainpanel-SetSizer($panelsizer);
$mainsizer-Add($mainpanel,1,wxALL|wxEXPAND, 0);
$self-SetSizer($mainsizer);

my @data = (
[qw ( R0CO ROC1 ROC2 ) ],
[qw ( R1CO R1C1 R1C2 ) ],
[qw ( R2CO R2C1 R2C2 ) ],
);

$list-InsertColumn(0, 'Col 0', wxLIST_FORMAT_LEFT, 100);
$list-InsertColumn(1, 'Col 1', wxLIST_FORMAT_LEFT, 100);
$list-InsertColumn(2, 'Col 2', wxLIST_FORMAT_LEFT, 100);

for (my $i = 0; $i  @data; $i++) {
$list-InsertStringItem($i, $data[$i]-[0]);
$list-SetItem($i, 1, $data[$i]-[1]);
$list-SetItem($i, 2, $data[$i]-[2]);
}

EVT_LIST_ITEM_SELECTED($self, $list, \OnItemSelected);
EVT_LIST_ITEM_DESELECTED($self, $list, \OnItemDeselected);
EVT_LIST_ITEM_ACTIVATED($self, $list, \OnItemActivated);
EVT_LIST_ITEM_FOCUSED($self, $list, \OnItemFocused);
EVT_LIST_ITEM_RIGHT_CLICK($self, $list, \OnItemRightClick);

return $self;
}

sub OnItemSelected {
my($self, $event) = @_;
$event-Skip(1);

print q(EVT_LIST_ITEM_SELECTED) . qq(\n);

}

sub OnItemDeselected {
my($self, $event) = @_;
$event-Skip(1);

print q(EVT_LIST_ITEM_DESELECTED) . qq(\n);
}

sub OnItemActivated {
my($self, $event) = @_;
$event-Skip(1);

print q(EVT_LIST_ITEM_ACTIVATED) . qq(\n);
}

sub OnItemFocused {
my($self, $event) = @_;
$event-Skip(1);

print q(EVT_LIST_ITEM_FOCUSED) . qq(\n);
}

sub OnItemRightClick {
my($self, $event) = @_;
$event-Skip(1);
print q(EVT_LIST_ITEM_RIGHT_CLICK) . qq(\n);
my $point = $event-GetPoint();
my $listctrl = $event-GetEventObject;

my($itemindex, $flags, $subitemindex) = $listctrl-HitTest($point);

if( !Wx::wxMSW() ) {
# $subitemindex only populated on wxMSW
$subitemindex = $self-_get_generic_subitem( $listctrl, $point );
}

print qq($itemindex, $flags, $subitemindex\n);
my $text = $listctrl-GetItem($itemindex, $subitemindex)-GetText;
print qq(Right clicked text: $text\n);
}

sub _get_generic_subitem {
my($self, $listctrl, $point) = @_;

# iterate through columms and check if $point-x is within that column width

my $left = 0;
for(my $i = 0; $i  $listctrl-GetColumnCount; $i ++) {
my $right = $left + $listctrl-GetColumnWidth($i);
if($point-x = $left  $point-x = $right) {
return $i;
} else

Re: Getting information from EVT_LIST_ITEM_RIGHT_CLICK

2013-02-04 Thread Mark Dootson

Hmmm,

Regarding wxListCtrl event occurrence and ordering, upon investigation I 
find differences between wxMSW and wxGTK. These probably won't affect 
you at all, but it does mean the event order in a previous post was not 
necessarily correct.


On wxMSW, if you click on a single item that is already selected,

EVT_LIST_ITEM_FOCUSED EVT_LIST_ITEM_SELECTED are not raised ( as you 
might expect as the focus and selection have not changed )


On wxGTK, however, you get

EVT_LIST_ITEM_DESELECTED
EVT_LIST_ITEM_FOCUSED
EVT_LIST_ITEM_SELECTED

all for the same item. So on wxGTK, clicking on an already selected 
item, when it is the only selected item,  produces the above three 
events whilst on wxMSW none are raised.


I've never noticed this before, as there's no reason you would - the 
event handlers would just run somewhat unnecessarily. But it does make 
the original note below untrue.


Perhaps more notably, if you are in multi select mode, the order of EVTs 
and EVTs raised are different on different platforms.


So, if on wxMSW item 0 is selected and I select item 1 using shift+ 
left-click, I get


EVT_LIST_ITEM_SELECTED
EVT_LIST_ITEM_FOCUSED

for item 1.

However, on wxGTK I get the events in reverse order

EVT_LIST_ITEM_FOCUSED
EVT_LIST_ITEM_SELECTED

Again, it should not affect most code - but you may have made 
assumptions about EVT_LIST_ITEM_FOCUSED and EVT_LIST_ITEM_SELECTED being 
received in a certain order - which would be wrong. The basic reason for 
these differences is that on wxMSW, wxListCtrl is a wrapper for a native 
MS Windows control. On wxGTK it is a generic wxWidgets implementation.


Regards

Mark


On 05/02/2013 04:31, Mark Dootson wrote:


For reference, in a wxListCtrl if you handle EVT_LEFT_DOWN, EVT_LEFT_UP,
and EVT_LEFT_DCLICK and NONE of these handlers call $event-Skip(1), the
following events are raised in order:
(

EVT_LEFT_DOWN
EVT_LEFT_UP
EVT_LEFT_DCLICK
EVT_LEFT_UP

If you put an $event-Skip(1) in EVT_LEFT_DOWN you get
EVT_LEFT_DOWN
EVT_LIST_ITEM_FOCUSED
EVT_LIST_ITEM_SELECTED
EVT_LEFT_DCLICK
EVT_LEFT_UP

If you also put an $event-Skip(1) in EVT_LEFT_DCLICK you get
EVT_LEFT_DOWN
EVT_LIST_ITEM_FOCUSED
EVT_LIST_ITEM_SELECTED
EVT_LEFT_DCLICK
EVT_LIST_ITEM_ACTIVATED
EVT_LEFT_UP

Note that in these examples, the EVT_LIST_ITEM_xx handlers all have
$event-Skip(1) in them.


Hope it helps

Regards

Mark


On 01/02/2013 20:24, steveco.1...@gmail.com wrote:

Hi Guys,

Actually, I'm quite interested in this discussion too.  I'm having
difficulty distinguishing between EVT_LIST_ITEM_SELECTED and
EVT_LIST_ITEM_ACTIVATED.

If the user single-clicks (EVT_LIST_ITEM_SELECTED), then I want the
user to
enter an event handler dialogue that presents options with defaults.

If the user presses double-clicks (EVT_LIST_ITEM_ACTIVATED), then I
want the
user to enter an event handler without a dialogue that takes the defaults
automatically.

What I get with single or double click, is that single click is always
entered.

I guess it's always triggered by the first click of the double click,
but it
makes it hard to work out what the user intended.

Any ideas, or do I have to find another way around this.

Regards

Steve
-Original Message-
From: Mark Dootson [mailto:mark.doot...@znix.com]
Sent: 01 February 2013 01:16
To: wxperl-users@perl.org
Subject: Re: Getting information from EVT_LIST_ITEM_RIGHT_CLICK

Hi,

EVT_LIST_COL_RIGHT_CLICK - my wrong - sorry.

I'll take a look at this tomorrow.

On 01/02/2013 02:26, Dave Hayes wrote:

On 01/31/13 16:29, Mark Dootson wrote:

Wrong EVT

See EVT_LIST_COL_RIGHT_CLICK


Er, ok. I tried that one and it doesn't send an event unless I click on
the column label at the top. I'm using 2.8.12 if that helps.

I actually enabled both COL_RIGHT_CLICK and ITEM_RIGHT_CLICK to tell.




[rt.cpan.org #83110] Wx 2.9 manipulates locale

2013-02-04 Thread Mark Dootson via RT
Tue Feb 05 02:39:58 2013: Request 83110 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: Wx 2.9 manipulates locale
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: taun...@cpan.org
  Status: new
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=83110 


Hi,

The difference is, as you suggest, that wxWidgets 2.9.x now sets the 
application locale on start-up to the user's current locale.
It does this by calling the C library setlocale() function as
setlocale(LC_ALL, );

After reading through perllocale I have the opinion that your solutionis 
the correct one if you don't want locale formatting for numbers.

So,

use POSIX qw( setlocale, LC_NUMERIC );

...

my $app = My::Wx::AppClass-new;

setlocale(LC_NUMERIC, 'C');

$app-MainLoop;

Perl more or less ignores locale settings if you don't 'use locale', but 
calling setlocale() affects the basic C library printf and sprintf 
functions so a setlocale(LC_NUMERIC, 'C') would seem to be required.

I'm not really sure if this should be built in to the Wx startup code.

Any opinions considered.













On Sun Feb 03 09:23:08 2013, TAUNGER wrote:
 at least the LC_NUMERIC setting
 
 test case:
 
 
 use 5.12.0;
 use warnings;
 
 say 8.3;
 
 require Alien::wxWidgets;
 
 say 8.3;
 
 require Wx;
 
 say 8.3;
 
 
 
 output:
 
 
 8.3
 8.3
 8,3
 
 
 As you can see, after including the Wx-Module, the setting changed.
 
 It does not only affect perl self. I found this error after i searched
 the reason for wired DBD::SQLite output.
 
 A call to POSIX::setlocale( LC_NUMERIC, 'C' ) can revert this, but i 
can
 not predict the consequences.
 
 -
 
 OS: Win7 64
 
 $Wx::VERSION:  0,9916
 Wx::wxVERSION: 2,009004
 
 Perl -V:
 
 Summary of my perl5 (revision 5 version 16 subversion 1) 
configuration:
 
   Platform:
 osname=MSWin32, osvers=4.0, archname=MSWin32-x64-multi-thread
 uname='Win32 strawberry-perl 5.16.1.1 #1 Thu Aug  9 07:49:27 2012 
x64'
 config_args='undef'
 hint=recommended, useposix=true, d_sigaction=undef
 useithreads=define, usemultiplicity=define
 useperlio=define, d_sfio=undef, uselargefiles=define, 
usesocks=undef
 use64bitint=define, use64bitall=undef, uselongdouble=undef
 usemymalloc=n, bincompat5005=undef
   Compiler:
 cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE 
 -DPERL_TEXTMODE_
 SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-
aliasing
 -mms-bi
 tfields',
 optimize='-s -O2',
 cppflags='-DWIN32'
 ccversion='', gccversion='4.6.3', gccosandvers=''
 intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678
 d_longlong=define, longlongsize=8, d_longdbl=define, 
longdblsize=12
 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, 
Off_t='long
 long',
 lseeksize=8
 alignbytes=8, prototype=define
   Linker and Libraries:
 ld='g++', ldflags ='-s -LC:\strawberry\5-16-1-64\perl\lib\CORE
 -LC:\straw
 berry\5-16-1-64\c\lib'
 libpth=C:\strawberry\5-16-1-64\c\lib
 C:\strawberry\5-16-1-64\c\x86_64-w64-mi
 ngw32\lib
 libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
 -ladvapi32
  -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm
 -lversion
  -lodbc32 -lodbccp32 -lcomctl32
 perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool
 -lcomdlg32 -ladva
 pi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr
 -lwinmm -lver
 sion -lodbc32 -lodbccp32 -lcomctl32
 libc=, so=dll, useshrplib=true, libperl=libperl516.a
 gnulibc_version=''
   Dynamic Linking:
 dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
 cccdlflags=' ', lddlflags='-mdll -s
 -LC:\strawberry\5-16-1-64\perl\lib\CORE
  -LC:\strawberry\5-16-1-64\c\lib'
 
 
 Characteristics of this binary (from libperl):
   Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY
 PERLIO_LAYERS PERL_DONT_CREATE_GVSV
 PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
 PERL_MALLOC_WRAP PERL_PRESERVE_IVUV 
PL_OP_SLAB_ALLOC
 USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
 USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
 USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
   Built under MSWin32
   Compiled at Aug  9 2012 07:55:51
   %ENV:
 PERL_BASE=5-16-1-64
 PERL_EXE=C:\strawberry\5-16-1-64\perl\bin\perl.exe
   @INC:
 C:/strawberry/5-16-1-64/perl/site/lib
 C:/strawberry/5-16-1-64/perl/vendor/lib
 C:/strawberry/5-16-1-64/perl/lib
 .
 
 ---
 
 on an old perl (5.14) with Wx 2.8 everything seems fine
 
 
 




wxPerl and Raspberry Pi

2013-02-02 Thread Mark Dootson


In case anyone is interested in this sort of thing, I've published a 
distribution of Citrus Perl for the Raspberry Pi.


http://raspberrypi.citrusperl.com/

wxPerl on a phone chip :-)

Regards

Mark


Re: wxPanel Question

2013-01-25 Thread Mark Dootson

Hi,

Apologies if this message arrives twice but my last few mails have been 
swallowed by the ether so sending via different mail host.


Attached are two files, KWxLinearMeter.pm and lmeterdemo.pl.
As suggested by the names KWxLinearMeter.pm is the wrapped LinearMeter 
control and lmeterdemo.pl is a simple app that displays some meter 
instances.


KWxLinearMeter is implemented as far as possible as a simple translation 
of LinearMeter.h and LinearMeter.cpp from the original source. It could 
be implemented in a more Perlish way but I wanted the translation to be 
obvious.


In your original code, you are creating window controls (or panels at 
least) in your EVT_PAINT handler. This is a mistake. The EVT_PAINT 
handler is called whenever part of your window needs refreshing. That 
would be whenever the window is shown, resized, covered / uncovered by 
other windows, amongst other things.


Hope it helps.

Mark

On 23/01/2013 15:43, James Lynes wrote:

Good morning:

I've recently ported several C++ wxIndustrial Controls to wxPerl and I'm
now abstracting the LinearMeter example  into a module so that multiple
meters can exist on a window. I have a couple of questions that I hope the
group can help me with.

First: I create a frame. Create 6 panels. Write a label on each panel(just
to see if the panel is created in the correct location, it is). Create 6
meter objects. And draw the 6 meters(for testing just a filled box).

Instead of getting a window with 6 boxes with labels, I get a blank window
that gets 6 boxes drawn on it. Then the window goes back to the default
background color with 6 labels written on it. The filled boxes are
overwritten. I'm looking for 6 filled boxes with a label on them. What have
I missed?

Second: In the original port I have the following construct that works fine:

  my @TagsVal;
  push(@TagsVal, $val);

 In my abstracted version I have translated this to:

 $self-{TAGSVAL} = [];   # Object array
definition

 sub TagsVal { # Object
accessor definition
 my $self = shift;
 if(@_) {$self-{TAGSVAL} = @_}
 return $self-{TAGSVAL};
 }

 push($Meter-TagsVal(), $val); # Don't think this
is correct syntax???
  # want
to push $val into the object TAGSVAL array


Thanks for your input!

James

Source files attached: LinearMeter.pl  Original Port
  LinearMeter.pmObject version
  LM.pl   Object Main
Program

#
# Description:  Demo for KWx::LinearMeter
# Created   Fri Jan 25 21:07:51 2013
# svn id$Id:$
# Copyright:Copyright (c) 2013 Mark Dootson
# Licence:  This work is free software; you can redistribute it and/or modify it 
#   under the terms of the GNU General Public License as published by the 
#   Free Software Foundation; either version 3 of the License, or any later 
#   version.
#

use strict;
use warnings;
use Wx;

#--
 package Demo::MainWindow;
#--
use strict;
use warnings;
use Wx qw( wxTheApp :panel :window :id :misc :slider :colour :sizer :font);
use base qw( Wx::Frame );
use KWxLinearMeter;
use Wx::Event qw( EVT_COMMAND_SCROLL EVT_CLOSE );

sub new {
my $class = shift;
my $self = $class-SUPER::new( @_ );

my @initdata = ( 70, 0, 200 ); # val, min, max

#---
# Create Controls
#---

my $mainpanel = Wx::Panel-new($self, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxBORDER_NONE);

my $draglabel = Wx::StaticText-new($mainpanel, wxID_ANY, 'Drag Me');

my $slider = Wx::Slider-new($mainpanel, wxID_ANY,
@initdata, , wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL);

# add some Meters

my @bars;
for (my $i = 1; $i  5; $i++) {
my $name = qq(Meter $i);
my $mlabel = Wx::StaticText-new($mainpanel, wxID_ANY, $name);
my $meter = KWxLinearMeter-new($mainpanel);
$meter-SetRangeVal($initdata[1], $initdata[2]);
	$meter-SetActiveBarColour(wxBLUE);
	$meter-SetPassiveBarColour(wxWHITE);
	$meter-SetTxtLimitColour(wxBLACK);
	$meter-SetTxtValueColour(wxRED);
	$meter-SetBorderColour(wxRED);
	$meter-SetTagsColour(wxGREEN) ;
	$meter-SetTxtFont(Wx::Font-new(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL ));
	$meter-SetOrizDirection(0);
	$meter-ShowCurrent(1) ;
	$meter-ShowLimits(1) ;
	$meter-SetValue($initdata[0]);

for ( 20, 40

Re: Opening a Wx::Bitmap file across a Samba share

2013-01-23 Thread Mark Dootson

Hi,

Just a follow up

On 20/01/2013 16:58, stephen.cook...@sca-uk.com wrote:


Thanks for this.  It worked perfectly.  I was already using the ip address
rather than the host name, but the -o before each option, as you say, was not
totally intuitive :)



After posting I looked at man mount a little more closely and the 
correct syntax for mount options is a comma delimited list - so the 
following would also work - according to the manual.


mount -t cifs -o user=User Name,password=mypassword 
//10.10.10.10/sharedfs /mnt/cifstest


Cheers

Mark




Steve

On 20 January 2013 at 03:12 Mark Dootson mark.doot...@znix.com wrote:

Hi,

On 19/01/2013 15:41, stephen.cook...@sca-uk.com wrote:



Do you have this working on your system?

If so, I'd appreciate an example.


The following works OK for me:

mount -t cifs -o user=User Name -o password=mypassword
//10.10.10.10/sharedfs /mnt/cifstest

None obvious things were:
-o required before every option
IP address needed - name resolution did not seem to work with cifs. I
would guess this is because it tries to resolve //SomeName/sharedfs as a
NetBios address but that's just me grabbing a reason out of the air.


Hope it helps.

Mark





Re: Opening a Wx::Bitmap file across a Samba share

2013-01-23 Thread Mark Dootson


On 23/01/2013 18:33, Johan Vromans wrote:


You can also store the credentials in a file (readable by root only),
e.g.:

   mount -t cifs -o credentials=/etc/local/cifs.credentials

/etc/local/cifs.credentials contains:

+---
|username=User Name
|password=mypassword
+---



The method of choice, I would guess, if you wanted to mount the share 
using /etc/fstab




Re: Opening a Wx::Bitmap file across a Samba share

2013-01-19 Thread Mark Dootson

Hi,

On 19/01/2013 15:41, stephen.cook...@sca-uk.com wrote:



Do you have this working on your system?

If so, I'd appreciate an example.


The following works OK for me:

mount -t cifs -o user=User Name -o password=mypassword 
//10.10.10.10/sharedfs /mnt/cifstest


None obvious things were:
  -o required before every option
  IP address needed - name resolution did not seem to work with cifs. I 
would guess this is because it tries to resolve //SomeName/sharedfs as a 
NetBios address but that's just me grabbing a reason out of the air.



Hope it helps.

Mark



Re: Opening a Wx::Bitmap file across a Samba share

2013-01-18 Thread Mark Dootson

Steve,

I'm almost certain that you can't access files on a share that way using 
standard file I/O


I think you have to mount the remote share.

https://wiki.samba.org/index.php/Mounting_samba_shares_from_a_unix_client

Hope it helps.

Mark


On 18/01/2013 23:56, Steve Cookson wrote:

Hi Guys,

I'm sure this is a really obvious question and, in fact, I thought it
was working just a day or so ago. I'm trying to do:

  
Wx::Bitmap-new('smb://userid:password@127.0.0.1/sharename/path/bitmapfile.png',
wxBITMAP_TYPE_ANY)

and I get file not found, when the file clearly exists if I type:

smb://userid:password@127.0.0.1/sharename/path

into Kubuntu dolphin file manager.

Here is a quick piece of runnable code that I generated with the
wonderful and ever accommodating wxGlade to show the problem:

(don't forget to change the path to a valid share/path/filename).

Regards

Steve.

#!/usr/bin/perl -w --
# To get wxPerl visit http://wxPerl.sourceforge.net/

package MyDialog;

use Wx qw[:everything];
use base qw(Wx::Dialog);
use strict;
sub new {
my( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_;
$parent = undef  unless defined $parent;
$id = -1 unless defined $id;
$title  =  unless defined $title;
$pos= wxDefaultPosition  unless defined $pos;
$size   = wxDefaultSize  unless defined $size;
$name   =  unless defined $name;

$style = wxDEFAULT_DIALOG_STYLE unless defined $style;

$self = $self-SUPER::new( $parent, $id, $title, $pos, $size, $style, 
$name );
$self-{bitmap_1} = Wx::StaticBitmap-new($self, -1,
Wx::Bitmap-new('smb://userid:password@127.0.0.1/sharename/path/bitmapfile.png',
wxBITMAP_TYPE_ANY), wxDefaultPosition, wxDefaultSize, );

$self-SetTitle(dialog_1);

$self-{sizer_1} = Wx::BoxSizer-new(wxHORIZONTAL);
$self-{sizer_1}-Add($self-{bitmap_1}, 0, 0, 0);
$self-SetSizer($self-{sizer_1});
$self-{sizer_1}-Fit($self);
$self-Layout();

return $self;
}

1;

package main;

unless(caller){
local *Wx::App::OnInit = sub{1};
my $app = Wx::App-new();
Wx::InitAllImageHandlers();

my $dialog_1 = MyDialog-new();

$app-SetTopWindow($dialog_1);
$dialog_1-Show(1);
$app-MainLoop();
}





[rt.cpan.org #81416] build broken on macosx - perl 5.14 - wx2.9.4

2013-01-18 Thread Mark Dootson via RT
Sat Jan 19 02:02:38 2013: Request 81416 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: build broken on macosx - perl 5.14 - wx2.9.4
   Broken in: 0.9914
Severity: (no value)
   Owner: Nobody
  Requestors: aduit...@cpan.org
  Status: open
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=81416 


The main issue here is with wxWidgets 2.9.4. Marked ticket as stalled 
waithing for wxWidgets 2.9.5 release


[rt.cpan.org #82804] test failed t/09_paper.t

2013-01-18 Thread Mark Dootson via RT
Sat Jan 19 02:05:05 2013: Request 82804 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: test failed t/09_paper.t
   Broken in: 0.9915
Severity: Normal
   Owner: Nobody
  Requestors: vic...@vsespb.ru
  Status: new
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=82804 


This should be fixed in Wx 0.9916 released to CPAN today. Please test to 
confirm that your issue has been resolved and close ticket.

On Fri Jan 18 07:00:25 2013, vsespb wrote:
 #   Failed test 'Got Letter Size'
 #   at t/09_paper.t line 19.
 #  got: '1'
 # expected: '21'
 # Looks like you failed 1 test of 3.
 t/09_paper.t  
 Dubious, test returned 1 (wstat 256, 0x100)
 Failed 1/3 subtests 
 
 on Ubuntu 10.04 perl 5.10.1, russian locale, hp 1020 printer





[rt.cpan.org #81670] Wx::Frame weaken away when -Close()

2013-01-18 Thread Mark Dootson via RT
Sat Jan 19 02:07:28 2013: Request 81670 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: Wx::Frame weaken away when -Close()
   Broken in: (no value)
Severity: (no value)
   Owner: Nobody
  Requestors: use...@zip.com.au
  Status: open
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=81670 


I have closed the ticket, if that is OK, as this isn't really a bug.

Many thanks

On Thu Dec 06 17:26:09 2012, use...@zip.com.au wrote:
 Mark Dootson via RT bug...@rt.cpan.org writes:
 
  $frame-Close simply generates an EVT_CLOSE so it all depends what 
is in 
  your (or the default) EVT_CLOSE handler.
 
 Thanks, I'll do a destroy from there ... I think I want to destroy on
 close if that's not already the default.  Seems subtle that it should
 vary between gtk and mswin, but that would be wx rather than perl
 presumably.





[rt.cpan.org #74652] Segfault on Wx::PlThreadEvent destruction

2013-01-18 Thread Mark Dootson via RT
Sat Jan 19 02:13:30 2013: Request 74652 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: Segfault on Wx::PlThreadEvent destruction
   Broken in: 0.9903
Severity: (no value)
   Owner: Nobody
  Requestors: ad...@cpan.org
  Status: open
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=74652 


Bug marked as 'resolved' as I believe the suggested solution solved 
problem for requestor.


[rt.cpan.org #73093]

2013-01-18 Thread Mark Dootson via RT
Sat Jan 19 02:18:08 2013: Request 73093 was acted upon.
Transaction: Correspondence added by MDOOTSON
   Queue: Wx
 Subject: (No subject given)
   Broken in: 0.9903
Severity: Important
   Owner: Nobody
  Requestors: bo.johans...@lsn.se
  Status: new
 Ticket URL: https://rt.cpan.org/Ticket/Display.html?id=73093 


I believe this may have been an issue with the 4.4.3 gcc compiler that 
is solved in later releases. Therefore closing this ticket. 

On Wed Dec 07 18:01:58 2011, boilund wrote:
 04_threads.t fail with panic: del_backref during global destruction
 
 Trying to install Wx on Windows 7 results in
 
 C:\Strawberry\perl\bin\perl.exe -MExtUtils::Command::MM -e
 test_harness(0,
 '..\..\blib\lib', '..\..\blib\arch') t/*.t
 t/01_load.t . ok
 t/02_inheritance.t .. ok
 t/03_pldatabject.t .. ok
 t/04_threads.t .. 3/4 panic: del_backref during global 
destruction.
 t/04_threads.t .. Dubious, test returned 9 (wstat 2304, 0x900)
 All 4 subtests passed
 
 Wx-0.9903/ext/dnd/t/ 04_threads.t is failing.
 
 I run cpantest Wx and got the error. I used a new command window, 
cd
 to c:\strawberry\cpan\build\Wx-0.9903-oOF1ZS\ext\dnd,  run perl
 -MExtUtils::Command::MM -e test_harness(0,'..\..\blib\lib',
 '..\..\blib\arch') t/*.t and got the same error. Restarted the 
computer
 and repeated the steps with the same error.
 
 However running this: 
 
 perl.exe -MExtUtils::Command::MM -e
 test_harness(0,'c:/strawberry/cpan/build/Wx-0.9903-oOF1ZS/t')
 c:/strawberry/cpan/build/Wx-0.9903-oOF1ZS/ext/dnd/t/*.t
 
 (with cd outside the distribution) several hundred times does NOT give
 any errors.
 
 Information about my system in the appened file. 




Re: wxPerl past, wxPerl present and wxPerl future.

2013-01-02 Thread Mark Dootson

Hi,

On 31/12/2012 15:45, Steve Cookson wrote:


Mark has done a heroic act of maintaining the system and I personally
owe him a huge debt of gratitude.  Our system would not be where it is
today without his support.  But we should have two or three
administrators of Mark's ability and knowledge (and patience, I should
add).  We are all a bit shy about giving Mark the credit he deserves.
I'd like to say here and now, that Mark's professionalism and
thoroughness is a benchmark that I should like to aspire to.


All credits happily accepted. I should point out for new list readers 
that Mattia Barbon is the creator of wxPerl and deserves 100% of the 
credit for wxPerl existing at all. The clever design of the wxPerl 
wrapper means that someone like me is able to maintain and expand the 
current code-base. I have also found that folks in the wxWidgets c++ 
community are patient and willing to help where they can to accommodate 
wxPerl.


I think the wxPerl code-base is in good shape for a wxWidgets 3.0 
release and I look forward to supporting it through that. In the 
meantime I'm sure I'll be kept busy accommodating operating system and 
build environment changes.


From my own point of view, the greatest obstacle to other folks 
contributing to the Wx module development is that some knowledge of c / 
c++ is required or the motivation to learn. A contributor would also 
have to become familiar with how Wx builds - I have started what I think 
is a good way of explaining this in the source code in

ext/test

This wraps an entirely pointless extension called wxPerlTest - but 
provides some simple self contained C++ classes that can be extended / 
altered to demonstrate the available features of the C++ pre-processor 
(ExtUtils::XSpp) and how you may use these to wrap C++ classes. I 
thought that most people find learning by reading existing code easier 
that straight documentation so I'll be expanding this part with further 
examples and comments in the future. Whilst wxPerlTest provides no 
useful function, it does provide methods that can be used in tests - so 
can provide a complete template for wrapping new classes or extensions.


I think that making it easier to contribute to Wx development is the 
best thing I can do. Mattia made it very much easier than It might have 
been so I'll just share what I learned along the way.


With regard to wxMediaCtrl, I feel your frustration.
One way forward maybe to adopt the approach of Wx::Scintilla. You could 
develop wxMediaStreamer as a separate C++ module, building inside a 
Wx::MediaStreamer distribution. That would make wxMediaStreamer 
potentially available to the wider wxWidgets community whilst directly 
giving you what you need within a Wx::MediaStreamer module. I would be 
happy to cooperate on this if you wish to go that way. I have no clue 
what wxMediaStreamer should do, but could help in getting a module / 
build system set up.


Regards

Mark
























Re: AUI events

2012-12-30 Thread Mark Dootson

Steve,

There were a few other AUI events missing so I added them to
Wx 0.9915 released to CPAN.

Regards

Mark

On 29/12/2012 18:46, Steve Cookson wrote:

Hi Mark,

Assuming I can get all these events working, would you like a patch for the:

On Mon, Dec 24, 2012 at 12:45 PM, Steve Cookson wrote:

EVT( EVT_AUINOTEBOOK_DRAG_DONE, 3, wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE )?


Regards

Steve




wxWidgets 2.9.4

2012-12-30 Thread Mark Dootson

Hi,

It has been noted on a couple of other threads but I though it worth 
posting again. There are problems with the plain wxWidgets 2.9.4 release 
and wxPerl. The Plugin handling in wxWidgets 2.9.4 is broken. It is 
fixed in wxWidgets trunk (2.9.5 to be). wxPerl uses the wxWidgets plugin 
features.


The current Alien::wxWidgets 0.62 contains the back-ported patch to fix 
2.9.4. Therefore if you build wxWidgets using Alien::wxWidgets all works OK.


However, if you build wxWidgets 2.9.4 yourself or use some other 
pre-built binaries (MacPorts etc) then your wxPerl build will fail. If 
you wish to build wxWidgets yourself, apply wxWidgets-2.9.4-plugin.patch 
from the Alien::wxWidgets 0.62 source.


Regards

Mark



Re: install broken on Mac

2012-12-29 Thread Mark Dootson

Hi,

My apologies.
Wx 0.9915 released to CPAN should solve this problem.

Regards

Mark

On 23/12/2012 22:59, herbert breunung wrote:

excuse me for not having that much details,
but on my shiny new powerbook i had to reach to .9911 to get wx installed
curiously then I could update

any ideas?
thanks very much and blessed christmas




Re: AUI events

2012-12-22 Thread Mark Dootson

Hi Steve

On 22/12/2012 19:52, Steve Cookson wrote:


As suggested I tried EVT_AUINOTEBOOK_DRAG_DONE, but it needed to be
wrapped.  So I opened:

~/wxPerl/ext/aui/AUI.xs

and copied one of the lines to create:

 EVT( EVT_AUINOTEBOOK_DRAG_DONE, 3, wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE )

make
make install

no errors.

But fails on execution with undefined subroutine
Wx::Event::EVT_AUINOTEBOOK_DRAG_DONE ..

Any thoughts?

Is anyone using AUI?



After adding your extra event you need to rebuild everything:

make clean
perl Makefile.PL
make
make test
make install

Then you should be able to use Wx::Event::EVT_AUINOTEBOOK_DRAG_DONE.

Regards

Mark







Re: Compiling wxWidgets on Strawberry Perl

2012-11-30 Thread Mark Dootson

Hi,

Determine success / failure by the return value of the script - which 
I'm fairly sure succeeded in both cases.


On 30/11/2012 17:04, Smylers wrote:

Hi there. I'm getting error messages using Alien::wxWidgets to compile
wxWidgets on Strawberry Perl on Windows 7.

The computer has DwimPerl 5.14.2 installed, which is Strawberry Perl
plus some other stuff, including wxWidgets 2.8.12. I wish to upgrade it
to a newer wxWidgets.

I downloaded and extracted Alien-wxWidgets-0.62 and from its folder and
Build.PL, selecting to download and compile wxWidgets, version 2.9.4,
tar.bz2, and no GL support. Then ran Build.

After an hour or so, it aborted with this error message:

   g++ -shared -fPIC -o ..\..\lib\gcc_dll\wxmsw294u_gl_gcc_custom.dll 
gcc_mswudll\gldll_dummy.o gcc_mswudll\gldll_version_rc.o 
gcc_mswudll\gldll_glcmn.o gcc_mswudll\gldll_glcanvas.o   -mthreads 
-L..\..\lib\gcc_dll -Wl,--out-implib=..\..\lib\gcc_dll\libwxmsw29u_gl.a  -m32  
-lwxtiff -lwxjpeg -lwxpng  -lwxzlib -lwxregexu -lwxexpat-lkernel32 -luser32 
-lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 
-luuid -lrpcrt4 -ladvapi32 -lws2_32 -lwininet -lwxmsw29u_core -lwxbase29u  
-lopengl32 -lglu32
   Creating library file: ..\..\lib\gcc_dll\libwxmsw29u_gl.a
   if not exist ..\..\lib\gcc_dll\mswu\wx mkdir ..\..\lib\gcc_dll\mswu\wx
   compilet.exp:fake:(.edata+0x3c): undefined reference to `boot_compilet'
   compilet.exp:fake:(.edata+0x40): undefined reference to `boot_compilet'
   collect2: ld returned 1 exit status
   compilet.exp:fake:(.edata+0x3c): undefined reference to `boot_compilet'
   compilet.exp:fake:(.edata+0x40): undefined reference to `boot_compilet'
   collect2: ld returned 1 exit status

So I then tried version 2.8.12 and zip, just to see if that would work.
It failed with a similar error:

   g++ -shared -fPIC -o 
..\..\src\stc\..\..\..\lib\gcc_dll\wxmsw28u_stc_gcc_custom.dll 
gcc_mswudll\stcdll_PlatWX.o gcc_mswudll\stcdll_ScintillaWX.o 
gcc_mswudll\stcdll_stc.o gcc_mswudll\stcdll_AutoComplete.o 
gcc_mswudll\stcdll_CallTip.o gcc_mswudll\stcdll_CellBuffer.o 
gcc_mswudll\stcdll_CharClassify.o gcc_mswudll\stcdll_ContractionState.o 
gcc_mswudll\stcdll_Document.o gcc_mswudll\stcdll_DocumentAccessor.o 
gcc_mswudll\stcdll_Editor.o gcc_mswudll\stcdll_ExternalLexer.o 
gcc_mswudll\stcdll_Indicator.o gcc_mswudll\stcdll_KeyMap.o 
gcc_mswudll\stcdll_KeyWords.o gcc_mswudll\stcdll_LexAPDL.o 
gcc_mswudll\stcdll_LexAU3.o gcc_mswudll\stcdll_LexAVE.o 
gcc_mswudll\stcdll_LexAda.o gcc_mswudll\stcdll_LexAsm.o 
gcc_mswudll\stcdll_LexAsn1.o gcc_mswudll\stcdll_LexBaan.o 
gcc_mswudll\stcdll_LexBash.o gcc_mswudll\stcdll_LexBasic.o 
gcc_mswudll\stcdll_LexBullant.o gcc_mswudll\stcdll_LexCLW.o 
gcc_mswudll\stcdll_LexCPP.o gcc_mswudll\stcdll_LexCSS.o 
gcc_mswudll\stcdll_LexCaml.ogcc_mswudll\stcdll_LexCsou

nd.o gc
c_mswudll\stcdll_LexConf.o gcc_mswudll\stcdll_LexCrontab.o 
gcc_mswudll\stcdll_LexEScript.o gcc_mswudll\stcdll_LexEiffel.o 
gcc_mswudll\stcdll_LexErlang.o gcc_mswudll\stcdll_LexFlagship.o 
gcc_mswudll\stcdll_LexForth.o gcc_mswudll\stcdll_LexFortran.o 
gcc_mswudll\stcdll_LexGui4Cli.o gcc_mswudll\stcdll_LexHTML.o 
gcc_mswudll\stcdll_LexHaskell.o gcc_mswudll\stcdll_LexInno.o 
gcc_mswudll\stcdll_LexKix.o gcc_mswudll\stcdll_LexLisp.o 
gcc_mswudll\stcdll_LexLout.o gcc_mswudll\stcdll_LexLua.o 
gcc_mswudll\stcdll_LexMMIXAL.o gcc_mswudll\stcdll_LexMPT.o 
gcc_mswudll\stcdll_LexMSSQL.o gcc_mswudll\stcdll_LexMatlab.o 
gcc_mswudll\stcdll_LexMetapost.o gcc_mswudll\stcdll_LexNsis.o 
gcc_mswudll\stcdll_LexOpal.o gcc_mswudll\stcdll_LexOthers.o 
gcc_mswudll\stcdll_LexPB.o gcc_mswudll\stcdll_LexPOV.o 
gcc_mswudll\stcdll_LexPS.o gcc_mswudll\stcdll_LexPascal.o 
gcc_mswudll\stcdll_LexPerl.o gcc_mswudll\stcdll_LexPython.o 
gcc_mswudll\stcdll_LexRebol.o gcc_mswudll\stcdll_LexRuby.o 
gcc_mswudll\stcdll_LexSQL.o gcc_
mswudll\
stcdll_LexSmalltalk.o gcc_mswudll\stcdll_LexTADS3.o 
gcc_mswudll\stcdll_LexScriptol.o gcc_mswudll\stcdll_LexSpecman.o 
gcc_mswudll\stcdll_LexSpice.o gcc_mswudll\stcdll_LexTCL.o 
gcc_mswudll\stcdll_LexTeX.o gcc_mswudll\stcdll_LexVB.o 
gcc_mswudll\stcdll_LexVHDL.o gcc_mswudll\stcdll_LexVerilog.o 
gcc_mswudll\stcdll_LexYAML.o gcc_mswudll\stcdll_LineMarker.o 
gcc_mswudll\stcdll_PropSet.o gcc_mswudll\stcdll_RESearch.o 
gcc_mswudll\stcdll_ScintillaBase.o gcc_mswudll\stcdll_Style.o 
gcc_mswudll\stcdll_StyleContext.o gcc_mswudll\stcdll_UniConversion.o 
gcc_mswudll\stcdll_ViewStyle.o gcc_mswudll\stcdll_WindowAccessor.o 
gcc_mswudll\stcdll_XPM.o gcc_mswudll\stcdll_version_rc.o   -mthreads 
-L..\..\src\stc\..\..\..\lib\gcc_dll 
-Wl,--out-implib=..\..\src\stc\..\..\..\lib\gcc_dll\libwxmsw28u_stc.a  -m32   
-lwxtiff -lwxjpeg -lwxpng  -lwxzlib  -lwxregexu -lwxexpat -lkernel32 
-luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 
-loleaut32 -luuid -lrpcrt4-ladvapi32 -lws2_32 -l
odbc32 -
lwxmsw28u_core  -lwxbase28u

   Creating library file: ..\..\src\stc\..\..\..\lib\gcc_dll\libwxmsw28u_stc.a
   

Re: wiki.wxperl.info down

2012-11-05 Thread Mark Dootson

On 02/11/2012 09:21, Johan Vromans wrote:

Sorry to hear that. It seems to be a DNS problem so I've contacted the
responsible organisation.

As a quick and dirty workaround, you can add the following line to
/etc/hosts:



The Windows workaround is to temporarily add

81.173.110.10   wiki.wxperl.info

to

C:\Windows\System32\drivers\etc\hosts

Create the file if it does not exist. Mine now contains:

127.0.0.1   localhost
81.173.110.10   wiki.wxperl.info

Don't forget to remove 81.173.110.10   wiki.wxperl.info when DNS is 
working again.


I never thought I'd edit a Windows hosts file again. :-)





Citrus Perl Updated

2012-10-10 Thread Mark Dootson

Hi,

Citrus Perl, the binary distribution with Wx, has been updated with 
several new features.


Full detail at

http://www.citrusperl.com/citrus_perl/2012/10/citrus-perl-5161-updated-oct.html

Current users need to read before upgrading. (Yes, there is an 'upgrade' 
of sorts available now - you don't have to rebuild all your own modules)


Regards

Mark



  1   2   3   4   >