App-InvestSim
view release on metacpan or search on metacpan
lib/App/InvestSim/Config.pm view on Meta::CPAN
my @array_export = qw(NUM_LOAN_DURATION NUM_LOAN_AMOUNT);
my @modes_export = qw(MONTHLY_PAYMENT LOAN_COST YEARLY_RENT_AFTER_LOAN MEAN_BALANCE_LOAN_DURATION MEAN_BALANCE_OVERALL NET_GAIN INVESTMENT_RETURN MAX_MODE TABLE_DATA TABLE_TOTAL);
our @EXPORT = ();
our @EXPORT_OK = (@array_export, @modes_export);
our %EXPORT_TAGS = (all => \@EXPORT_OK, array => \@array_export, modes => \@modes_export);
# The dimensions of the main tables displayed in the program. These are not pure
# GUI configuration value because they also impact the simulation values.
#
# When these values are updated, the default values for the arrays in
# $App::InvestSim::Values::values_config should be updated too.
use constant NUM_LOAN_DURATION => 6;
use constant NUM_LOAN_AMOUNT => 7;
# Constants for each computation type that can be displayed.
use constant MONTHLY_PAYMENT => 0;
use constant LOAN_COST => 1;
use constant YEARLY_RENT_AFTER_LOAN => 2;
use constant MEAN_BALANCE_LOAN_DURATION => 3;
use constant MEAN_BALANCE_OVERALL => 4;
lib/App/InvestSim/Values.pm view on Meta::CPAN
pinel_zone => [0, \&validate_non_negative_integer],
automatic_duration => [0, \&validate_non_negative_integer],
);
Hash::Util::lock_hash(%values_config);
# This hash has the actual values used to configure the simulation. Its keys are
# restricted to those of %values_config.
our %values;
Hash::Util::lock_keys(%values, keys %values_config);
# Whether any of the values has changed. This must be updated manually by the
# caller when they touch a value.
our $has_changes = 0;
# Display a dialog box and returns true if the user wants to proceed.
sub lose_data_warning {
return 1 unless $has_changes;
my $res = Tkx::tk___messageBox(
-message => 'La simulation courante sera perdue, êtes-vous sûr de vouloir continuer ?',
-type => 'yesno', -icon => 'question', -title => 'Êtes-vous sûr?', -parent => '.');
return $res eq 'yes';
( run in 0.271 second using v1.01-cache-2.11-cpan-05444aca049 )