Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Tk::Calculator::RPN::HP 1.2

    Download button

    No screenshots available
    Downloads: 456  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.6/5)
    8 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Steve Lidie | More programs
    Perl Artistic License / FREE
    November 21st, 2007, 23:06 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Tk::Calculator::RPN::HP description

    Tk::Calculator::RPN::HP contains Hewlett-Packard RPN calculators.

    Tk::Calculator::RPN::HP contains Hewlett-Packard RPN calculators.

    SYNOPSIS

    use Tk::Calculator::RPN::HP;
    $mw->Calculator(
    -type => '21' | '16c'
    )->pack;

    Tk::Calculator::RPN::HP is the OO base class and Exporter module for Perl/Tk Hewlett-Packard Reverse Polish Notation (RPN) calculators. As a base class it provides methods common to all calculators; for instance, stack manipulation, function evaluation, and instance creation activities. As an exporter of data, it provides global variables and function subroutine definitions.

    Tk::Calculator::RPN::HP provides a single constructor, Calculator, as shown in the SYNOPSIS section.

    Tk::Calculator::RPN::HP provides a Populate method implicity used by all calculator subclasses. The only option that Populate requires is -type, the type of calculator. Given -type, Populate loads the appropriate module, performs common instance pre-initialization, and then calls out to the subclass' Populate method to create the actual calculator.

    Subclasses of Tk::Calculator::RPN::HP have this basic structure:

    $Tk::Calculator::RPN::HP_21::VERSION = '1.2';

    package Tk::Calculator::RPN::HP_21;

    use Tk::widgets qw/SlideSwitch/;
    use Tk::Calculator::RPN::HP;
    use base qw/Tk::Calculator::RPN::HP/;
    use strict;

    our $HELP;

    sub ClassInit {

    my ($class, $mw) = @_;

    $HELP = $class->build_help_window($mw);
    $class->SUPER::ClassInit($mw);

    } # end ClassInit

    sub Populate {

    my ($self, $args) = @_;

    ...

    $self->build_help_button($frame1, $HELP)->pack(qw/-side left/);

    ...

    } # end Populate

    # Function key processors.

    sub clxclr {

    my ($self) = @_;

    return unless $self->{ONOFF};
    if ($self->{G_PRESSED}) { # clr
    $self->clr;
    } else { # clx
    $self->clx;
    }

    } # end clxclr

    1;

    As you can see, the module is simply a standard Perl/Tk mega-widget.
    You are required to invoke two methods, build_help_window and build_help_button. build_help_window creates a Toplevel that's exposed when the ? Button is pressed. build_help_button builds the ? Button proper. Because the Toplevel help window is used by all class instances, it's typically created in ClassInit. You call build_help_button when and where you want the ? packed.

    Although most calculator functions are provided by the base class, you may find it necessary to write your own function key processors.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    RPN calculator | Hewlett-Packard calculator | Perl module | HP | RPN | calculator

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM