These patches implement wxRegion and the ShapedWindow sample. I stole the ruby image from ruby-lang.org. Shamelessly. Maybe someone has a better image we can use for the shaped window. It didn''t seem to make sense to use the Python image. I''d like something even bigger than what I stol^h^h^h^hmade, preferably. Image goes in icons. I had to %ignore one function in wxRegion. Hopefully I''ll get back to that someday. Also note I added the constants Platform and PlatName. These are taken directly from wxPython and allow us to test which platform we''re compiled to. The patch files include previous patches to those files not applied. Sorry. Roy - This was initially rejected as being too large so I changed the .bmp into a .png and also added support for run.rb _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Roy Sutton wrote:> These patches implement wxRegion and the ShapedWindow sample.Committed, thanks. Nice. I tweaked the demo slightly.> Also note I added the constants Platform and PlatName.Our other constants have all upper-case names, so I would like these to be the same. I wonder if a single simple constant Wx::PLATFORM (or maybe Wx::GUI_PLATFORM; 0.6.0 provided Wx::RUBY_PLATFORM but I think this is misleading) is all that''s needed, with values ''Mac'', ''GTK'', ''MSW'', etc,. Thoughts? Thank you very much for the Scintilla patches. Will look to review and test out this evening. alex
Alex Fenton wrote:> Our other constants have all upper-case names, so I would like these to > be the same. I wonder if a single simple constant Wx::PLATFORM (or maybe > Wx::GUI_PLATFORM; 0.6.0 provided Wx::RUBY_PLATFORM but I think this is > misleading) is all that''s needed, with values ''Mac'', ''GTK'', ''MSW'', etc,. > Thoughts? >I did hesitate over that for a bit and just couldn''t decide what I preferred. All-caps is fine. As to the underscores, I was thinking about removing them but some amount of overlap with wxPython means that we can piggyback on their docs some. RUBY_PLATFORM is actually (also?) a Ruby constant. But it''s not so useful. You''ll notice we have a sample that tests it but on my machine RUBY_PLATFORM is i386-mswin32.> Thank you very much for the Scintilla patches. Will look to review and > test out this evening. >Let me know if it works! Roy
Thanks for all your recent work Roy! A couple comments/questions:> if Platform != ''__WXMAC__'' > # wxMac clips the tooltip to the window shape, YUCK!!! > set_tool_tip("Right-click to close the window\n" + > "Double-click the image to set/unset the window shape") > endSince we are a cross-platform toolkit, the fewer platform checks, the better. Could we set the tool_tip on all platforms, but has a comment saying it will get clipped on Mac? That way, if it is ever "fixed" in wx, the demo will work right away. And users will be able to see what would happen on Mac if they did choose to have a tool tip.> > if Platform == ''__WXGTK__'' > # wxGTK requires that the window be created before you can > # set its shape, so delay the call to SetWindowShape until > # this event. > evt_window_create {set_window_shape} > else > # On wxMSW and wxMac the window has already been created, so go for it. > set_window_shape > endIs there any reason not to use evt_window_create for all platforms here? Kevin
Alex Fenton wrote:> Our other constants have all upper-case names, so I would like these to > be the same. I wonder if a single simple constant Wx::PLATFORM (or maybe > Wx::GUI_PLATFORM; 0.6.0 provided Wx::RUBY_PLATFORM but I think this is > misleading) is all that''s needed, with values ''Mac'', ''GTK'', ''MSW'', etc,. > Thoughts?I agree with using all caps for these. I also wonder why Python''s PLATFORM is so ugly. I would like to be as compatible with wxPython as possible, but when they make odd choices like this it is a hard decision whether to follow them or do something better. Maybe we only define PLATNAME and not bother with PLATFORM? Kevin
Kevin Smith wrote:> Since we are a cross-platform toolkit, the fewer platform checks, the > better. Could we set the tool_tip on all platforms, but has a comment > saying it will get clipped on Mac? That way, if it is ever "fixed" in > wx, the demo will work right away. And users will be able to see what > would happen on Mac if they did choose to have a tool tip. >Since I didn''t have a Mac to test on I wasn''t sure what would happen. I think explanatory text next to the button to launch the test would be good. Also see answer below> Is there any reason not to use evt_window_create for all platforms here? >At first I considered that then I realized that people using our samples as a launching point for their own applications may wish to know what''s really going on so they can be aware of those places where the cross-platform toolkit has some ''holes.'' I wouldn''t fight changing it as it makes the sample cleaner. Just letting you know my thought process. Roy
Kevin Smith wrote:> Maybe we only define PLATNAME and not bother with PLATFORM? > >I would vote for PLATFORM, not least because ''PLATNAME'' is just plain stupid sounding. I wouldn''t fight changing PLATFORM to be the same text as PLATFORM is now, I don''t like the decorated text so much either. Roy
> I would vote for PLATFORM,+1. Real words easier to remember.> I wouldn''t fight changing PLATFORM to be the same text > as PLATFORM is now, I don''t like the decorated text so much either. >Yeah, it''s ugly. I''ll update SVN later. cheers alex
Roy Sutton wrote:> Kevin Smith wrote: >> Is there any reason not to use evt_window_create for all platforms here? >> > At first I considered that then I realized that people using our samples > as a launching point for their own applications may wish to know what''s > really going on so they can be aware of those places where the > cross-platform toolkit has some ''holes.'' I wouldn''t fight changing it > as it makes the sample cleaner. Just letting you know my thought process.I agree that our samples should guide folks as they write wxRuby apps. To that end, I would encourage us to use techniques that work across all platforms, so folks don''t have to re-write their apps later to get them to work on a new platform. I would rather deal with cross-platform oddities in our docs, or perhaps in comments in the sample code, rather than in the code itself. Thanks, Kevin
Kevin Smith wrote:> I would rather deal with cross-platform oddities in our docs, or perhaps > in comments in the sample code, rather than in the code itself. >Like this? -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ShapedWindow.rbw.patch Url: http://rubyforge.org/pipermail/wxruby-users/attachments/20060918/0115eb23/attachment.pl
Roy Sutton wrote:> Kevin Smith wrote: >> I would rather deal with cross-platform oddities in our docs, or >> perhaps in comments in the sample code, rather than in the code itself. >> > Like this? >Well, that doesn''t work. I didn''t even test it. We don''t support evt_window_create yet. I added it and it doesn''t fire (on MSW) so... We''re back to what we had. Please disregard the patch for now. Roy
Hi OK, now is Wx::PLATFORM == ''WXGTK'' # or ''WXMAC'' or ''WXMSW'' etc I updated the GTK test in ShapedWindow.rbw, but removed the Mac test at there doesn''t seem to be a problem with the tooltip clipping. alex Alex Fenton wrote:>> I would vote for PLATFORM, >> > +1. Real words easier to remember. > >> I wouldn''t fight changing PLATFORM to be the same text >> as PLATFORM is now, I don''t like the decorated text so much either. >> >> > Yeah, it''s ugly. > > I''ll update SVN later. > > cheers > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
Seemingly Similar Threads
- [994] branches/wxruby2/wxwidgets_282/samples/bigdemo/ShapedWindow.rbw: Draw bitmap via paint method rather than directly with a ClientDC
- [980] branches/wxruby2/wxwidgets_282/samples/bigdemo/ShapedWindow.rbw: Use Window#paint instead of PaintDC.new
- About.rbw.patch
- SVN and demo files
- Running code after a modal dialog is shown