[wx-dev] Re: wxPlatform class ?

Vadim Zeitlin vadim at wxwindows.org
Tue Jul 4 08:57:58 PDT 2006


On Tue, 04 Jul 2006 17:17:30 +0200 Francesco Montorsi <f18m_cpp217828 at yahoo.it> wrote:

FM> 1) wxAppTraits does not provide any way to convert between the enums in 
FM> defs.h and their string representation

 What is this needed for?

FM> 2) I don't understand why wxToolkitInfo is a virtual wxAppTraits member 
FM> function.

 Because it works differently in console and GUI applications, as comment
in front of it explains.

FM> wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()
FM> {
FM>      static wxToolkitInfo info;
FM> 
FM> #ifdef __WXMSW__
FM>      info.os = wxMSW;
FM> #elif defined(__WXGTK__)
FM>      info.os = wxGTK;
FM> ....
FM> #endif

 This would either return wxGTK for wxBase apps or wxBase for wxGTK ones.
Without mentioning that virtual function with different implementation in
different source files is much cleaner than a long chain of #ifdefs.

 Regards,
VZ





More information about the wx-dev mailing list