Hi Please find attached a set of patches to implement Sash Layouts plus a little sample. These are resizable panes that can be used to create an IDE-like application, with sidebars etc. They''re quite a lot more powerful than SplitterWindow, for example you can split an MDI client window, and you can have lots of them. Not quite as nice as wxAUI (Advanced User Interface) - a project for later ;) cheers alex _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
On Tue, 2006-08-01 at 18:41 +0100, Alex Fenton wrote:> Hi > > Please find attached a set of patches to implement Sash Layouts plus a > little sample.The patches didn''t apply cleanly, probably because I have already merged in other changes. I was able to move them around to make them fit. I got compile errors in LayoutAlgorithm, so I had to remove the "const" qualifiers on three of the methods in wxLayoutAlgorithm.h. While I was in there, I fixed the copyright notice and removed the messy comments. Then I was getting runtime errors because we had declared SASH to be MSWindows-only. I changed that (in fixevents.rb), and the sample app could run...but has some problems: 1. The draggable sash borders don''t appear 2. Dragging the horizontal sash does nothing 3. Dragging the vertical sash crashes with a runtime error Let me know if you need more details. I''m hoping you can submit fixes to get the sample working, now that the basic code has been merged. New topic: I would like to include some kind of license at the top of every sample file, saying that this code can be used for any purpose, without attribution. Without that, it is not clear to our users that they are free to use code fragments in their own code, without restriction. Any ideas what wording we could use? I''m not sure "public domain" is the right answer, because we are the primary source/author. Thanks, Kevin
> Then I was getting runtime errors because we had declared SASH to be > MSWindows-only. I changed that (in fixevents.rb)Oops, sorry, I forgot to include fixevents.rb with the patch - thanks> and the sample app > could run...but has some problems: > > 1. The draggable sash borders don''t appear >This does work on OS X at the moment. I had these sort of problems when I first ported the classes. It turned out to be down to the values of enum wxSashEdgePosition(SASH_TOP, SASH_RIGHT etc), and the values of enum wxLayoutOrientation(wxLAYOUT_VERTICAL, wxLAYOUT_HORIZONTAL). The values we had in RubyConstants.i and SashWindow.i didn''t tally up to the constant values as declared in the main wx headers in /usr/local/include. These are in wx/generic/sashwin.h and wx/generic/laywin.h respectively. I will have a look to see if there is anything inconsistent across platforms, or across the .i files. Any reports on MSWIN on this?> 2. Dragging the horizontal sash does nothing > > 3. Dragging the vertical sash crashes with a runtime error >It looks like the wrong event type is being generated - CommandEvent instead of SashEvent, and it then misses the method get_drag_rect. I think this is because the ordering of the event type mapping in EvtHandler.i has been changed (I guess because the patches didn''t apply cleanly). The correct order should be: else if(event.IsKindOf(CLASSINFO(wxSashEvent))) cEvent = cWxSashEvent.klass; else if(event.IsKindOf(CLASSINFO(wxCommandEvent))) cEvent = cWxCommandEvent.klass; Unfortunatley some changes checked in last night have broken the build process for me so I can''t test this right now.> Let me know if you need more details. I''m hoping you can submit fixes to > get the sample working, now that the basic code has been merged. >OK, thanks for your help with this. cheers alex
Kevin Smith wrote:> 3. Dragging the vertical sash crashes with a runtime error >Could you try the attached patch, please?> New topic: I would like to include some kind of license at the top of > every sample file, saying that this code can be used for any purpose, > without attribution. Without that, it is not clear to our users that > they are free to use code fragments in their own code, without > restriction. Any ideas what wording we could use? I''m not sure "public > domain" is the right answer, because we are the primary source/author. >As I understand it, ''public domain'' doesn''t disclaim authorship, but does allow unrestricted use. I''m happy with this licence - I use it for Weft QDA. cheers alex -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: EvtHandler.i.patch Url: http://rubyforge.org/pipermail/wxruby-users/attachments/20060818/d1a05496/attachment.ksh
On Fri, 2006-08-18 at 06:03 +0100, Alex Fenton wrote:> Kevin Smith wrote: > > 3. Dragging the vertical sash crashes with a runtime error > > > Could you try the attached patch, please?Yup, that fixed the crash. The sash boundaries are still invisible until I start to drag them, but the dragging does work. Thanks, Kevin