CAD::Drawing::GUI - A can of worms uncapped and recapped.
This module organizes one or more CAD::Drawing::GUI::View objects around one or more CAD::Drawing objects. This should be fun.
write me
Eric L. Wilhelm <ewilhelm at cpan dot org>
http://scratchcomputing.com
This module is copyright (C) 2004-2006 by Eric L. Wilhelm.
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)
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.
CAD::Drawing::GUI::View
$gui = CAD::Drawing::GUI->new();
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);
Updates all of the canvases with the drawing numbered $n and item $addr.
$gui->drw_update($n, $addr);
my $view = $mw->CADView(); $gui->add_view($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);
Activate the view_bindings for all views (this is done automatically with the new_view() method.)
$gui->view_bindings();
Activates the default keybindings for all mainwindows.
$gui->key_bindings();
These are
Esc - Stop current command q - Exit (should this call some hook?)
Activates view-related (zoom, measure, etc) keybindings for all mainwindows.
$gui->view_key_bindings();
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();
Calls bind_off() for all views.
$gui->event_done();
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);
To install CAD::Drawing::GUI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CAD::Drawing::GUI
CPAN shell
perl -MCPAN -e shell install CAD::Drawing::GUI
For more information on module installation, please visit the detailed CPAN module installation guide.