I am working on the Printer, PrintDialog, PrintDialogData, PrinterDC, etc... classes and I''m having a problem with Printout. In the wxWindows source, the file "prntbase.h" defines the class "wxPrintout". When wrapping this for wxRuby I am trying the call: cppResult = new wxPrintout( cppParm0 ); //where cppParm0 is a wxString If I do this it complains that I need to override the abstract class wxPrintout, and define the method "bool OnPrintPage( int )". If I define in my header file: class wxPrintout{ public: virtual bool OnPrintPage( int i ); }; It will complain to be about "class type redefinition". Nick, Curt or kevin....have any of you seen this and could you give me any pointers on how to fix it? Thanks, Zach
Zach Dennis wrote:> In the wxWindows source, the file "prntbase.h" defines the class > "wxPrintout". When wrapping this for wxRuby I am trying the call: > > cppResult = new wxPrintout( cppParm0 ); //where cppParm0 is a wxString > > If I do this it complains that I need to override the abstract class > wxPrintout, and define the method "bool OnPrintPage( int )".I believe you can pattern this class after dataobject.t. It seems that wxpp supports an "abstract" keyword for methods, along with an ABSTRACT keyword for the class declaration. I believe these will allow you to solve the problem you are seeing. You will need to implement stubs of the virtual methods, and it will be up to the ruby developer to override those implementations with their own "real" implementations in ruby. Hope this helps. Kevin
Kevin Smith wrote:> Zach Dennis wrote: > >> In the wxWindows source, the file "prntbase.h" defines the class >> "wxPrintout". When wrapping this for wxRuby I am trying the call: >> >> cppResult = new wxPrintout( cppParm0 ); //where cppParm0 is a wxString >> >> If I do this it complains that I need to override the abstract class >> wxPrintout, and define the method "bool OnPrintPage( int )". > > > I believe you can pattern this class after dataobject.t.When you run wxpp.rb <file.t> is it supposed to generate a .h and .cpp file, or does the extconf.rb look for a .t and do that? I have been doing everything by hand thus far to get a better feel for what I"m doing and partially because I dion''t get what a .t file does.> It seems that > wxpp supports an "abstract" keyword for methods, along with an ABSTRACT > keyword for the class declaration. I believe these will allow you to > solve the problem you are seeing. You will need to implement stubs of > the virtual methods, and it will be up to the ruby developer to override > those implementations with their own "real" implementations in ruby.I am wxpp challenged. ;( but I will proceed on with wrapping the class and force the wxRuby user to provide implementation of methods. Thanks, Zach
Zach Dennis wrote:> When you run wxpp.rb <file.t> is it supposed to generate a .h and .cpp > file, or does the extconf.rb look for a .t and do that? I have been > doing everything by hand thus far to get a better feel for what I"m > doing and partially because I dion''t get what a .t file does.A .t file "describes" a class. It is similar to a swig description, if you are familiar with that (but if you aren''t, don''t worry about it). Running wxpp.rb on a .t file will produce the corresponding .cpp and .h files. You should tell extconf about them so the makefile will build them for you automatically. The .t file gets checked into cvs, and the built .cpp and .h files do not.> I am wxpp challenged. ;(Unfortunately, we all are. That''s part of the motivation to move to swig. Swig basically does what wxpp does, but it is a standard tool that many people already know, and it is quite a bit more powerful in several ways. Cheers, Kevin