[wxruby-users] wxruby effect like fxshutter
Mario Steele
mario at ruby-im.net
Tue Mar 4 16:08:53 EST 2008
Hey guys,
Well, I got some time to put something simple together. Fortunatly Alex,
it's not a fully attached type of deal, as looking at the original Fox
example, it's just like utilizing Wx::Notebook. What I've done, is a simple
bit of code, that works similar to how FXShutter works, except for a few
differences.
One, it's wxRuby, not Fox, so keep that in mind, but the basics of it, are
these:
shutter.rb
Creates the class Wx::Shutter
It has three Methods within it:
Wx::Shutter.new(parent,id)
Creates a New Shutter Object.
Wx::Shutter#add_header(title)
Creates a New Header Button, which will toggle the associated list of items
with it. Returns the instance of Wx::Button used.
Wx::Shutter#add_item(header,text,icon=NullBitmap)
Add's a new item to the Header in question (Using the returned Wx::Button).
There is a Custom event created for notifying the programmer of when an item
has been selected within the headings.
ShutterEvent
ShutterEvent#header
Returns the Header Wx::Button associated with it.
ShutterEvent#item
Returns the 0 based index to item selected within the program itself.
Included, is a simple example, that just shows how it works, with events
executing and such, you should be able to use shutter.rb to do what you
want, all you need to do, is create each panel, and hide them all, then
simply show the one your interested in, or associated to the item in the
list.
Hope this helps you out, it's not perfect, but has similar ideas as to what
is being used in Fox.
L8ers,
On 2/25/08, Alex Fenton <alex at pressure.to> wrote:
>
> Gerard Rakoczy wrote:
> > i was searching for an efect in wxruby like fxshutter from fxruby.
> > http://www.fxruby.org/doc/examples.html
>
> The nearest thing is wxToolBook, which allows multiple pages to be
> controlled (like a notebook), but using icon tools rather than tabs to
> switch between windows.
>
> Unfortunately this is one of the few new classes in wxWidgets 2.8 that
> isn't currently ported in wxRuby. You could probably create a similar
> effect by using a ToolBar + using a Sizer to contain the main window,
> and swap and hide/show panels.
>
>
> alex
>
>
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
--
Mario Steele
http://www.trilake.net
http://www.ruby-im.net
http://rubyforge.org/projects/wxruby/
http://rubyforge.org/projects/wxride/
http://rubyforge.org/projects/vwmc/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080304/f1d36dc2/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shutter.rb
Type: application/octet-stream
Size: 1971 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080304/f1d36dc2/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_shutter.rb
Type: application/octet-stream
Size: 2365 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080304/f1d36dc2/attachment-0001.obj
More information about the wxruby-users
mailing list