[wx-dev] [ wxwindows-Patches-1883904 ] wxColour::(Is)Ok fix on Cocoa (also FromString)

Stefan Csomor csomor at advancedconcepts.ch
Fri Feb 1 23:43:13 PST 2008


Hi Dave

I think that should work ok, I've had to fix a few methods (the IsOk posed
problems IIRC), but that was it ...

Best,

Stefan


On 2/1/08 10:59 PM, "David Elliott" <dfe at tgwbd.org> wrote:

> Hi guys,
> 
> I've been catching up on mailing list messages periodically and came
> across this.  As far as I can tell, the idea is for ports to move
> towards a wxObject-derived wxColour.  So it looks like adding wxCocoa
> to the list is the right thing to do here since the code has never
> used the ref-data portion of wxObject.  Did I get anything wrong?
> 
> -Dave
> 
> On Jan 31, 2008, at 4:44 PM, SourceForge.net wrote:
> 
>> Patches item #1883904, was opened at 2008-01-31 13:44
>> Message generated for change (Tracker Item Submitted) made by Item
>> Submitter
>> You can respond by visiting:
>> https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1883904&group_id
>> =9863
>> 
>> Please note that this message will contain a full copy of the
>> comment thread,
>> including the initial issue submission, for this request,
>> not just the latest update.
>> Category: Cocoa specific
>> Group: bug fix
>> Status: Open
>> Resolution: None
>> Priority: 5
>> Private: No
>> Submitted By: Wim Lewis (wiml)
>> Assigned to: Nobody/Anonymous (nobody)
>> Summary: wxColour::(Is)Ok fix on Cocoa (also FromString)
>> 
>> Initial Comment:
>> I tried building the SVN head for the Cocoa configuration and found
>> that all lookups of named colors (e.g. "LIGHT GREY") were failing
>> with an error message, with of course the concomitant display
>> problems. The root of the problem turned out to be that
>> wxCOLOUR_IS_GDIOBJECT is defined incorrectly for Cocoa builds, so
>> that wxColour was inheriting from wxGDIObject. As a result the "ok"
>> methods were checking for whether the GDI reference m_refData was
>> valid, which it never was because the concrete wxColour subclass
>> doesn't initialize it and there's no such thing as a GDI reference
>> on Cocoa anyway.
>> 
>> The fix is simple, to add __WXCOCOA__ to the list of symbols tested
>> when defining wxCOLOUR_IS_GDIOBJECT. On the other hand, I suspect
>> this code would be less fragile if the test were positive (if
>> defined(__WXWIN__) or whatever) rather than negative (requiring
>> every new platform to add its symbols to the list to avoid this
>> error).
>> 
>> 
>> 
>> ----------------------------------------------------------------------
>> 
>> You can respond by visiting:
>> https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1883904&group_id
>> =9863
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: wx-dev-unsubscribe at lists.wxwidgets.org
>> For additional commands, e-mail: wx-dev-help at lists.wxwidgets.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-dev-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-dev-help at lists.wxwidgets.org
> 

-- 

Advanced Concepts AG
Software-Engineering
Heldweg 10   
CH-8475 Ossingen
Switzerland

phone:+41 52 245 0 245
fax:+41 52 245 0 246
http://www.advanced.ch
mailto:csomor at advanced.ch








More information about the wx-dev mailing list