Re: About Creating New Packages/Widgets & Other Dev Help

Metallicow <[email protected]>
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <[email protected]>

On Tuesday, December 29, 2015 at 4:00:19 PM UTC-6, kevino wrote:
>
>
>
> On Dec 28, 2015, at 6:54 PM, Metallicow <[email protected] 
> <javascript:>> wrote:
>
>
>
> On Saturday, December 26, 2015 at 11:33:06 AM UTC-6, kevin...@
> theolliviers.com wrote:
>>
>>
>> Are you using a series of controls with sizers to do the layout for a 
>> custom-drawn button? 
>>
>> Regards,
>>
>> Kevin
>>
>>
> Nope. ShapedBitmapButton is just a hand-built wx.Control Subclass.
> So 1 Button instance is just like 1 Button instance when created. This way 
> it is a dropin replacement basically.
> ShapedBitmapButtonAdv is a subclass of ShapedBitmapButton
> With the advanced techniques the button instances "talk" or "discuss" with 
> each other about what event is really going on and how to draw. Then 
> process the event 
> which in turn `not really` "walks back down the tree" and redraws the 
> original button correctly as if that instance is the actual instance.
> I have tested the basic class with absolute positioning and have tests for 
> all the different sizers, so the basic class is pretty solidly tested.
> I guess it could be explained like this also... ummm
> The event has to be recreated exactly(signed by the lead) and passed 
> around like a charter to sign basically...
>
>
> Gotcha. This just seems a fairly complex system to draw some buttons, and 
> I'm wondering what issue exactly this system was built to resolve. Is this 
> the overlap thing you mentioned earlier? wx.DC uses very dated APIs on 
> Windows that don't support a lot of modern drawing operations, and so 
> sometimes very simple drawing tasks become a huge hassle to implement. 
> Multi-control transparency particularly can be a huge headache because the 
> Win implementation of wx.DC uses APIs that really pre-date transparency 
> support entirely. (MS bolted on some transparency support later, but it 
> only works in certain circumstances.) Often, you can get better results 
> simply by using wx.GraphicsContext or, as Chris mentioned in another 
> thread, wx.GCDC if you want to get the good stuff but keep your code as-is.
>
> Regards,
>
> Kevin
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "wxPython-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>  
I have been thinking about duplicating/tweaking the class to test with 
wx.GraphicsContext and or wx.GCDC but haven't got there yet.
I'll have to read up on the differences between them and test/see if there 
is any visual or performance differences at that point.
... But yea, the classes are built overall for overlap/overlaying issues 
and alpha drawing(The image is the button, not the alpha), that way I can 
make just about anything...

For example, the python Qt demo has a demo where the layout 
images/widgets(absolute positioning) animate when a button is clicked and 
fly off screen while the new widgets
fly in to create the "next page layout". That is entirely possible at this 
point.
Other fancy examples might be a slide in/over the top HUD like a lot for 
video games have for options screens, etc...
... It could even go as far as making a "web page" lookalike.
It just really depends on the artists good looking art and how far they 
want to take it with the level of detail. 

...And when I get it 99.9% finalized in python someday... Then if I can 
manage to grok/port it into C++ correctly which will really speed up the 
drawing performance, that would be awesome.

-- 
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.