[wxperl-users] wxPerl 0.21 prerelease

  Hello,
http://www.barbon.org/wxperl

I will try to upload the Mac DM=
G ASAP.
The Windows Unicode version is compiled with
Unicows.

Please=
 try and report problems.

Thanks!
Mattia
=0A=0A=0A=0A_______________=
_____________________________________________=0ALibero ADSL: navighi grat=
is a 1.2 Mega, senza canone e costi di attivazione. =0AAbbonati subito su=
 http://www.libero.it =0A


0
mattia
11/8/2004 9:28:59 AM
perl.wxperl.users 3070 articles. 0 followers. Follow

18 Replies
499 Views

Similar Articles

[PageSpeed] 9

Pulled down and got this failure on make (Linux, wxGTK2-2.5):

/usr/bin/perl /usr/lib/perl5/5.8.1/ExtUtils/xsubpp  -noprototypes 
-nolinenumbers  -typemap /usr/lib/perl5/5.8.1/ExtUtils/typemap -typemap 
.../../typemap -typemap typemap  FS.xs > FS.xsc && mv FS.xsc FS.c
g++ -c  -I. -I../.. -I/usr/local/lib/wx/include/gtk2-2.5 
-I/usr/local/include   -O2 -g -pipe -march=i386 -mcpu=i686   
-DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC 
"-I/usr/lib/perl5/5.8.1/i386-linux-thread-multi/CORE"  -DWXPL_EXT 
-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES  FS.c
In file included from cpp/fshandler.h:17,
                 from FS.c:123:
.../../cpp/streams.h:37: error: `wxFileOffset' was not declared in this scope
.../../cpp/streams.h:37: error: syntax error before `,' token
.../../cpp/streams.h:38: error: syntax error before `)' token
.../../cpp/streams.h:60: error: `wxFileOffset' was not declared in this scope
.../../cpp/streams.h:60: error: syntax error before `,' token
.../../cpp/streams.h:61: error: syntax error before `)' token
make[2]: *** [FS.o] Error 1
make[2]: Leaving directory `/home/mike/downloads/Wx-0.21/ext/filesys'
make[1]: *** [subdirs] Error 2
make[1]: Leaving directory `/home/mike/downloads/Wx-0.21/ext'
make: *** [subdirs] Error 2



mattia.barbon@libero.it wrote:

>  Hello,
>http://www.barbon.org/wxperl
>
>I will try to upload the Mac DMG ASAP.
>The Windows Unicode version is compiled with
>Unicows.
>
>Please try and report problems.
>
>Thanks!
>Mattia
>
>
>
>
>____________________________________________________________
>Libero ADSL: navighi gratis a 1.2 Mega, senza canone e costi di attivazione. 
>Abbonati subito su http://www.libero.it 
>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by:
>Sybase ASE Linux Express Edition - download now for FREE
>LinuxWorld Reader's Choice Award Winner for best database on Linux.
>http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
>_______________________________________________
>wxperl-users mailing list
>wxperl-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/wxperl-users
>  
>

0
MikeSchroeder
11/8/2004 4:11:09 PM
On Mon, 08 Nov 2004 09:06:05 -0700 Mike Schroeder <MikeSchroeder@DonorWare.com> wrote:

> Pulled down and got this failure on make (Linux, wxGTK2-2.5):
> 
> /usr/bin/perl /usr/lib/perl5/5.8.1/ExtUtils/xsubpp  -noprototypes 
> -nolinenumbers  -typemap /usr/lib/perl5/5.8.1/ExtUtils/typemap -typemap 
> ../../typemap -typemap typemap  FS.xs > FS.xsc && mv FS.xsc FS.c
> g++ -c  -I. -I../.. -I/usr/local/lib/wx/include/gtk2-2.5 
> -I/usr/local/include   -O2 -g -pipe -march=i386 -mcpu=i686   
> -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC 
> "-I/usr/lib/perl5/5.8.1/i386-linux-thread-multi/CORE"  -DWXPL_EXT 
> -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES  FS.c
> In file included from cpp/fshandler.h:17,
>                  from FS.c:123:
> ../../cpp/streams.h:37: error: `wxFileOffset' was not declared in this scope
> ../../cpp/streams.h:37: error: syntax error before `,' token
> ../../cpp/streams.h:38: error: syntax error before `)' token
> ../../cpp/streams.h:60: error: `wxFileOffset' was not declared in this scope
> ../../cpp/streams.h:60: error: syntax error before `,' token
> ../../cpp/streams.h:61: error: syntax error before `)' token
> make[2]: *** [FS.o] Error 1
> make[2]: Leaving directory `/home/mike/downloads/Wx-0.21/ext/filesys'
> make[1]: *** [subdirs] Error 2
> make[1]: Leaving directory `/home/mike/downloads/Wx-0.21/ext'
> make: *** [subdirs] Error 2

  I appreciate the report. However I suspect this is not
wxWidgets 2.5.3 [1]. As a policy (and a measure to keep sanity...)
I do not guarantee that wxPerl releases will work against
wxWidgets developement CVS and wxWidgets old developement releases [2].

  If this indeed is wxWidgets 2.5.3, then I am puzzled...

Thanks!
Mattia

[1] but rather wxWidgets 2.5.2, or a CVS snapshot
[2] I might reconsider this point if and only if only
    a minor change is required


0
mattia
11/8/2004 10:25:22 PM
My bad -- it was wxWidgets 2.5.2 - I just built against 2.5.3 without 
problems.  Sorry -- didn't see that Wx-0.21 was just for wxWidgets 2.5.3 
-- now running wxGTK2.5.3 with wxPerl 0.21.


Most things seem to be working, but I did stumble onto this:  When going 
in demo.pl to the NotebookSizer, I get this:

[mike@mbs demo]$ perl demo.pl
Can't locate object method "new" via package "Wx::NotebookSizer" at 
/home/mike/downloads/Wx-0.21/demo/wxNotebookSizer.pm line 64.
free(): invalid pointer 0xbfffecb0!

I notice that the Changes file for wxGTK 2.5.3 says:

- wxNotebookSizer and wxBookCtrlSizer are now deprecated -- they are no 
longer
  needed, you can treat wxNotebook as any other control and put it directly
  into the sizer that was wxNotebookSizer's parent sizer in old code.

Since we use wxGlade to generate a lot of our code, I'll bring it up on 
their list, however it might be worth patching the demo for this change:

64c64
<   #my $nbsizer = Wx::NotebookSizer->new( $notebook );
---
 >   my $nbsizer = Wx::NotebookSizer->new( $notebook );
95c95
<   $top_sizer->Add( $notebook, 1, wxGROW );
---
 >   $top_sizer->Add( $nbsizer, 1, wxGROW );




Also, with the Theads demo, I noticed this (we're not using threads so 
no impact on us):

[mike@mbs demo]$ perl demo.pl
thread failed to start: Error while autoloading 'Wx::Usleep' at 
/home/mike/downloads/Wx-0.21/demo/wxThread.pm line 103
thread failed to start: Error while autoloading 'Wx::Usleep' at 
/home/mike/downloads/Wx-0.21/demo/wxThread.pm line 103
        (in cleanup) Can't locate object method "DESTROY" via package 
"ThreadsDemoWin" at /home/mike/downloads/Wx-0.21/demo/wxThread.pm line 91.
        (in cleanup) Can't locate object method "DESTROY" via package 
"ThreadsDemoWin" at /home/mike/downloads/Wx-0.21/demo/wxThread.pm line 
91 during global destruction.
Attempt to free temp prematurely: SV 0x8bb5cd4 during global destruction.
Scalars leaked: 2
        (in cleanup) Can't locate object method "DESTROY" via package 
"ThreadsDemoWin" at /home/mike/downloads/Wx-0.21/demo/wxThread.pm line 
91 during global destruction.
Attempt to free temp prematurely: SV 0x87c375c during global destruction.
Scalars leaked: 2
Segmentation fault


Hope this helps...


Mattia Barbon wrote:

>  I appreciate the report. However I suspect this is not
>wxWidgets 2.5.3 [1]. As a policy (and a measure to keep sanity...)
>I do not guarantee that wxPerl releases will work against
>wxWidgets developement CVS and wxWidgets old developement releases [2].
>
>  If this indeed is wxWidgets 2.5.3, then I am puzzled...
>
>Thanks!
>Mattia
>
>[1] but rather wxWidgets 2.5.2, or a CVS snapshot
>[2] I might reconsider this point if and only if only
>    a minor change is required
>  
>

0
MikeSchroeder
11/8/2004 11:39:21 PM
--- Mike Schroeder <MikeSchroeder@DonorWare.com> wrote:

> My bad -- it was wxWidgets 2.5.2 - I just built against 2.5.3 without 
> problems.  Sorry -- didn't see that Wx-0.21 was just for wxWidgets 2.5.3 
> -- now running wxGTK2.5.3 with wxPerl 0.21.
> 
> 
> Most things seem to be working, but I did stumble onto this:  When going 
> in demo.pl to the NotebookSizer, I get this:
> 
> [mike@mbs demo]$ perl demo.pl
> Can't locate object method "new" via package "Wx::NotebookSizer" at 
> /home/mike/downloads/Wx-0.21/demo/wxNotebookSizer.pm line 64.
> free(): invalid pointer 0xbfffecb0!
> 
> I notice that the Changes file for wxGTK 2.5.3 says:
> 
> - wxNotebookSizer and wxBookCtrlSizer are now deprecated -- they are no 
> longer
>   needed, you can treat wxNotebook as any other control and put it directly
>   into the sizer that was wxNotebookSizer's parent sizer in old code.

WTF?!
Deprecated does not mean remove immediately dammit.
That should still work.




		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 


0
crazyinsomniac
11/9/2004 5:28:00 PM
On Mon, 08 Nov 2004 16:35:19 -0700 Mike Schroeder <MikeSchroeder@DonorWare.com> wrote:

> My bad -- it was wxWidgets 2.5.2 - I just built against 2.5.3 without 
> problems.  Sorry -- didn't see that Wx-0.21 was just for wxWidgets 2.5.3 
> -- now running wxGTK2.5.3 with wxPerl 0.21.
  
  Well, you are not supposed to read my mind after all ;-)

> Most things seem to be working, but I did stumble onto this:  When going 
> in demo.pl to the NotebookSizer, I get this:
> 
> [mike@mbs demo]$ perl demo.pl
> Can't locate object method "new" via package "Wx::NotebookSizer" at 
> /home/mike/downloads/Wx-0.21/demo/wxNotebookSizer.pm line 64.
> free(): invalid pointer 0xbfffecb0!
> 
> I notice that the Changes file for wxGTK 2.5.3 says:
> 
> - wxNotebookSizer and wxBookCtrlSizer are now deprecated -- they are no 
> longer
>   needed, you can treat wxNotebook as any other control and put it directly
>   into the sizer that was wxNotebookSizer's parent sizer in old code.
> 
> Since we use wxGlade to generate a lot of our code, I'll bring it up on 
> their list, however it might be worth patching the demo for this change:
> 
> 64c64
> <   #my $nbsizer = Wx::NotebookSizer->new( $notebook );
> ---
>  >   my $nbsizer = Wx::NotebookSizer->new( $notebook );
> 95c95
> <   $top_sizer->Add( $notebook, 1, wxGROW );
> ---
>  >   $top_sizer->Add( $nbsizer, 1, wxGROW );
 
  Yes. I will  also reconsider such an abrupt removal. 
OTOH I think it is unnecessary in wxWidgets 2.4.2, too.
I will check on that.
 
> Also, with the Theads demo, I noticed this (we're not using threads so 
> no impact on us):
> 
> [mike@mbs demo]$ perl demo.pl
> thread failed to start: Error while autoloading 'Wx::Usleep' at 
> /home/mike/downloads/Wx-0.21/demo/wxThread.pm line 103
> thread failed to start: Error while autoloading 'Wx::Usleep' at 
> /home/mike/downloads/Wx-0.21/demo/wxThread.pm line 103
>         (in cleanup) Can't locate object method "DESTROY" via package 
> "ThreadsDemoWin" at /home/mike/downloads/Wx-0.21/demo/wxThread.pm line 91.
>         (in cleanup) Can't locate object method "DESTROY" via package 
> "ThreadsDemoWin" at /home/mike/downloads/Wx-0.21/demo/wxThread.pm line 
> 91 during global destruction.
> Attempt to free temp prematurely: SV 0x8bb5cd4 during global destruction.
> Scalars leaked: 2
>         (in cleanup) Can't locate object method "DESTROY" via package 
> "ThreadsDemoWin" at /home/mike/downloads/Wx-0.21/demo/wxThread.pm line 
> 91 during global destruction.
> Attempt to free temp prematurely: SV 0x87c375c during global destruction.
> Scalars leaked: 2
> Segmentation fault

  Likewise.

> Hope this helps...

  Yes, a lot!

Thanks!
Mattia


0
mattia
11/9/2004 8:52:05 PM
Hi Mattia,

I have been using the Wx::Grid module and I have come across a method that
has not been wrapped.

The method is GetSelectedCells and returns wxGridCellCoordsArray which I
assume is where the problem lays since this is complex data type being an
array of the class wxGridCellCoords.

I do not know where to begin to wrap this myself, but perhaps with a few
basic pointers I will give it a go. I assume we would return an array of
elements where each element is a two integer array (row, col) ??? Or would
we define an explicit class like Wx::Point??

Thanks for any help.

Regards
Mark



0
mark
11/16/2004 11:02:07 AM
On Tue, 16 Nov 2004 13:02:02 +0200 Mark Wardell <mark@netcontrol.co.za> wrote:

  Hello,

> I have been using the Wx::Grid module and I have come across a method that
> has not been wrapped.
> 
> The method is GetSelectedCells and returns wxGridCellCoordsArray which I
> assume is where the problem lays since this is complex data type being an
> array of the class wxGridCellCoords.

  While arrays are nontrivial, they aren't that difficult neither.

> I do not know where to begin to wrap this myself, but perhaps with a few
> basic pointers I will give it a go. I assume we would return an array of
> elements where each element is a two integer array (row, col) ??? Or would
> we define an explicit class like Wx::Point??

  The basic structure is like the one of
wxWindow::GetChildren(Window.xs) and wxGrid::GetSelectedCols(Grid.xs).
For creating the wxGridCellCoords use wxPli_non_object_2_sv.

HTH
Mattia


0
mattia
11/16/2004 9:05:03 PM
thanks mattia,

0.21 works fine on win and the bug i reportet seem to gone away, still 
on my wishlist would be that more wxstc lexer are wrapped and a internal 
constant that tells me which version of scintilla is in, but i can wait, 
because now i can do the most cruical feater that have been missed in my 
wxApp good work.

herbert
proton-ce.sf.net

0
deirdre_skye
11/17/2004 4:00:03 AM
Mattia,

0.21 works fine for me too. I haven't seen anything bad until now.

Thanks a million for your great work!
Olivier.


0
olivier
11/17/2004 10:00:01 AM
Hi Mattia,

I have spent quite a bit of time on this but being my first major attempt at
this, I confess it is quite a struggle. What I managed so far is below, it
compiles but throws an exception at runtime. I am sure there are several
problems.

void
wxGrid::GetSelectedCells()
  PPCODE:
    int i;
    int n;
    wxGridCellCoordsArray coordsArray = THIS->GetSelectedCells();
    n = (int) sizeof(wxGridCellCoordsArray) / (int)
sizeof(wxGridCellCoords);

    for( i = 0; i < n; ++i )
    {
	PUSHs( wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
		new wxGridCellCoords( coordsArray[i] ),
		"Wx::GridCellCoords" ) );
    }

Can you give me some feedback / pointers? I am sure with a little assistance
at the start I will be of more help in time.

Many thanks,
Mark

> -----Original Message-----
> From: Mattia Barbon [mailto:mattia.barbon@libero.it] 
> Sent: 16 November 2004 11:05 PM
> To: Mark Wardell
> Cc: 'wxPerl users ML'
> Subject: Re: [wxperl-users] Wx::Grid missing GetSelectedCells
> 
> On Tue, 16 Nov 2004 13:02:02 +0200 Mark Wardell 
> <mark@netcontrol.co.za> wrote:
> 
>   Hello,
> 
> > I have been using the Wx::Grid module and I have come 
> across a method 
> > that has not been wrapped.
> > 
> > The method is GetSelectedCells and returns 
> wxGridCellCoordsArray which 
> > I assume is where the problem lays since this is complex data type 
> > being an array of the class wxGridCellCoords.
> 
>   While arrays are nontrivial, they aren't that difficult neither.
> 
> > I do not know where to begin to wrap this myself, but 
> perhaps with a 
> > few basic pointers I will give it a go. I assume we would return an 
> > array of elements where each element is a two integer array 
> (row, col) 
> > ??? Or would we define an explicit class like Wx::Point??
> 
>   The basic structure is like the one of
> wxWindow::GetChildren(Window.xs) and wxGrid::GetSelectedCols(Grid.xs).
> For creating the wxGridCellCoords use wxPli_non_object_2_sv.
> 
> HTH
> Mattia
> 
> 



0
mark
11/18/2004 10:52:01 AM
On Thu, 18 Nov 2004 12:51:17 +0200 Mark Wardell <mark@omdmedia.co.za> wrote:

  Hello,
sorry for the delay in getting back to you!

> I have spent quite a bit of time on this but being my first major attempt at
> this, I confess it is quite a struggle. What I managed so far is below, it
> compiles but throws an exception at runtime. I am sure there are several
> problems.
> 
> void
> wxGrid::GetSelectedCells()
>   PPCODE:
>     int i;
>     int n;
>     wxGridCellCoordsArray coordsArray = THIS->GetSelectedCells();
>     n = (int) sizeof(wxGridCellCoordsArray) / (int)
> sizeof(wxGridCellCoords);
> 
>     for( i = 0; i < n; ++i )
>     {
> 	PUSHs( wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
> 		new wxGridCellCoords( coordsArray[i] ),
> 		"Wx::GridCellCoords" ) );
>     }

void
wxGrid::GetSelectedCells()
  PPCODE:
    wxGridCellCoordsArray selection = THIS->GetSelectedCells();
    EXTEND( SP, (IV) selection.GetCount() );

    for( size_t i = 0; i < selection.GetCount(); ++i )
      PUSHs( wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
             new wxGridCellCoords( selection[i] ),
             "Wx::GridCellCoords" ) );

  I must admit that it was more difficult
than I initially thought of.

Regards
Mattia

0
mattia
11/23/2004 9:42:03 PM
The code compiled correctly and returns a Wx::GridCellCoordsArray in a
EVT_GRID_RANGE_SELECT handler "sometimes". I found that if I select cells
with the Control key pressed they the event seems to fire all the time as
expected but if I drag the mouse over several cells then the event does not
fire. Actually the event fires but the method returns undef.

I am not sure if this is a dev error (me :-) or a wxWidgets issue or a
wxPerl issue, as I have not had time to test thoroughly. I will post more
info as I test it more.

> -----Original Message-----
> From: wxperl-users-admin@lists.sourceforge.net 
> [mailto:wxperl-users-admin@lists.sourceforge.net] On Behalf 
> Of Mattia Barbon
> Sent: 23 November 2004 11:42 PM
> To: Mark Wardell
> Cc: 'wxPerl users ML'
> Subject: Re[2]: [wxperl-users] Wx::Grid missing GetSelectedCells
> 
> On Thu, 18 Nov 2004 12:51:17 +0200 Mark Wardell 
> <mark@omdmedia.co.za> wrote:
> 
>   Hello,
> sorry for the delay in getting back to you!
> 
> > I have spent quite a bit of time on this but being my first major 
> > attempt at this, I confess it is quite a struggle. What I 
> managed so 
> > far is below, it compiles but throws an exception at runtime. I am 
> > sure there are several problems.
> > 
> > void
> > wxGrid::GetSelectedCells()
> >   PPCODE:
> >     int i;
> >     int n;
> >     wxGridCellCoordsArray coordsArray = THIS->GetSelectedCells();
> >     n = (int) sizeof(wxGridCellCoordsArray) / (int) 
> > sizeof(wxGridCellCoords);
> > 
> >     for( i = 0; i < n; ++i )
> >     {
> > 	PUSHs( wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
> > 		new wxGridCellCoords( coordsArray[i] ),
> > 		"Wx::GridCellCoords" ) );
> >     }
> 
> void
> wxGrid::GetSelectedCells()
>   PPCODE:
>     wxGridCellCoordsArray selection = THIS->GetSelectedCells();
>     EXTEND( SP, (IV) selection.GetCount() );
> 
>     for( size_t i = 0; i < selection.GetCount(); ++i )
>       PUSHs( wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
>              new wxGridCellCoords( selection[i] ),
>              "Wx::GridCellCoords" ) );
> 
>   I must admit that it was more difficult than I initially thought of.
> 
> Regards
> Mattia
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide Read honest & 
> candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now. 
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> wxperl-users mailing list
> wxperl-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wxperl-users
> 



0
mark
11/24/2004 1:27:07 PM
On Wed, 24 Nov 2004 15:16:16 +0200 Mark Wardell <mark@netcontrol.co.za> wrote:

> The code compiled correctly and returns a Wx::GridCellCoordsArray in a
> EVT_GRID_RANGE_SELECT handler "sometimes". I found that if I select cells
> with the Control key pressed they the event seems to fire all the time as
> expected but if I drag the mouse over several cells then the event does not
> fire. Actually the event fires but the method returns undef.
> 
> I am not sure if this is a dev error (me :-) or a wxWidgets issue or a
> wxPerl issue, as I have not had time to test thoroughly. I will post more
> info as I test it more.

  I think it depends on the wxGrid API; check wx-dev and wx-users
archives. I remember some discussion about this.

Regards
Mattia


0
mattia
11/25/2004 8:34:04 PM
Hi Mattia,

I have now revisited this and tested more thoroughly, the last time I worked
on this I was experiencing problems with the firing of the events so I never
got to test what the method actually returned.

Now I am not looking at the events at all but Wx::Grid::GetSelectedCells
does not seem to be returning the array as expected. GetSelectedRows and
GetSelectedCols work as expected but this returns nothing.

Any assistance would be appreciated. I will add some code to the sample
tomorrow to demonstrate the selection of rows, cols and cells to highlight
the problem.

Thanks
Mark

-----Original Message-----
From: wxperl-users-admin@lists.sourceforge.net
[mailto:wxperl-users-admin@lists.sourceforge.net] On Behalf Of Mattia Barbon
Sent: 23 November 2004 11:42 PM
To: Mark Wardell
Cc: 'wxPerl users ML'
Subject: Re[2]: [wxperl-users] Wx::Grid missing GetSelectedCells

On Thu, 18 Nov 2004 12:51:17 +0200 Mark Wardell <mark@omdmedia.co.za> wrote:

  Hello,
sorry for the delay in getting back to you!

> I have spent quite a bit of time on this but being my first major 
> attempt at this, I confess it is quite a struggle. What I managed so 
> far is below, it compiles but throws an exception at runtime. I am 
> sure there are several problems.
> 
> void
> wxGrid::GetSelectedCells()
>   PPCODE:
>     int i;
>     int n;
>     wxGridCellCoordsArray coordsArray = THIS->GetSelectedCells();
>     n = (int) sizeof(wxGridCellCoordsArray) / (int) 
> sizeof(wxGridCellCoords);
> 
>     for( i = 0; i < n; ++i )
>     {
> 	PUSHs( wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
> 		new wxGridCellCoords( coordsArray[i] ),
> 		"Wx::GridCellCoords" ) );
>     }

void
wxGrid::GetSelectedCells()
  PPCODE:
    wxGridCellCoordsArray selection = THIS->GetSelectedCells();
    EXTEND( SP, (IV) selection.GetCount() );

    for( size_t i = 0; i < selection.GetCount(); ++i )
      PUSHs( wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
             new wxGridCellCoords( selection[i] ),
             "Wx::GridCellCoords" ) );

  I must admit that it was more difficult than I initially thought of.

Regards
Mattia


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide Read honest & candid reviews
on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
wxperl-users mailing list
wxperl-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxperl-users


0
mark
3/30/2005 7:36:50 PM
On Wed, 30 Mar 2005 21:34:56 +0200, Mark Wardell <mark@netcontrol.co.za> wrote:
> Now I am not looking at the events at all but Wx::Grid::GetSelectedCells
> does not seem to be returning the array as expected. GetSelectedRows and
> GetSelectedCols work as expected but this returns nothing.

I had some issues with GetSelectedCells too.  IIRC, it was a)
returning a weird data type (wx list maybe?) and b) didn't have the
same notion of selected cells that I wanted to use.  Thus, I wrote
this method for my grid class:

sub GetAllSelectedCells {
	my $this = shift;
	my @out;
	# GetSelectedCells only does singly selected cells, we want all
	# and processing selection block top/left + bottom/right pairs is a pain
	# and furthermore is not yet wrapped
	for my $r (0 .. $#{$this->{_sel}}) {
		for my $c (0 .. $#{$this->{_sel}[$r]}) {
			push @out, Wx::GridCellCoords->new($r, $c)
				if $this->{_sel}[$r][$c];
		}
	}
	# add the cursor cell to the list if the list is empty
	push @out, Wx::GridCellCoords->new($this->GetGridCursorRow,
		$this->GetGridCursorCol) if !@out;
	return @out;
}

To avoid manually querying each grid cell, you can see a _sel attr in
that code.  This is populated by:

#WORKAROUND: this is a workaround for Wx::Grid not having GetSelectionBlock*
sub OnSelect {
	my ($this, $evt) = @_;
	my $sel = $evt->Selecting ? 1 : 0;
	for my $r ($evt->GetTopRow .. $evt->GetBottomRow) {
		for my $c ($evt->GetLeftCol .. $evt->GetRightCol) {
			$this->{_sel}[$r][$c] = $sel;
		}
	}
	$evt->Skip; # allow normal processing
}

Setup is done in the constructor with:
	$this->{_sel} = [];
	#WORKAROUND
	EVT_GRID_RANGE_SELECT($this, \&OnSelect);

HTH,
-- 
    -- Cheetah

0
fastcat
3/30/2005 9:28:18 PM
On Wed, 30 Mar 2005 16:26:01 -0500 Cheetah <fastcat@gmail.com> wrote:

> On Wed, 30 Mar 2005 21:34:56 +0200, Mark Wardell <mark@netcontrol.co.za> wrote:
> > Now I am not looking at the events at all but Wx::Grid::GetSelectedCells
> > does not seem to be returning the array as expected. GetSelectedRows and
> > GetSelectedCols work as expected but this returns nothing.
> 
> I had some issues with GetSelectedCells too.  IIRC, it was a)
> returning a weird data type (wx list maybe?) and b) didn't have the
> same notion of selected cells that I wanted to use.  Thus, I wrote
> this method for my grid class:

  The selection access API for wxGrid is ugly (if efficient);
anyway the wxPerl wrappers were missing GetSelectionBlockTopLeft and
GetSelectionBlockBottomRight (now in CVS). Please see the "Simple Grid"
demo for a rough but effective demonstration.

HTH
Mattia


0
mattia
4/3/2005 9:01:32 AM
Hi,

I tried this but found I still had problems and got nothing back, so after
modifying the demo code I found the problem to be when using a GridTable
which does not seem to play nicely with GetSelectedCells.

I modified the wxGridTableDemo by adding EVT_GRID_RANGE_SELECT and the
ShowSelections sub from the wxGrid.pm demo and I kept getting 'No cells
selected' even though all other selections (Row, Col, Block) were being
reported correctly, even the 'Range select (x,y,x2,y2)'.

I will go through the wxWidgets source and see what the differences are in
how the classes are implemented when using GridTable.

Regards
Mark

-----Original Message-----
From: wxperl-users-admin@lists.sourceforge.net
[mailto:wxperl-users-admin@lists.sourceforge.net] On Behalf Of Mattia Barbon
Sent: 03 April 2005 12:32 AM
To: Cheetah; wxperl-users@lists.sourceforge.net
Subject: Re[2]: [wxperl-users] Wx::Grid missing GetSelectedCells

On Wed, 30 Mar 2005 16:26:01 -0500 Cheetah <fastcat@gmail.com> wrote:

> On Wed, 30 Mar 2005 21:34:56 +0200, Mark Wardell <mark@netcontrol.co.za>
wrote:
> > Now I am not looking at the events at all but 
> > Wx::Grid::GetSelectedCells does not seem to be returning the array 
> > as expected. GetSelectedRows and GetSelectedCols work as expected but
this returns nothing.
> 
> I had some issues with GetSelectedCells too.  IIRC, it was a) 
> returning a weird data type (wx list maybe?) and b) didn't have the 
> same notion of selected cells that I wanted to use.  Thus, I wrote 
> this method for my grid class:

  The selection access API for wxGrid is ugly (if efficient); anyway the
wxPerl wrappers were missing GetSelectionBlockTopLeft and
GetSelectionBlockBottomRight (now in CVS). Please see the "Simple Grid"
demo for a rough but effective demonstration.

HTH
Mattia



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide Read honest & candid reviews
on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
wxperl-users mailing list
wxperl-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxperl-users



0
mark
4/6/2005 10:49:49 AM
On Wed, 6 Apr 2005 12:46:08 +0200 Mark Wardell <mark@netcontrol.co.za> wrote:

  Hello,

> I tried this but found I still had problems and got nothing back, so after
> modifying the demo code I found the problem to be when using a GridTable
> which does not seem to play nicely with GetSelectedCells.
> 
> I modified the wxGridTableDemo by adding EVT_GRID_RANGE_SELECT and the
> ShowSelections sub from the wxGrid.pm demo and I kept getting 'No cells
> selected' even though all other selections (Row, Col, Block) were being
> reported correctly, even the 'Range select (x,y,x2,y2)'.

  Works for me (TM). I mean: it works the same way in wxGrid.pm and
wxGridTable.pm (changes to wxGridTable.pm being committed shortly after
sending this mail).

  wxGrid always use a wxGridTable internally (wxGridStringTable, see
src/generic/grid.cpp) so there is no difference when using Wx::PlGridTable
and when not using it, especially since wxGridTableBase methods have nothing
to do with selection handling.

Regards
Mattia


0
mattia
4/9/2005 1:55:42 PM
Reply:

Similar Artilces:

[wxperl-users] [ANNOUNCE] wxPerl 0.21
A new version of wxPerl, the Perl bindings to wxWindows, is out! You can download the sources from CPAN. Screenshots: http://wxperl.sourceforge.net/sshot01.html Binary packages for ActivePerl/Win32 6xx and 8xx builds, and Red Hat Linux are available along with documentation in HTML and MS HTML Help format from http://wxperl.sourceforge.net/download.html Changes since the last release: - Fixed installation of 'wxPerl' command on Mac OS X. - Fixed running in the embedded case (still requires the application to call ExitMainLoop at the right places). - Wrapped wxNavi...

[wxperl-users] wxPerl 0.21 uploaded
Hi, the official announce will follow later today. I hope I have not b= roken anything... Regards Mattia=0A=0A=0A=0A_________________________= ___________________________________=0ALibero ADSL: 3 mesi gratis e navigh= i a 1.2 Mega, senza costi di attivazione.=0AAbbonati subito su http://www= ..libero.it=0A ...

Re: [wxperl-users] [ANNOUNCE] wxPerl 0.21
> wxFileOffset is not available in 2.5.2, > so streams.cpp/streams.h nee= d a > > #if WXPERL_W_VERSION_GE( 2, 5, 3 ) > ... wxFileOffset ...=0D = Is this the only change required for 2.5.2 support? Thanks! Matt= ia =0A=0A=0A=0A_________________________________________________________= ___=0ARegala e regalati Libero ADSL: 3 mesi gratis e navighi veloce. 1.2 = Mega di musica, film, video e sport. =0AAbbonati subito senza costi di at= tivazione su http://www.libero.it=0A=0A --- "mattia.barbon@libero.it" <mattia.barbon@libero.it> wrote: ...

[wxperl-users] wxPerl-0.21 Mac Install Problem
The Installer hangs on installing the last stage of wxPerl.pkg: Processing wxPerl Running Installer Script Time Remaining: less than a minute It sat there for over two hours before I quit the Installer. ___________________________________________________________ Win a castle for NYE with your mates and Yahoo! Messenger http://uk.messenger.yahoo.com --- David Rogal <theirpuppet@yahoo.com> wrote: > The Installer hangs on installing the last stage of wxPerl.pkg: > > Processing wxPerl > Running Installer Script > Time Remaining: less than a ...

[wxperl-users] [ wxperl-Bugs-1460615 ] EVT_GRID_CMD_CELL_CHANGE possible typo in wxPerl 0.26
Bugs item #1460615, was opened at 2006-03-29 13:56 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115655&aid=1460615&group_id=15655 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Manuel Renz (pfuschi) Assigned to: Nobody/Anonymous (nobody) Summary: EVT_GRID_CMD_...

Re:[wxperl-users] wxPerl-0.21 Mac Install Problem
Hello, > The Installer hangs on installing the last stage of wxPerl.= pkg: > > Processing wxPerl > Running Installer Script > Time Remaini= ng: less than a minute Did it create a 'wxPerl' executable in /usr/b= in or /usr/local/bin? Where is wx-config located? I the directory conta= ining wx-config in the PATH? Regards Mattia =0A=0A=0A=0A____________= ________________________________________________=0ALibero ADSL: 3 mesi gr= atis e navighi a 1.2 Mega, senza costi di attivazione.=0AAbbonati subito = su http://www.libero.it=0A --- "m...

[wxperl-users] wxPerl 0.22
Hello, this release has just some minor improvements over 0.21, mainly for wxWidgets 2.5.3 and Mac OS X users. The reasons for this release are: * FreeBSD support (I have a FreeBSD port for 5.10, I'll send it separately) * Mac OS X binary packages: the ones I distributed until now were broken in various ways. These ones have been tested on a fresh OS X installation (no XCode installed, no updates, nothing). There are bot ANSI and Unicode versions. I haven't updated the WebSite yet, you can download directly from https://sourceforge.net/project/showfiles.php?grou...

[wxperl-users] wxPerl 0.20
Hello, this is a source-only release that should solve all wxWidgets 2.5.2-related problems reported until now. Regards Mattia C:\Perl\.cpanplus\5.8.3\build\Wx-0.20>perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Wx::Grid Writing Makefile for Wx::STC Writing Makefile for Wx::Print Writing Makefile for Wx::DateTime Writing Makefile for Wx::Calendar Writing Makefile for Wx::DND Writing Makefile for Wx::Socket Writing Makefile for Wx::Html Writing Makefile for Wx::Help Writing Makefile for Wx::DocView Writing Makefile for Wx::XRC ...

[wxperl-users] wxPerl 0.49_01
Hello, this is te first beta release depending on Alien::wxWidgets. You should be able to install wxPerl from CPAN even if wxWidgets is not installed yet (provided you have a compiler, of course): Alien::wxWidgets will ask if you want to build wxWidgets from sources. Regards Mattia Mattia, There are a few files missing from Wx-0.49_01.tar.gz. (I grabbed it off pause) 1. the whole of directory \ext\media 2. \ext\datetime\XS\DateSpan.xsp 3. \ext\datetime\XS\TimeSpan.xsp Once these are added from CVS, the build works fine for me (VC6 , wxWidgets 2.6.3) with &#...

[wxperl-users] wxPerl 0.24
Hello, I hope to have it uploaded by tomorrow. It fixes: - A problem when running with PAR on Linux - The crash on bitmap load on Win95 reported by Nick Johnston and a similar (possibly the same) crash when loading a bitmap on WinXP - The problem with Wx::Log::SetTimestamp reported by Johan Vromans - The fact that Wx::Menu::Append should return a Wx::MenuItem with wxWidgets 2.6.x. Just a bugfix release (it will not be available for Mac unless somebody asks for it). Regards Mattia ...

[wxperl-users] wxPerl 0.51
Hi, I have just compiled the new wxPerl with Alien. The question for me is now, which wxWidgets is in use when I start my app. The one under Alien or the one under Wx ? Is the Version String correct with a comma (was a point before) ? And when I try to use Wx::Notebook HitTest, I get an error that the function isn't implemented. But when I check the XS files it is defined there. Did I do something wrong ? Should I have deleted the old wxPerl before compiling ? Systeminfo: Windows XP SP2, Perl 5.8.6, wxWidgets 2.6.3 Thanks for the great work so far and keep it ...

[wxperl-users] [ wxperl-Bugs-449415 ] wxPerl 0.04 warnings in toolbar.pl sampl
Bugs item #449415, was opened at 2001-08-09 01:07 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=115655&aid=449415&group_id=15655 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: wxPerl 0.04 warnings in toolbar.pl sampl Initial Comment: For all bitmaps in the sample Perl prints these warnings: Argument "bitmaps/print.bmp" isn't numeric in addition (+) at D:/Perl/site/lib/Wx.pm line 147. Use of uninitializ...

Re:[wxperl-users] wxPerl-0.21 Mac Install Problem #2
> Any help would be appreciated. I think there may be a problem with the=0D = > Installer for Mac. Has anyone successfully installed 0.21 on Mac yet?=0D = if it hangs for you surely there is a problem. The $1M question is: = running "wxPerl foo.pl" works for you? IOW: did the installed hang befor= e or after completing its job? Regards Mattia =0A=0A=0A=0A_________= ___________________________________________________=0ARegala e regalati L= ibero ADSL: 3 mesi gratis, navighi veloce e scarichi a 1.2 Mega. =0AAbbon= ati subito senza costi di attivazione su http...

[wxperl-users] wxPerl Wiki => wxPerl Kwiki
Hello all, Once upon a time I installed a Wiki, called it the wxPerl Wiki and didn't look at it anymore. I noticed that only a few people use it, it's been hacked a few times, and to make it work, at least yours truly should put more time and effort in it. This morning I started installing Kwiki, which is a far better Wiki platform than the Wiki that was installed. Apart from the UserPreferences page (working on it), everything works as it should. However, the data people entered in the old Wiki can't be converted to Kwiki automatically. Therefore I need your ...

Web resources about - [wxperl-users] wxPerl 0.21 prerelease - perl.wxperl.users

O'Reilly Open Source Convention 2007 • July 23-27, 2007 • Portland, Oregon
O'Reilly Open Source Convention 2007 - July 23-27, 2007 - Portland, Oregon

Resources last updated: 12/24/2015 1:12:03 PM