List Info

Thread: Differences using wxWidgets 2.7.0




Differences using wxWidgets 2.7.0
user name
2006-07-25 09:42:24
Hi Mattia,

I have made these changes and generated this patch file
using WinCvs (so I
hope the format is correct) and the problems described below
are now fixed.

I do not know what side effects may be caused by these
changes so please
advise if these changes are the recommended way as per the
'Mattia' way of
doing things.

Many thanks
Mark

*** Grid.xs	15 Sep 2005 21:08:54 -0000	1.25
--- Grid.xs	25 Jul 2006 08:59:53 -0000
***************
*** 11,16 ****
--- 11,17 ----
 
############################################################
################
#
  
  #include <wx/grid.h>
+ #include "cpp/overload.h"
  
  MODULE=Wx PACKAGE=Wx::GridCellCoords
  
***************
*** 44,51 ****
  
  MODULE=Wx PACKAGE=Wx::Grid
  
  wxGrid*
! wxGrid::new( parent, id, pos = wxDefaultPosition, size =
wxDefaultSize,
style = wxWANTS_CHARS, name = wxPanelNameStr )
      wxWindow* parent
      wxWindowID id
      wxPoint pos
--- 45,69 ----
  
  MODULE=Wx PACKAGE=Wx::Grid
  
+ void
+ new( ... )
+   PPCODE:
+     BEGIN_OVERLOAD()
+         MATCH_VOIDM_REDISP( newDefault )
+         MATCH_ANY_REDISP( newFull )
+     END_OVERLOAD( "Wx::Grid::new" )
+ 
+ wxGrid*
+ newDefault( CLASS )
+     PlClassName CLASS
+   CODE:
+     RETVAL = new wxGrid();
+     wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
+   OUTPUT: RETVAL
+ 
  wxGrid*
! newFull( CLASS, parent, id, pos = wxDefaultPosition, size
= wxDefaultSize,
style = wxWANTS_CHARS, name = wxPanelNameStr )
!     PlClassName CLASS
      wxWindow* parent
      wxWindowID id
      wxPoint pos



-----Original Message-----
From: wxperl-users-bounceslists.sourceforge.net
[mailto:wxperl-users-bounceslists.sourceforge.net] On
Behalf Of Mark
Wardell
Sent: 25 July 2006 09:17 AM
To: 'Mattia Barbon'
Cc: 'wxperl-users'
Subject: Re: [wxperl-users] Differences using wxWidgets
2.7.0

Hello,

Further investigation has revealed that
$this->FindWindow( $name ) returns a
HASH ref for all other controls I have tested but ONLY
returns a SCALAR ref
for controls of type Wx::Grid.

I use this _BAD_ method of reblessing as a way of
initialising subclassed
controls (as below) that I am loading from XRC and have no
other way of
initialising them. SubclassFactory provides a way to
override the default
->new() method (with no parameters), but there is no
other way to 
->override a
Create or Show to provide any further customisation. So I am
forced to
manually Init each control in my OnInitDialog handler.

if (my $grid = $self->FindWindow('DiscountGrid')) {
	bless $grid, 'Grid:iscountG
rid';
	print "Grid:iscountG
rid => $grid\n";
	$grid->InitControl( $self );
}

I suppose I could prevent the reblessing by simply declaring
the subclassing
in the XRC definition but I would still have the problem of
FindWindow
returned a SCALAR instead of a HASH and I need the HASH as I
use a lot of
code like below:

$self-> = $var;

Can anyone offer any pointers where I can start looking or
possible
alternative solutions.

Thanks in advance.

Mark

-----Original Message-----
From: Mattia Barbon [mailto:mattia.barbonlibero.it]
Sent: 24 July 2006 09:13 PM
To: Mark Wardell
Cc: 'wxperl-users'
Subject: Re: [wxperl-users] Differences using wxWidgets
2.7.0

On Mon, 24 Jul 2006 19:30:41 +0200
"Mark Wardell" <marknetcontrol.co.za> wrote:

  Hello,

> I have some code as below:
>  
>  if (my $grid = $dialog->FindWindow(MyGrid')) {
>   bless $grid, 'Grid::MyGrid';
>   print "Grid::MyGrid => $grid\n";
> }
>  
> Using wxPerl 0.54 on wxWidgets 2.6.3 I get:
> Grid::MyGrid => Grid::MyGrid=HASH(0x7015a00)
>  
> Using wxPerl 0.54 on wxWidgets 2.7.0 I get: 
> Grid::MyGrid => Grid::MyGrid=SCALAR(........)

  Honestly I have no idea why this should be so; the
different wxWidgets
version should not influence this.

Regards
Mattia

P.S.: reblessing like this is _BAD_


------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT Join
SourceForge.net's
Techsay panel and you'll get the chance to share your
opinions on IT &
business topics through brief surveys -- and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
wxperl-users mailing list
wxperl-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxperl-use
rs


------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief surveys
-- and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
wxperl-users mailing list
wxperl-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxperl-use
rs
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )