Nick, I had a few minutes so I implemented the WxPrinterDC class tonight, and I have a question on Virtual Methods. Is there a general rule of thumb to follow? Should they be implemented in the wxRuby header and source files, or should I ignore them? They are not listed on the WxWidgets documentation page, but they are in the wxWidgets source file, as being public virtual methods. Examples: StartDoc //virtual method overriding the DC::StartDoc EndDoc //virtual method overriding the DC::EndDoc StartPage //virtual method overridng the DC::StartPage EndPage //virtual method overriding the DC::EndPage If I need trial and error I can do that, but thought maybe you followed a certain pattern... Thanks, Zach
Zach Dennis wrote:> I had a few minutes so I implemented the WxPrinterDC class tonight, and > I have a question on Virtual Methods. Is there a general rule of thumb > to follow? Should they be implemented in the wxRuby header and source > files, or should I ignore them?I would have to look more closely to provide a really good answer. Some virtual methods are mandatory, and without them the class is useless. Others are rarely needed, and may not be worth the effort.> They are not listed on the WxWidgets documentation page, but they are in > the wxWidgets source file, as being public virtual methods.That would lead me to leave them out at first, and only add them if someone requests them. Unless they would be quick and easy to add, in which case I might do them while I''m working on the class anyway.> If I need trial and error I can do that, but thought maybe you followed > a certain pattern...My general pattern was to implement as much of a class that was easy, and then add any other critical parts, and then to move on to the next one. I hope that helps... Kevin P.S. Thanks for your recent work! A project like this is really hard to sustain, and any help is greatly appreciated.
From my understanding of wxPrinterDC, those are for people to implement the platform specific contexts, or things like wxPostscriptDC. Since (for now) I can''t imagine somebody attempting that sort of feat with wxPrinterDC, I would say pretend they''re not virtual. Nick Zach Dennis wrote:> Nick, > > I had a few minutes so I implemented the WxPrinterDC class tonight, > and I have a question on Virtual Methods. Is there a general rule of > thumb to follow? Should they be implemented in the wxRuby header and > source files, or should I ignore them? > > They are not listed on the WxWidgets documentation page, but they are > in the wxWidgets source file, as being public virtual methods. > > Examples: > > StartDoc //virtual method overriding the DC::StartDoc > EndDoc //virtual method overriding the DC::EndDoc > StartPage //virtual method overridng the DC::StartPage > EndPage //virtual method overriding the DC::EndPage > > If I need trial and error I can do that, but thought maybe you > followed a certain pattern... > > Thanks, > > Zach > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >