[wxruby-users] wxruby effect like fxshutter

Fabio Petrucci fabio.petrucci at gmail.com
Wed Mar 5 04:36:29 EST 2008


That's what i was looking for... thank you Mario, nice example :)

On Tue, Mar 4, 2008 at 10:08 PM, Mario Steele <mario at ruby-im.net> wrote:

> 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/
>
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080305/d133a864/attachment-0001.html 


More information about the wxruby-users mailing list