The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CAD::Drawing::GUI - A can of worms uncapped and recapped.

DESCRIPTION

This module organizes one or more CAD::Drawing::GUI::View objects around one or more CAD::Drawing objects. This should be fun.

SYNOPSIS

write me

AUTHOR

Eric L. Wilhelm <ewilhelm at cpan dot org>

http://scratchcomputing.com

COPYRIGHT

This module is copyright (C) 2004-2006 by Eric L. Wilhelm.

LICENSE

This module is distributed under the same terms as Perl. See the Perl source package for details.

You may use this software under one of the following licenses:

  (1) GNU General Public License
    (found at http://www.gnu.org/copyleft/gpl.html)
  (2) Artistic License
    (found at http://www.perl.com/pub/language/misc/Artistic.html)

Modifications

The source code of this module is made freely available and distributable under the GPL or Artistic License. Modifications to and use of this software must adhere to one of these licenses. Changes to the code should be noted as such and this notification (as well as the above copyright information) must remain intact on all copies of the code.

Additionally, while the author is actively developing this code, notification of any intended changes or extensions would be most helpful in avoiding repeated work for all parties involved. Please contact the author with any such development plans.

SEE ALSO

  CAD::Drawing::GUI::View

Constructor

new

  $gui = CAD::Drawing::GUI->new();

Drawing Management Methods

add_drawing

Adds a drawing to the control of the $gui object. Returns the id for this drawing. These id's are not re-used.

  $number = $gui->add_drawing($drw, \%options);

drw_update

Updates all of the canvases with the drawing numbered $n and item $addr.

  $gui->drw_update($n, $addr);

View Methods

add_view

  my $view = $mw->CADView();
  $gui->add_view($view);

new_view

Creates a new CAD::Drawing::GUI::View object, packs, and returns it. If you want more control, see add_view().

  my $view = $gui->new_view($mw, \%options);

view_bindings

Activate the view_bindings for all views (this is done automatically with the new_view() method.)

  $gui->view_bindings();

key_bindings

Activates the default keybindings for all mainwindows.

  $gui->key_bindings();

These are

  Esc - Stop current command
  q   - Exit (should this call some hook?)

view_key_bindings

Activates view-related (zoom, measure, etc) keybindings for all mainwindows.

  $gui->view_key_bindings();

view_parents

Returns a hash of the parents of the gui object's views. This hash is keyed by the string representation of the toplevel, and each entry contains an array reference with the toplevel and it's views.

  $gui->view_parents();

event_done

Calls bind_off() for all views.

  $gui->event_done();

click_bind

Calls $view->click_bind() for each active view. See the documentation of CAD::GUI::View ($button is optional and defaults to 1.)

  $gui->click_bind($sub, $button);