From: Gerrit W. <gw...@gr...> - 2006-05-10 13:39:26
|
Hi , upgrading my windows installation to the newest active-state perl and wxperl 0.26 breaks one of my apps using the doc/view framework. When loading a document or creating a new one, my document constructor GenericDocument::new() gets called. But from GenericDocument::OnCreate() i can't get any debug message, so i think it won't never be calledand the doc object remains uninitialized. The same application behaved well under windows before the upgrade, as it did on my linux server running open-suse 10.0 with wxperl 0.25. Have there been any changes to the doc/view framework that i missed, or have i done it the wrong way and it only happend to work by fortune? please can anyone give me a hint? regards, Gerrit Wichert p.s. this are the code snippets concerning doc/view: app::OnInit: ... $this->{oDocManager} = AppDocManager->new( wxDOC_MDI); Wx::DocTemplate->new( $this->{oDocManager}, "Greenstores Lieferantenkarte", "*.gsdc", "", "gsdc", "deliverer-card", "VIEW_DC", 'GenericDocument', 'GenericView', wxDEFAULT_TEMPLATE_FLAGS); my $frame = AppWnd->new( $this->{oDocManager}, undef, 1, "Green-Stores Datenerfassung", [10,10], [950,600]); ... #----------------------------------------------------------------------------- # class AppDocManager #----------------------------------------------------------------------------- package AppDocManager; use vars qw(@ISA); @ISA = qw(Wx::DocManager); { # The default wxWindows untitled name is "unnamedN" (where N is a number) # It's a bit ugly, and you can customise it... my $unnamed_doc_count = 0; sub MakeDefaultName { my ($docmgr, $name) = @_; return "Unbenannt" . ++$unnamed_doc_count; } } #----------------------------------------------------------------------------- # class AppWnd #----------------------------------------------------------------------------- package AppWnd; use strict; use vars qw(@ISA); @ISA=qw(Wx::DocMDIParentFrame); use Wx::Event qw(EVT_MENU EVT_CLOSE); use Wx qw(wxBITMAP_TYPE_ICO wxMENU_TEAROFF wxVERTICAL wxHORIZONTAL wxALL wxEXPAND wxDefaultPosition wxDefaultSize ); sub new { my $class = shift; my ($oManager, $oParent, $nWindowId, $sTitle, $pos, $size) = @_; my ($this) = $class->SUPER::new( $oManager, $oParent, $nWindowId, $sTitle, $pos, $size); $this; } #----------------------------------------------------------------------------- # class GenericDocument #----------------------------------------------------------------------------- package GenericDocument; use vars qw(@ISA); @ISA = qw(Wx::Document); use Data::Dumper; sub new { print STDERR "GenericDocument:new\n"; #<------ This continues to be printed when opening a new document my $class = shift; print STDERR Dumper( @_); my ($this) = $class->SUPER::new( @_); return $this; } sub OnCreate { print STDERR "GenericDocument:OnCreate\n"; #<----- This i can't see under windows any more my $this = shift; my ($sPath, $flags) = @_; print STDERR "Document type: ".$this->GetDocumentName()."\n"; print STDERR Dumper( @_); $this->{oData} = DynDataDoc->new( "deliverer-card"); if ($this->GetDocumentTemplate()->CreateView($this, $flags)) { $this->UpdateAllViews(); return 1 } return 0; } |