wxruby-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wxruby-dev] Naming problem


From: Kevin Smith
Subject: Re: [Wxruby-dev] Naming problem
Date: 25 Jun 2003 22:38:05 -0700

On Wed, 2003-06-25 at 21:59, Richard Kilmer wrote:
> On Thursday, June 26, 2003, at 12:33  AM, Kevin Smith wrote:
> > Otherwise, it would probably be best to rename both of them, so we 
> > would
> > have: Wx::LAYOUT_LEFT and Wx::ALIGN_LEFT (and right, bottom, and
> > center/centre too).
> 
> This makes them more descriptive...which is nice...and it leaves all 
> the constants in the Wx namespace.  If just these are "one level 
> deeper" its kind of weird.  The documentation would have to capture 
> this, but I like these names better.

It turns out that wxLeft et.al. are only used in
IndividualLayoutConstraint. And constraints are deprecated in favor of
sizers. Plus the constants themselves are rarely used because there are
convenience methods instead. I had already moved those constants inside
IndividualLayoutConstraint before reading your email. Since it's
deprecated anyway, I'm inclined to leave them there for the moment. But
if anyone feels strongly, they could come back out to the global level
as LAYOUT_LEFT etc.

The bad news is that wxALIGN_LEFT et.al already exist. The other bad
news is that you might actually say something like (wxLEFT |
wxALIGN_LEFT) in a single expression! This all seems pretty broken, but
I don't think we can fix it completely.

Also, wxLEFT et.al. are actually directions, not alignments. And
directions are used VERY OFTEN. But actually wxWEST is an alias for
wxLEFT, so maybe we could change wxLEFT to be DIRECTION_LEFT, and
encourage people to use WEST instead. 

That was pretty messy. Here's my simple proposal:

wxLeft -> Wx::IndividualLayoutConstraint::LEFT (and it is deprecated)
wxLEFT -> Wx::DIRECTION_LEFT (but recommend using Wx::WEST instead)
wxALIGN_LEFT -> Wx::ALIGN_LEFT

Kevin






reply via email to

[Prev in Thread] Current Thread [Next in Thread]