Code: Select all
// Setup the colors for the 3 sections of the meter bars
wxColour green(117, 215, 112);
wxColour yellow(255, 255, 0);
wxColour red(255, 0, 0);patch attached
Code: Select all
// Setup the colors for the 3 sections of the meter bars
wxColour green(117, 215, 112);
wxColour yellow(255, 255, 0);
wxColour red(255, 0, 0);Personally I'd prefer that "colour" was spelt correctly everywhere. The developer that originally wrote "wx/colour.h" (Julian Smart) is a native speaker of English. I presume that he was persuaded by his American speaking colleagues to provide "wxColor" as a pseudonym, but given that wxWidgets does provide both spellings, then both spellings are perfectly legal. If we were to insist on consistency in which was used in the Audacity code, then as the "official language" of Audacity is "American English", I expect that the American spelling would win.Edgar wrote:Currently these 3 colors are spelled wxColor which works because there is a #define to allow it.
Legal, yes but, because one is a #define and the other a class, each variable type is subtly different. Clearly, over the years the Audacity Developers have taken great pains to ensure that the class-type (not #define-type) is maintained throughout. I really believe it should be changed/"fixed" if for no other reason than consistency but, actually to maintain the proper variable type so that IDEs are not confused. Additionally, though trivial, using the #define-type adds extra work to the compilation cycle and adds an extra layer of potential (though unlikely) complication.steve wrote:given that wxWidgets does provide both spellings, then both spellings are perfectly legal.
but not so different that it makes any difference to whether the code works.Edgar wrote:Legal, yes but, because one is a #define and the other a class, each variable type is subtly different
For both wxColor and wxColour, kDevelop shows:Edgar wrote:When you work on C++ source code do you use a text editor which distinguishes/highlights reserved words, class names, variables etc.? If so, you should be able to visually see the difference between the two spellings.
Code: Select all
Macro wxColor
Preprocessed body:
wxColour
Body:
wxColour
/usr/include/wx-2.8/wx/colour.hIt's a trivial change and only someone with serious OCD could find it important. However, it is a symptom of something troubling to me: a lack of attention to details and an unwillingness to do a tiny bit of work because, though demonstrable, the benefit is small. 'nough said, fagedboudit <grin>!steve wrote: I can see your point, but I think we would have a hard time convincing anyone that it is an important change (I may be wrong, and often am ;))
That's the bit that troubles me - is there a demonstrable benefit?Edgar wrote:though demonstrable
I did point out two demonstrable but small - nay, tiny - benefits: IDE editors which do highlighting highlight them differently so, being different, at a glance wxColor looks "wrong" because it is not of type "class"; it takes the compiler longer to compile the code with the #define version.steve wrote:That's the bit that troubles me - is there a demonstrable benefit?Edgar wrote:though demonstrable