EekBoek
view release on metacpan or search on metacpan
lib/EB/Config/Data.pm view on Meta::CPAN
],
},
{ section => "general",
tag => N__("Algemeen"),
keys =>
[
{ name => "admdir", tag => N__("Folder voor administraties"), type => 'folder', value => '$HOME/.eekboek/admdir' },
{ name => "wizard", tag => N__("Forceer wizard"), type => 'bool', value => undef },
],
},
{ section => "prefs",
tag => N__("Voorkeursinstellingen"),
keys =>
[
{ name => "journal", tag => N__("Toon journaalpost na elke boeking"), type => 'bool', value => undef },
],
},
{ section => "Database",
keys =>
[
{ name => "name", tag => N__("Naam"), type => 'string', value => undef },
lib/EB/Wx/Shell/MainFrame.pm view on Meta::CPAN
# warn("app: $out\n");
if ( $capturing || $out eq "<html>" ) {
$capturing .= $out . "\n";
if ( $out eq "<html>" ) {
$self->SetCursor(wxHOURGLASS_CURSOR);
}
elsif ( $out eq "</html>" ) {
$self->SetCursor(wxNullCursor);
my ($title) = ($capturing =~ m{<title>(.+?)</title>});
#warn("captured $title: ", length($capturing), " characters\n");
my $panel = $self->{prefs_repwin} ? "d_htmlpanel" : "d_htmlpanel_$title";
$self->{$panel} ||= EB::Wx::Shell::HtmlViewer->new
($self, -1, $title);
$self->{$panel}->Show(0);
$self->{$panel}->html->SetPage($capturing);
$self->{$panel}->htmltext = $capturing;
$self->{$panel}->SetTitle($title);
$self->{$panel}->Show(1);
$capturing = "";
}
}
lib/EB/Wx/Shell/MainFrame.pm view on Meta::CPAN
sub ProcessMessages {
my ($self, $err) = @_;
return unless $err;
my @err = split(/\n+/, $err);
while ( @err ) {
$err = shift(@err);
my @i;
if ( $err =~ /^\?+(.*)/ ) {
$self->ShowText($err, wxRED);
next unless $self->{prefs_errorpopup};
@i = ($1, _T("Fout"), wxOK|wxICON_ERROR);
}
elsif ( $err =~ /^\!+(.*)/ ) {
$self->ShowText($err, Wx::Colour->new("magenta"));
next unless $self->{prefs_warnpopup};
@i = ($1, _T("Waarschuwing"), wxOK|wxICON_WARNING);
}
else {
$self->ShowText($err, wxGREEN);
next unless $self->{prefs_infopopup};
@i = ($err, _T("Mededeling"), wxOK|wxICON_INFORMATION);
}
my $md = Wx::MessageDialog->new($self, @i, wxDefaultPosition);
$md->ShowModal;
$md->Destroy;
}
}
sub OnTextEnter {
lib/EB/Wx/Shell/MainFrame.pm view on Meta::CPAN
# wxGlade: EB::Wx::Shell::MainFrame::OnClear <event_handler>
$self->{t_output}->SetValue("");
# end wxGlade
}
sub OnPrefs {
my ($self, $event) = @_;
# wxGlade: EB::Wx::Shell::MainFrame::OnPrefs <event_handler>
$self->{d_prefs} ||= EB::Wx::Shell::PreferencesDialog->new($self, -1, "Preferences");
for ( keys( %$prefctl ) ) {
if ( exists $self->{d_prefs}->{"cx_$_"} ) {
$self->{d_prefs}->{"cx_$_"}->SetValue( $self->{"prefs_$_"} );
}
elsif ( exists $self->{d_prefs}->{"spin_$_"} ) {
$self->{d_prefs}->{"spin_$_"}->SetValue( $self->{"prefs_$_"} );
}
}
my $ret = $self->{d_prefs}->ShowModal;
if ( $ret == wxID_OK ) {
for ( keys( %$prefctl ) ) {
if ( exists $self->{d_prefs}->{"cx_$_"} ) {
$self->{"prefs_$_"} = $self->{d_prefs}->{"cx_$_"}->GetValue;
}
elsif ( exists $self->{d_prefs}->{"spin_$_"} ) {
$self->{"prefs_$_"} = $self->{d_prefs}->{"spin_$_"}->GetValue;
}
}
}
# end wxGlade
}
sub FillHistory {
my ($self, $histfile) = @_;
$self->{_histfile} = $histfile;
lib/EB/Wx/Shell/MainFrame.pm view on Meta::CPAN
}
close($fh);
}
$self->{_cmdinit} = $self->{_cmdptr} = $#{$self->{_cmd}} + 1;
}
sub GetPreferences {
my ( $self ) = @_;
my $conf = Wx::ConfigBase::Get;
for ( keys( %$prefctl ) ) {
$self->{"prefs_$_"} = $conf->ReadInt( "preferences/$_", $prefctl->{$_} );
}
}
sub SaveHistory {
my $self = shift;
my $fh;
my $histfile = $self->{_histfile};
$self->{_cmdinit} = $self->{_cmdptr} - $self->{prefs_histlines};
$self->{_cmdinit} = 0 if $self->{_cmdinit} < 0;
return unless open($fh, ">:encoding(utf-8)", $histfile);
while ( $self->{_cmdinit} < $self->{_cmdptr} ) {
print { $fh } ($self->{_cmd}->[$self->{_cmdinit}], "\n");
$self->{_cmdinit}++;
}
close($fh);
}
sub SavePreferences {
my ( $self ) = @_;
my $conf = Wx::ConfigBase::Get;
for ( keys( %$prefctl ) ) {
$conf->WriteInt( "preferences/$_", $self->{"prefs_$_"} );
}
}
sub OnMenuBal {
my ($self, $event, $sub) = @_;
# wxGlade: EB::Wx::Shell::MainFrame::OnMenuBal <event_handler>
if ( defined $sub && $sub >= 0 ) {
$self->_cmd("balans --verdicht --detail=$sub --gen-wxhtml\n");
}
lib/EB/Wx/Shell/PreferencesDialog.pm view on Meta::CPAN
$pos = wxDefaultPosition unless defined $pos;
$size = wxDefaultSize unless defined $size;
$name = "" unless defined $name;
# begin wxGlade: EB::Wx::Shell::PreferencesDialog::new
$style = wxDEFAULT_DIALOG_STYLE
unless defined $style;
$self = $self->SUPER::new( $parent, $id, $title, $pos, $size, $style, $name );
$self->{sz_prefs_inner_staticbox} = Wx::StaticBox->new($self, -1, _T("Voorkeuren") );
$self->{cx_repwin} = Wx::CheckBox->new($self, -1, _T("Rapporten in hetzelfde venster"), wxDefaultPosition, wxDefaultSize, );
$self->{cx_errorpopup} = Wx::CheckBox->new($self, -1, _T("Popup window voor foutboodschappen"), wxDefaultPosition, wxDefaultSize, );
$self->{cx_warnpopup} = Wx::CheckBox->new($self, -1, _T("Popup window voor waarschuwingen"), wxDefaultPosition, wxDefaultSize, );
$self->{cx_infopopup} = Wx::CheckBox->new($self, -1, _T("Popup window voor mededelingen"), wxDefaultPosition, wxDefaultSize, );
$self->{l_histlines} = Wx::StaticText->new($self, -1, _T("Aantal te bewaren regels invoer historie:"), wxDefaultPosition, wxDefaultSize, );
$self->{spin_histlines} = Wx::SpinCtrl->new($self, -1, "200", wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 99999, 200);
$self->{b_prefs_cancel} = Wx::Button->new($self, wxID_CANCEL, "");
$self->{b_prefs_ok} = Wx::Button->new($self, wxID_OK, "");
$self->__set_properties();
$self->__do_layout();
Wx::Event::EVT_BUTTON($self, $self->{b_prefs_cancel}->GetId, \&OnCancel);
Wx::Event::EVT_BUTTON($self, $self->{b_prefs_ok}->GetId, \&OnAccept);
# end wxGlade
return $self;
}
sub __set_properties {
my $self = shift;
# begin wxGlade: EB::Wx::Shell::PreferencesDialog::__set_properties
$self->SetTitle(_T("Voorkeursinstellingen"));
$self->{cx_errorpopup}->SetValue(1);
$self->{cx_warnpopup}->SetValue(1);
$self->{cx_infopopup}->SetValue(1);
$self->{b_prefs_ok}->SetDefault();
# end wxGlade
}
sub __do_layout {
my $self = shift;
# begin wxGlade: EB::Wx::Shell::PreferencesDialog::__do_layout
$self->{sz_prefs_outer} = Wx::BoxSizer->new(wxVERTICAL);
$self->{sz_prefs_buttons} = Wx::BoxSizer->new(wxHORIZONTAL);
$self->{sz_prefs_inner}= Wx::StaticBoxSizer->new($self->{sz_prefs_inner_staticbox}, wxVERTICAL);
$self->{sz_prefs} = Wx::BoxSizer->new(wxVERTICAL);
$self->{sz_histlines} = Wx::BoxSizer->new(wxHORIZONTAL);
$self->{sz_prefs}->Add($self->{cx_repwin}, 0, wxADJUST_MINSIZE, 0);
$self->{sz_prefs}->Add($self->{cx_errorpopup}, 0, wxADJUST_MINSIZE, 0);
$self->{sz_prefs}->Add($self->{cx_warnpopup}, 0, wxADJUST_MINSIZE, 0);
$self->{sz_prefs}->Add($self->{cx_infopopup}, 0, wxADJUST_MINSIZE, 0);
$self->{sz_histlines}->Add($self->{l_histlines}, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL|wxADJUST_MINSIZE, 5);
$self->{sz_histlines}->Add($self->{spin_histlines}, 0, wxALIGN_CENTER_VERTICAL|wxADJUST_MINSIZE, 0);
$self->{sz_histlines}->Add(0, 0, 1, wxEXPAND|wxADJUST_MINSIZE, 0);
$self->{sz_prefs}->Add($self->{sz_histlines}, 1, wxEXPAND, 0);
$self->{sz_prefs}->Add(1, 5, 0, wxADJUST_MINSIZE, 0);
$self->{sz_prefs_inner}->Add($self->{sz_prefs}, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5);
$self->{sz_prefs_outer}->Add($self->{sz_prefs_inner}, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5);
$self->{sz_prefs_buttons}->Add(5, 1, 1, wxEXPAND|wxADJUST_MINSIZE, 0);
$self->{sz_prefs_buttons}->Add($self->{b_prefs_cancel}, 0, wxADJUST_MINSIZE, 0);
$self->{sz_prefs_buttons}->Add($self->{b_prefs_ok}, 0, wxLEFT|wxADJUST_MINSIZE, 5);
$self->{sz_prefs_outer}->Add($self->{sz_prefs_buttons}, 0, wxALL|wxEXPAND, 5);
$self->SetSizer($self->{sz_prefs_outer});
$self->{sz_prefs_outer}->Fit($self);
$self->Layout();
# end wxGlade
}
sub OnCancel {
my ($self, $event) = @_;
# wxGlade: EB::Wx::Shell::PreferencesDialog::OnCancel <event_handler>
$event->Skip;
( run in 2.028 seconds using v1.01-cache-2.11-cpan-0bb4e1dffa6 )