[wx-dev] wxRealRect implementation

Martin Ettl orbitcowboy at web.de
Wed Apr 23 06:29:15 PDT 2008


Hello,


@Alec
>          width =
>          height = 0;
This means witdth = height = 0 (just in two lines)


Regards Orbitcowboy



> -----Ursprüngliche Nachricht-----
> Von: wx-dev at lists.wxwidgets.org
> Gesendet: 23.04.08 15:19:01
> An: wx-dev at lists.wxwidgets.org
> Betreff: Re: [wx-dev] wxRealRect implementation


> Hey,
> 
> A few trivial comments.
> 
> 1)  In the version I unpacked, I've got:
> 
>          width =
>          height = 0;
> 
> in the definition of Intersect().  Hopefully the original was not 
> corrupted.
> 
> 2) Is it worth considering the template options of specifying the x and 
> y dimensions independently, and defaulted, along the lines of (but not 
> exactly):
> 
> template< typename X = int, typename Y = X>
> class wxRect
> {
>      ...
> ?
> 
> 3) As a style preference, I'd go for initialization syntax in the ctor.
> 
> Alec
> 
> In message <623145933 at web.de>, Martin Ettl <orbitcowboy at web.de> writes
> >Hey @ all,
> >
> >here is a template implementation (see attachment) of 
> >wxPoint<T>,wxSize<T> and wxRect<T> including a Linux makefile and a 
> >testapplication (not all functions are tested, because of lack of time 
> >... )
> >
> >To my mind it is quite simple to merge this classes to the current branch....
> >
> >Regards
> >
> >Martin
> >
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: wx-dev at lists.wxwidgets.org
> >> Gesendet: 23.04.08 13:45:25
> >> An: wx-dev at lists.wxwidgets.org
> >> Betreff: Re[4]: [wx-dev] wxRealRect implementation
> >
> >
> >> On Wed, 23 Apr 2008 10:22:15 +0200 Laurent Humbertclaude 
> >><laurent.humbertclaude at gmail.com> wrote:
> >>
> >> LH> Is it ok to use templates in a low level class like wxPoint, or 
> >> LH>event wxSize ?
> >> LH> Rule number One of the guideline is: Don't use C++ templates. I 
> >> LH>assume this
> >> LH> is ok to break rules as wxString already does in trunk.
> >>
> >>  Yes, the guidelines are out of date. The new template-related guideline is
> >> "Use templates but carefully and always check compilation with VC6".
> >>
> >> LH> - I am not sure if we want to merge wxPoint and wxPoint2DInt:
> >> LH> the wxPoint2DInt and wxPoint2DDouble are more a 2D vector than a point.
> >>
> >>  OTOH does it really make sense to have 2 different classes with so similar
> >> names?
> >>
> >> LH> - On a more basic level, I have no clue of where to put the
> >> LH> WXDLLIMPEXP_CORE macro.
> >>
> >>  In the class declaration. But if all class methods are inline (which will
> >> be the case for the template), you don't need it at all.
> >>
> >> LH> Is a typedef class exported ?
> >>
> >>  You don't need WXDLLIMPEXP_CORE in the typedef.
> >>
> >> LH> This will break ABI? ( do we care ?)
> >>
> >>  It will break the ABI but this change is for the trunk only anyhow so we
> >> don't care.
> >>
> >>
> >> LH> - What is the best solution for wxPoint<T>::operator== ?
> >> LH> We need a specialized version for double (and float) that calls 
> >> LH>wxIsSameDouble()
> >> LH> or we can change
> >> LH>   bool wxIsSameDouble(double x, double y)
> >> LH> to
> >> LH>   bool wxIsSame(double x, double y)
> >> LH>   bool wxIsSame(int x, int y) { //nop }
> >> LH> or also to
> >> LH>   bool wxIsSame<T>(T x, T y)
> >> LH> with a specialized version for double.
> >>
> >>  I think it's ok to have template wxIsSame(T, T).
> >>
> >> LH> ps : Ok, re-reading myself, I found some answers in wx/string.h
> >> LH>  like WXDLLIMPEXP_BASE, and I am afraid that it will be more complicated
> >> LH> than I was thinking initialy to get a cross compiler version working.
> >>
> >>  I don't really know what did you find to frighten you so much (there are a
> >> lot of candidates in wx/string.h :-) but WXDLLIMPEXP_BASE is the same as
> >> WXDLLIMPEXP_CORE except that it's used for the non-GUI classes defined in
> >> wxBase.
> >>
> >>  Regards,
> >> VZ
> >>
> >> _______________________________________________
> >> wx-dev mailing list
> >> wx-dev at lists.wxwidgets.org
> >> http://lists.wxwidgets.org/mailman/listinfo/wx-dev
> >>
> >
> >
> >______________________________________________________
> >Bis 50 MB Dateianhänge? Kein Problem!
> >http://freemail.web.de/club/landingpage.htm/?mc=025556
> >
> >
> >[ A MIME application / x-gzip part was included here. ]
> >
> >_______________________________________________
> >wx-dev mailing list
> >wx-dev at lists.wxwidgets.org
> >http://lists.wxwidgets.org/mailman/listinfo/wx-dev
> 
> -- 
> Alec Ross
> _______________________________________________
> wx-dev mailing list
> wx-dev at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-dev
> 


______________________________________________________
Bis 50 MB Dateianhänge? Kein Problem!
http://freemail.web.de/club/landingpage.htm/?mc=025556



More information about the wx-dev mailing list