home *** CD-ROM | disk | FTP | other *** search
- # $Id: Application.pl,v 1.1 1996/07/26 05:15:15 pedja Exp $
-
- # Application.pl: converted from the original Application.wos
- # The original file contains the following notice:
- #
- # You may freely copy, distribute, and reuse the code in this example.
- # NeXT disclaims any warranty of any kind, expressed or implied, as to its
- # fitness for any particular use.
- # This example consistes of beta, untested code. Use it at your own risk.
- #
- # Written by Jean-Marie Hullot, CTO, NeXT Software Inc
-
- package WO::DodgeLite;
- use WOPerl;
-
- @IVARS=qw(dodgeData);
- @SESSION=qw(customerChoice);
- %FLAGS=(
- 'rawSet' => 1,
- # 'traceSet' => 1,
- # 'traceGet' => 1,
- # 'traceInvoke' => 1,
- );
-
- sub awake {
- my $self=shift;
- #obj($self)->setTraceGet(1);
- #obj($self)->setTraceSet(1);
- my $filePath = $WOApp->pathForResourceOfType("DodgeData","dict");
- my $dd=NSDictionary->dictionaryWithContentsOfFile($filePath);
- $self->{'dodgeData'}=$dd;
- return;
- }
-
- # Get all the car objects
- sub allCars {
- my $self=shift;
- return $self->{'dodgeData'}->objectForKey("cars")->allValues;
- }
-
- # Get all the car models
- sub modelsDict {
- return $_[0]->{'dodgeData'}->objectForKey('models');
- }
-
- # Get all the types of cars
- sub typesDict {
- return $_[0]->{'dodgeData'}->objectForKey('types');
- }
-
- # Get all the option packages
- sub packagesDict {
- return $_[0]->{'dodgeData'}->objectForKey('packages');
- }
-
- # Get all the car colors
- sub colorsDict {
- return $_[0]->{'dodgeData'}->objectForKey('colors');
- }
-
- # The following methods provide access to other pages. They are used in
- # the declaration files. For example,
- # CARPAGE:WOActiveImage {
- # src = "../Images/Buttons/ChangeOptions.gif";
- # action = WOApp.carPage;
- # };
-
- # Return the first page
- sub mainPage { return $WOApp->pageWithName("Main"); }
-
- # Return the second page
- sub selectedCarsPage { return $WOApp->pageWithName("SelectedCars"); }
-
- # Return the third page
- sub carPage { return $WOApp->pageWithName("Car"); }
-
- 'WO::DodgeLite';
- #EOF
-