wx::perl::smart

108
Wx::Perl::Smart Wx::Perl::Smart Schneller Bessere GUI's

Upload: lichtkind

Post on 19-May-2015

143 views

Category:

Software


0 download

DESCRIPTION

Vorstellung von Helfermodulen zu einfacheren ezwugung einer WxPerl GUI : https://bitbucket.org/lichtkind/wx-perl-smart

TRANSCRIPT

Page 1: Wx::Perl::Smart

Wx::Perl::SmartWx::Perl::Smart

Schneller Bessere GUI's

Page 2: Wx::Perl::Smart

Wx::Perl::Wx::Perl::SmartSmart

Page 3: Wx::Perl::Smart

Wx::Perl::Wx::Perl::SmartSmart

~~

Page 4: Wx::Perl::Smart

Wx::Perl::Wx::Perl::SmartSmart

~~

Page 5: Wx::Perl::Smart

Wx::Perl::Wx::Perl::SmartSmart

$var ~~ @list

Page 6: Wx::Perl::Smart

Wx::Perl::Smartsub OnInit {

my $app = shift;

# load localisation texts in chosen languagemy ($v, $dir, $f) = File::Spec->splitpath(__FILE__);$l18n_file = File::Spec->catfile($dir, $l18n_file) if $dir;die "localisation file $l18n_file is missing!" unless -e $l18n_file;my %l18n = %{YAML::Tiny->read( $l18n_file )->[0]{$language}};$app->{'l18n'} = \%l18n;

# loading the numbers of the remembered favorites$app->{'favorites'} = -e $fav_file ? YAML::Tiny->read( $fav_file ) : YAML::Tiny->new;my @remembered_pic_names = ref $app->{'favorites'}->[0] eq 'HASH' ? keys $app->{'favorites'}->[0] : ();

# making UImy $frame = $app->{'frame'} = Wx::Perl::Smart::Frame->new(__PACKAGE__." $VERSION", 'fixed_size');$frame->SubscribeStrings( $app->{'l18n'} );my $remember= sub { $frame->SetValues( $app->{'favorites'}[0]{ $_[0]->GetValue() } ); $app->Repaint()};my $repaint = sub { $app->Repaint() };my $boardsize = Wx::GetDisplaySize()->GetHeight() - 250;my $origin_offset = $app->{'origin_offset'} = $boardsize / 2;my $max_amp = $app->{'max_amp'} = $origin_offset - 10; # max amplitudemy %range_defaults = (# label, min, max, init

frequency_x => ['X', 1, 1, 30], frequency_y => ['Y', 1, 1, 30],amplitude_x => ['X', 0, 0, 360], amplitude_y => ['Y', 0, 0, 360],rotation => [$l18n{'amount'}, 1, 0, 30], friction => [$l18n{'friction'}, 0, 0, 200],length => [$l18n{'length'}, 12, 1, 100], density => [$l18n{'density'},100, 1, 100],thickness => [$l18n{'thickness'},1, 1, 12], zoom => [$l18n{'zoom'}, 0,-10, 10], start_colour=> [$l18n{'start'}, 0, 0,1500], flow_colour => [$l18n{'flow'}, 0, 0, 60],scale_colour=> [$l18n{'scale'}, 1, 1, 4],

);$frame->SubscribeWidgets

({$_ => Wx::Perl::DisplaySlider->new($frame, @{$range_defaults{$_}}, $repaint)}) for keys %range_defaults;$frame->SubscribeWidgets({

drawboard => Wx::Perl::DrawMap->new($frame, $boardsize),fav_select => [-ComboBox => \@remembered_pic_names, 0, -1, $remember],format_select=> [-ComboBox => [qw(PNG JPG TIFF BMP XPM)], 0, 70 ],save => [-Button => '~save', sub {$app->Save() }],save_all => [-Button => '~all', sub {$app->SaveAll() }],remember => [-Button => '~remember', sub {$app->Remember()}],forget => [-Button => '~forget', sub {$app->Forget() }],no_phase => [-Button => '~no', sub {$frame->SetValues(amplitude_x => 0, amplitude_y => 0);$app->Repaint()}],closed_phase => [-Button => '~closed', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 90);$app->Repaint()}],open_phase => [-Button => '~open', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 180);$app->Repaint()}],y_invers => [-CheckBox => '~y_inverse', 0, $repaint],rotation_dir => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(no left right)}], 0, &Wx::wxHORIZONTAL, $repaint),app_mode => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(lateral rotary free)}], 0, &Wx::wxHORIZONTAL, sub{}),

});

$frame->SetSmartLayout({flags => &Wx::wxGROW|&Wx::wxALL},[ # left part

'<drawboard>',10,{border => 10, flags => &Wx::wxALL|&Wx::wxGROW},'<fav_select>',['<format_select>', 10,'<save>', 10, '<save_all>', \1, '<forget>', 10, '<remember>'],

],[ # right half-TabbedBox => [

'~oscillators' =>[{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},['~mode :', '<app_mode>'],-LabeledBox =>['~frequency' =>[qw( <frequency_x> <frequency_y>)]], #<y_invers>-LabeledBox =>['~start_amp' =>[qw( <amplitude_x> <amplitude_y>),

{border => 5, flags => &Wx::wxALL|&Wx::wxGROW},['~phase :', \1, '<no_phase>', \1,'<closed_phase>', \1, '<open_phase>'],

]],-LabeledBox =>[ '~rotation ' =>[qw( <rotation_dir> <rotation> )]],{border => 10}, '<friction>',

],'~visuals' => [

{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},-LabeledBox =>['~line' =>[qw( <length> <density> )]], #<thickness>-LabeledBox =>['~color' =>[qw( <start_colour> <flow_colour> <scale_colour>)]],{border => 10},'<zoom>',

],],

]);$frame->ResetValues();$app->Repaint();$app->SetTopWindow($frame);1;

}

Page 7: Wx::Perl::Smart

Harmonograph

sub OnInit {my $app = shift;

# load localisation texts in chosen languagemy ($v, $dir, $f) = File::Spec->splitpath(__FILE__);$l18n_file = File::Spec->catfile($dir, $l18n_file) if $dir;die "localisation file $l18n_file is missing!" unless -e $l18n_file;my %l18n = %{YAML::Tiny->read( $l18n_file )->[0]{$language}};$app->{'l18n'} = \%l18n;

# loading the numbers of the remembered favorites$app->{'favorites'} = -e $fav_file ? YAML::Tiny->read( $fav_file ) : YAML::Tiny->new;my @remembered_pic_names = ref $app->{'favorites'}->[0] eq 'HASH' ? keys $app->{'favorites'}->[0] : ();

# making UImy $frame = $app->{'frame'} = Wx::Perl::Smart::Frame->new(__PACKAGE__." $VERSION", 'fixed_size');$frame->SubscribeStrings( $app->{'l18n'} );my $remember= sub { $frame->SetValues( $app->{'favorites'}[0]{ $_[0]->GetValue() } ); $app->Repaint()};my $repaint = sub { $app->Repaint() };my $boardsize = Wx::GetDisplaySize()->GetHeight() - 250;my $origin_offset = $app->{'origin_offset'} = $boardsize / 2;my $max_amp = $app->{'max_amp'} = $origin_offset - 10; # max amplitudemy %range_defaults = (# label, min, max, init

frequency_x => ['X', 1, 1, 30], frequency_y => ['Y', 1, 1, 30],amplitude_x => ['X', 0, 0, 360], amplitude_y => ['Y', 0, 0, 360],rotation => [$l18n{'amount'}, 1, 0, 30], friction => [$l18n{'friction'}, 0, 0, 200],length => [$l18n{'length'}, 12, 1, 100], density => [$l18n{'density'},100, 1, 100],thickness => [$l18n{'thickness'},1, 1, 12], zoom => [$l18n{'zoom'}, 0,-10, 10], start_colour=> [$l18n{'start'}, 0, 0,1500], flow_colour => [$l18n{'flow'}, 0, 0, 60],scale_colour=> [$l18n{'scale'}, 1, 1, 4],

);$frame->SubscribeWidgets

({$_ => Wx::Perl::DisplaySlider->new($frame, @{$range_defaults{$_}}, $repaint)}) for keys %range_defaults;$frame->SubscribeWidgets({

drawboard => Wx::Perl::DrawMap->new($frame, $boardsize),fav_select => [-ComboBox => \@remembered_pic_names, 0, -1, $remember],format_select=> [-ComboBox => [qw(PNG JPG TIFF BMP XPM)], 0, 70 ],save => [-Button => '~save', sub {$app->Save() }],save_all => [-Button => '~all', sub {$app->SaveAll() }],remember => [-Button => '~remember', sub {$app->Remember()}],forget => [-Button => '~forget', sub {$app->Forget() }],no_phase => [-Button => '~no', sub {$frame->SetValues(amplitude_x => 0, amplitude_y => 0);$app->Repaint()}],closed_phase => [-Button => '~closed', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 90);$app->Repaint()}],open_phase => [-Button => '~open', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 180);$app->Repaint()}],y_invers => [-CheckBox => '~y_inverse', 0, $repaint],rotation_dir => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(no left right)}], 0, &Wx::wxHORIZONTAL, $repaint),app_mode => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(lateral rotary free)}], 0, &Wx::wxHORIZONTAL, sub{}),

});

$frame->SetSmartLayout({flags => &Wx::wxGROW|&Wx::wxALL},[ # left part

'<drawboard>',10,{border => 10, flags => &Wx::wxALL|&Wx::wxGROW},'<fav_select>',['<format_select>', 10,'<save>', 10, '<save_all>', \1, '<forget>', 10, '<remember>'],

],[ # right half-TabbedBox => [

'~oscillators' =>[{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},['~mode :', '<app_mode>'],-LabeledBox =>['~frequency' =>[qw( <frequency_x> <frequency_y>)]], #<y_invers>-LabeledBox =>['~start_amp' =>[qw( <amplitude_x> <amplitude_y>),

{border => 5, flags => &Wx::wxALL|&Wx::wxGROW},['~phase :', \1, '<no_phase>', \1,'<closed_phase>', \1, '<open_phase>'],

]],-LabeledBox =>[ '~rotation ' =>[qw( <rotation_dir> <rotation> )]],{border => 10}, '<friction>',

],'~visuals' => [

{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},-LabeledBox =>['~line' =>[qw( <length> <density> )]], #<thickness>-LabeledBox =>['~color' =>[qw( <start_colour> <flow_colour> <scale_colour>)]],{border => 10},'<zoom>',

],],

]);$frame->ResetValues();$app->Repaint();$app->SetTopWindow($frame);1;

}

Page 8: Wx::Perl::Smart

Harmonograph

sub OnInit {my $app = shift;

# load localisation texts in chosen languagemy ($v, $dir, $f) = File::Spec->splitpath(__FILE__);$l18n_file = File::Spec->catfile($dir, $l18n_file) if $dir;die "localisation file $l18n_file is missing!" unless -e $l18n_file;my %l18n = %{YAML::Tiny->read( $l18n_file )->[0]{$language}};$app->{'l18n'} = \%l18n;

# loading the numbers of the remembered favorites$app->{'favorites'} = -e $fav_file ? YAML::Tiny->read( $fav_file ) : YAML::Tiny->new;my @remembered_pic_names = ref $app->{'favorites'}->[0] eq 'HASH' ? keys $app->{'favorites'}->[0] : ();

# making UImy $frame = $app->{'frame'} = Wx::Perl::Smart::Frame->new(__PACKAGE__." $VERSION", 'fixed_size');$frame->SubscribeStrings( $app->{'l18n'} );my $remember= sub { $frame->SetValues( $app->{'favorites'}[0]{ $_[0]->GetValue() } ); $app->Repaint()};my $repaint = sub { $app->Repaint() };my $boardsize = Wx::GetDisplaySize()->GetHeight() - 250;my $origin_offset = $app->{'origin_offset'} = $boardsize / 2;my $max_amp = $app->{'max_amp'} = $origin_offset - 10; # max amplitudemy %range_defaults = (# label, min, max, init

frequency_x => ['X', 1, 1, 30], frequency_y => ['Y', 1, 1, 30],amplitude_x => ['X', 0, 0, 360], amplitude_y => ['Y', 0, 0, 360],rotation => [$l18n{'amount'}, 1, 0, 30], friction => [$l18n{'friction'}, 0, 0, 200],length => [$l18n{'length'}, 12, 1, 100], density => [$l18n{'density'},100, 1, 100],thickness => [$l18n{'thickness'},1, 1, 12], zoom => [$l18n{'zoom'}, 0,-10, 10], start_colour=> [$l18n{'start'}, 0, 0,1500], flow_colour => [$l18n{'flow'}, 0, 0, 60],scale_colour=> [$l18n{'scale'}, 1, 1, 4],

);$frame->SubscribeWidgets

({$_ => Wx::Perl::DisplaySlider->new($frame, @{$range_defaults{$_}}, $repaint)}) for keys %range_defaults;$frame->SubscribeWidgets({

drawboard => Wx::Perl::DrawMap->new($frame, $boardsize),fav_select => [-ComboBox => \@remembered_pic_names, 0, -1, $remember],format_select=> [-ComboBox => [qw(PNG JPG TIFF BMP XPM)], 0, 70 ],save => [-Button => '~save', sub {$app->Save() }],save_all => [-Button => '~all', sub {$app->SaveAll() }],remember => [-Button => '~remember', sub {$app->Remember()}],forget => [-Button => '~forget', sub {$app->Forget() }],no_phase => [-Button => '~no', sub {$frame->SetValues(amplitude_x => 0, amplitude_y => 0);$app->Repaint()}],closed_phase => [-Button => '~closed', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 90);$app->Repaint()}],open_phase => [-Button => '~open', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 180);$app->Repaint()}],y_invers => [-CheckBox => '~y_inverse', 0, $repaint],rotation_dir => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(no left right)}], 0, &Wx::wxHORIZONTAL, $repaint),app_mode => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(lateral rotary free)}], 0, &Wx::wxHORIZONTAL, sub{}),

});

$frame->SetSmartLayout({flags => &Wx::wxGROW|&Wx::wxALL},[ # left part

'<drawboard>',10,{border => 10, flags => &Wx::wxALL|&Wx::wxGROW},'<fav_select>',['<format_select>', 10,'<save>', 10, '<save_all>', \1, '<forget>', 10, '<remember>'],

],[ # right half-TabbedBox => [

'~oscillators' =>[{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},['~mode :', '<app_mode>'],-LabeledBox =>['~frequency' =>[qw( <frequency_x> <frequency_y>)]], #<y_invers>-LabeledBox =>['~start_amp' =>[qw( <amplitude_x> <amplitude_y>),

{border => 5, flags => &Wx::wxALL|&Wx::wxGROW},['~phase :', \1, '<no_phase>', \1,'<closed_phase>', \1, '<open_phase>'],

]],-LabeledBox =>[ '~rotation ' =>[qw( <rotation_dir> <rotation> )]],{border => 10}, '<friction>',

],'~visuals' => [

{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},-LabeledBox =>['~line' =>[qw( <length> <density> )]], #<thickness>-LabeledBox =>['~color' =>[qw( <start_colour> <flow_colour> <scale_colour>)]],{border => 10},'<zoom>',

],],

]);$frame->ResetValues();$app->Repaint();$app->SetTopWindow($frame);1;

}

Page 9: Wx::Perl::Smart

Harmonograph

sub OnInit {my $app = shift;

# load localisation texts in chosen languagemy ($v, $dir, $f) = File::Spec->splitpath(__FILE__);$l18n_file = File::Spec->catfile($dir, $l18n_file) if $dir;die "localisation file $l18n_file is missing!" unless -e $l18n_file;my %l18n = %{YAML::Tiny->read( $l18n_file )->[0]{$language}};$app->{'l18n'} = \%l18n;

# loading the numbers of the remembered favorites$app->{'favorites'} = -e $fav_file ? YAML::Tiny->read( $fav_file ) : YAML::Tiny->new;my @remembered_pic_names = ref $app->{'favorites'}->[0] eq 'HASH' ? keys $app->{'favorites'}->[0] : ();

# making UImy $frame = $app->{'frame'} = Wx::Perl::Smart::Frame->new(__PACKAGE__." $VERSION", 'fixed_size');$frame->SubscribeStrings( $app->{'l18n'} );my $remember= sub { $frame->SetValues( $app->{'favorites'}[0]{ $_[0]->GetValue() } ); $app->Repaint()};my $repaint = sub { $app->Repaint() };my $boardsize = Wx::GetDisplaySize()->GetHeight() - 250;my $origin_offset = $app->{'origin_offset'} = $boardsize / 2;my $max_amp = $app->{'max_amp'} = $origin_offset - 10; # max amplitudemy %range_defaults = (# label, min, max, init

frequency_x => ['X', 1, 1, 30], frequency_y => ['Y', 1, 1, 30],amplitude_x => ['X', 0, 0, 360], amplitude_y => ['Y', 0, 0, 360],rotation => [$l18n{'amount'}, 1, 0, 30], friction => [$l18n{'friction'}, 0, 0, 200],length => [$l18n{'length'}, 12, 1, 100], density => [$l18n{'density'},100, 1, 100],thickness => [$l18n{'thickness'},1, 1, 12], zoom => [$l18n{'zoom'}, 0,-10, 10], start_colour=> [$l18n{'start'}, 0, 0,1500], flow_colour => [$l18n{'flow'}, 0, 0, 60],scale_colour=> [$l18n{'scale'}, 1, 1, 4],

);$frame->SubscribeWidgets

({$_ => Wx::Perl::DisplaySlider->new($frame, @{$range_defaults{$_}}, $repaint)}) for keys %range_defaults;$frame->SubscribeWidgets({

drawboard => Wx::Perl::DrawMap->new($frame, $boardsize),fav_select => [-ComboBox => \@remembered_pic_names, 0, -1, $remember],format_select=> [-ComboBox => [qw(PNG JPG TIFF BMP XPM)], 0, 70 ],save => [-Button => '~save', sub {$app->Save() }],save_all => [-Button => '~all', sub {$app->SaveAll() }],remember => [-Button => '~remember', sub {$app->Remember()}],forget => [-Button => '~forget', sub {$app->Forget() }],no_phase => [-Button => '~no', sub {$frame->SetValues(amplitude_x => 0, amplitude_y => 0);$app->Repaint()}],closed_phase => [-Button => '~closed', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 90);$app->Repaint()}],open_phase => [-Button => '~open', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 180);$app->Repaint()}],y_invers => [-CheckBox => '~y_inverse', 0, $repaint],rotation_dir => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(no left right)}], 0, &Wx::wxHORIZONTAL, $repaint),app_mode => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(lateral rotary free)}], 0, &Wx::wxHORIZONTAL, sub{}),

});

$frame->SetSmartLayout({flags => &Wx::wxGROW|&Wx::wxALL},[ # left part

'<drawboard>',10,{border => 10, flags => &Wx::wxALL|&Wx::wxGROW},'<fav_select>',['<format_select>', 10,'<save>', 10, '<save_all>', \1, '<forget>', 10, '<remember>'],

],[ # right half-TabbedBox => [

'~oscillators' =>[{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},['~mode :', '<app_mode>'],-LabeledBox =>['~frequency' =>[qw( <frequency_x> <frequency_y>)]], #<y_invers>-LabeledBox =>['~start_amp' =>[qw( <amplitude_x> <amplitude_y>),

{border => 5, flags => &Wx::wxALL|&Wx::wxGROW},['~phase :', \1, '<no_phase>', \1,'<closed_phase>', \1, '<open_phase>'],

]],-LabeledBox =>[ '~rotation ' =>[qw( <rotation_dir> <rotation> )]],{border => 10}, '<friction>',

],'~visuals' => [

{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},-LabeledBox =>['~line' =>[qw( <length> <density> )]], #<thickness>-LabeledBox =>['~color' =>[qw( <start_colour> <flow_colour> <scale_colour>)]],{border => 10},'<zoom>',

],],

]);$frame->ResetValues();$app->Repaint();$app->SetTopWindow($frame);1;

}

Page 10: Wx::Perl::Smart

Harmonograph

sub OnInit {my $app = shift;

# load localisation texts in chosen languagemy ($v, $dir, $f) = File::Spec->splitpath(__FILE__);$l18n_file = File::Spec->catfile($dir, $l18n_file) if $dir;die "localisation file $l18n_file is missing!" unless -e $l18n_file;my %l18n = %{YAML::Tiny->read( $l18n_file )->[0]{$language}};$app->{'l18n'} = \%l18n;

# loading the numbers of the remembered favorites$app->{'favorites'} = -e $fav_file ? YAML::Tiny->read( $fav_file ) : YAML::Tiny->new;my @remembered_pic_names = ref $app->{'favorites'}->[0] eq 'HASH' ? keys $app->{'favorites'}->[0] : ();

# making UImy $frame = $app->{'frame'} = Wx::Perl::Smart::Frame->new(__PACKAGE__." $VERSION", 'fixed_size');$frame->SubscribeStrings( $app->{'l18n'} );my $remember= sub { $frame->SetValues( $app->{'favorites'}[0]{ $_[0]->GetValue() } ); $app->Repaint()};my $repaint = sub { $app->Repaint() };my $boardsize = Wx::GetDisplaySize()->GetHeight() - 250;my $origin_offset = $app->{'origin_offset'} = $boardsize / 2;my $max_amp = $app->{'max_amp'} = $origin_offset - 10; # max amplitudemy %range_defaults = (# label, min, max, init

frequency_x => ['X', 1, 1, 30], frequency_y => ['Y', 1, 1, 30],amplitude_x => ['X', 0, 0, 360], amplitude_y => ['Y', 0, 0, 360],rotation => [$l18n{'amount'}, 1, 0, 30], friction => [$l18n{'friction'}, 0, 0, 200],length => [$l18n{'length'}, 12, 1, 100], density => [$l18n{'density'},100, 1, 100],thickness => [$l18n{'thickness'},1, 1, 12], zoom => [$l18n{'zoom'}, 0,-10, 10], start_colour=> [$l18n{'start'}, 0, 0,1500], flow_colour => [$l18n{'flow'}, 0, 0, 60],scale_colour=> [$l18n{'scale'}, 1, 1, 4],

);$frame->SubscribeWidgets

({$_ => Wx::Perl::DisplaySlider->new($frame, @{$range_defaults{$_}}, $repaint)}) for keys %range_defaults;$frame->SubscribeWidgets({

drawboard => Wx::Perl::DrawMap->new($frame, $boardsize),fav_select => [-ComboBox => \@remembered_pic_names, 0, -1, $remember],format_select=> [-ComboBox => [qw(PNG JPG TIFF BMP XPM)], 0, 70 ],save => [-Button => '~save', sub {$app->Save() }],save_all => [-Button => '~all', sub {$app->SaveAll() }],remember => [-Button => '~remember', sub {$app->Remember()}],forget => [-Button => '~forget', sub {$app->Forget() }],no_phase => [-Button => '~no', sub {$frame->SetValues(amplitude_x => 0, amplitude_y => 0);$app->Repaint()}],closed_phase => [-Button => '~closed', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 90);$app->Repaint()}],open_phase => [-Button => '~open', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 180);$app->Repaint()}],y_invers => [-CheckBox => '~y_inverse', 0, $repaint],rotation_dir => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(no left right)}], 0, &Wx::wxHORIZONTAL, $repaint),app_mode => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(lateral rotary free)}], 0, &Wx::wxHORIZONTAL, sub{}),

});

$frame->SetSmartLayout({flags => &Wx::wxGROW|&Wx::wxALL},[ # left part

'<drawboard>',10,{border => 10, flags => &Wx::wxALL|&Wx::wxGROW},'<fav_select>',['<format_select>', 10,'<save>', 10, '<save_all>', \1, '<forget>', 10, '<remember>'],

],[ # right half-TabbedBox => [

'~oscillators' =>[{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},['~mode :', '<app_mode>'],-LabeledBox =>['~frequency' =>[qw( <frequency_x> <frequency_y>)]], #<y_invers>-LabeledBox =>['~start_amp' =>[qw( <amplitude_x> <amplitude_y>),

{border => 5, flags => &Wx::wxALL|&Wx::wxGROW},['~phase :', \1, '<no_phase>', \1,'<closed_phase>', \1, '<open_phase>'],

]],-LabeledBox =>[ '~rotation ' =>[qw( <rotation_dir> <rotation> )]],{border => 10}, '<friction>',

],'~visuals' => [

{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},-LabeledBox =>['~line' =>[qw( <length> <density> )]], #<thickness>-LabeledBox =>['~color' =>[qw( <start_colour> <flow_colour> <scale_colour>)]],{border => 10},'<zoom>',

],],

]);$frame->ResetValues();$app->Repaint();$app->SetTopWindow($frame);1;

}

Page 11: Wx::Perl::Smart

Wx::Perl::Smartsub OnInit {

my $app = shift;

# load localisation texts in chosen languagemy ($v, $dir, $f) = File::Spec->splitpath(__FILE__);$l18n_file = File::Spec->catfile($dir, $l18n_file) if $dir;die "localisation file $l18n_file is missing!" unless -e $l18n_file;my %l18n = %{YAML::Tiny->read( $l18n_file )->[0]{$language}};$app->{'l18n'} = \%l18n;

# loading the numbers of the remembered favorites$app->{'favorites'} = -e $fav_file ? YAML::Tiny->read( $fav_file ) : YAML::Tiny->new;my @remembered_pic_names = ref $app->{'favorites'}->[0] eq 'HASH' ? keys $app->{'favorites'}->[0] : ();

# making UImy $frame = $app->{'frame'} = Wx::Perl::Smart::Frame->new(__PACKAGE__." $VERSION", 'fixed_size');$frame->SubscribeStrings( $app->{'l18n'} );my $remember= sub { $frame->SetValues( $app->{'favorites'}[0]{ $_[0]->GetValue() } ); $app->Repaint()};my $repaint = sub { $app->Repaint() };my $boardsize = Wx::GetDisplaySize()->GetHeight() - 250;my $origin_offset = $app->{'origin_offset'} = $boardsize / 2;my $max_amp = $app->{'max_amp'} = $origin_offset - 10; # max amplitudemy %range_defaults = (# label, min, max, init

frequency_x => ['X', 1, 1, 30], frequency_y => ['Y', 1, 1, 30],amplitude_x => ['X', 0, 0, 360], amplitude_y => ['Y', 0, 0, 360],rotation => [$l18n{'amount'}, 1, 0, 30], friction => [$l18n{'friction'}, 0, 0, 200],length => [$l18n{'length'}, 12, 1, 100], density => [$l18n{'density'},100, 1, 100],thickness => [$l18n{'thickness'},1, 1, 12], zoom => [$l18n{'zoom'}, 0,-10, 10], start_colour=> [$l18n{'start'}, 0, 0,1500], flow_colour => [$l18n{'flow'}, 0, 0, 60],scale_colour=> [$l18n{'scale'}, 1, 1, 4],

);$frame->SubscribeWidgets

({$_ => Wx::Perl::DisplaySlider->new($frame, @{$range_defaults{$_}}, $repaint)}) for keys %range_defaults;$frame->SubscribeWidgets({

drawboard => Wx::Perl::DrawMap->new($frame, $boardsize),fav_select => [-ComboBox => \@remembered_pic_names, 0, -1, $remember],format_select=> [-ComboBox => [qw(PNG JPG TIFF BMP XPM)], 0, 70 ],save => [-Button => '~save', sub {$app->Save() }],save_all => [-Button => '~all', sub {$app->SaveAll() }],remember => [-Button => '~remember', sub {$app->Remember()}],forget => [-Button => '~forget', sub {$app->Forget() }],no_phase => [-Button => '~no', sub {$frame->SetValues(amplitude_x => 0, amplitude_y => 0);$app->Repaint()}],closed_phase => [-Button => '~closed', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 90);$app->Repaint()}],open_phase => [-Button => '~open', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 180);$app->Repaint()}],y_invers => [-CheckBox => '~y_inverse', 0, $repaint],rotation_dir => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(no left right)}], 0, &Wx::wxHORIZONTAL, $repaint),app_mode => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(lateral rotary free)}], 0, &Wx::wxHORIZONTAL, sub{}),

});

$frame->SetSmartLayout({flags => &Wx::wxGROW|&Wx::wxALL},[ # left part

'<drawboard>',10,{border => 10, flags => &Wx::wxALL|&Wx::wxGROW},'<fav_select>',['<format_select>', 10,'<save>', 10, '<save_all>', \1, '<forget>', 10, '<remember>'],

],[ # right half-TabbedBox => [

'~oscillators' =>[{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},['~mode :', '<app_mode>'],-LabeledBox =>['~frequency' =>[qw( <frequency_x> <frequency_y>)]], #<y_invers>-LabeledBox =>['~start_amp' =>[qw( <amplitude_x> <amplitude_y>),

{border => 5, flags => &Wx::wxALL|&Wx::wxGROW},['~phase :', \1, '<no_phase>', \1,'<closed_phase>', \1, '<open_phase>'],

]],-LabeledBox =>[ '~rotation ' =>[qw( <rotation_dir> <rotation> )]],{border => 10}, '<friction>',

],'~visuals' => [

{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},-LabeledBox =>['~line' =>[qw( <length> <density> )]], #<thickness>-LabeledBox =>['~color' =>[qw( <start_colour> <flow_colour> <scale_colour>)]],{border => 10},'<zoom>',

],],

]);$frame->ResetValues();$app->Repaint();$app->SetTopWindow($frame);1;

}

Page 12: Wx::Perl::Smart

Wx::Perl::Smartsub OnInit {

my $app = shift;

# load localisation texts in chosen languagemy ($v, $dir, $f) = File::Spec->splitpath(__FILE__);$l18n_file = File::Spec->catfile($dir, $l18n_file) if $dir;die "localisation file $l18n_file is missing!" unless -e $l18n_file;my %l18n = %{YAML::Tiny->read( $l18n_file )->[0]{$language}};$app->{'l18n'} = \%l18n;

# loading the numbers of the remembered favorites$app->{'favorites'} = -e $fav_file ? YAML::Tiny->read( $fav_file ) : YAML::Tiny->new;my @remembered_pic_names = ref $app->{'favorites'}->[0] eq 'HASH' ? keys $app->{'favorites'}->[0] : ();

# making UImy $frame = $app->{'frame'} = Wx::Perl::Smart::Frame->new(__PACKAGE__." $VERSION", 'fixed_size');$frame->SubscribeStrings( $app->{'l18n'} );my $remember= sub { $frame->SetValues( $app->{'favorites'}[0]{ $_[0]->GetValue() } ); $app->Repaint()};my $repaint = sub { $app->Repaint() };my $boardsize = Wx::GetDisplaySize()->GetHeight() - 250;my $origin_offset = $app->{'origin_offset'} = $boardsize / 2;my $max_amp = $app->{'max_amp'} = $origin_offset - 10; # max amplitudemy %range_defaults = (# label, min, max, init

frequency_x => ['X', 1, 1, 30], frequency_y => ['Y', 1, 1, 30],amplitude_x => ['X', 0, 0, 360], amplitude_y => ['Y', 0, 0, 360],rotation => [$l18n{'amount'}, 1, 0, 30], friction => [$l18n{'friction'}, 0, 0, 200],length => [$l18n{'length'}, 12, 1, 100], density => [$l18n{'density'},100, 1, 100],thickness => [$l18n{'thickness'},1, 1, 12], zoom => [$l18n{'zoom'}, 0,-10, 10], start_colour=> [$l18n{'start'}, 0, 0,1500], flow_colour => [$l18n{'flow'}, 0, 0, 60],scale_colour=> [$l18n{'scale'}, 1, 1, 4],

);$frame->SubscribeWidgets

({$_ => Wx::Perl::DisplaySlider->new($frame, @{$range_defaults{$_}}, $repaint)}) for keys %range_defaults;$frame->SubscribeWidgets({

drawboard => Wx::Perl::DrawMap->new($frame, $boardsize),fav_select => [-ComboBox => \@remembered_pic_names, 0, -1, $remember],format_select=> [-ComboBox => [qw(PNG JPG TIFF BMP XPM)], 0, 70 ],save => [-Button => '~save', sub {$app->Save() }],save_all => [-Button => '~all', sub {$app->SaveAll() }],remember => [-Button => '~remember', sub {$app->Remember()}],forget => [-Button => '~forget', sub {$app->Forget() }],no_phase => [-Button => '~no', sub {$frame->SetValues(amplitude_x => 0, amplitude_y => 0);$app->Repaint()}],closed_phase => [-Button => '~closed', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 90);$app->Repaint()}],open_phase => [-Button => '~open', sub {$frame->SetValues(amplitude_x => 90, amplitude_y => 180);$app->Repaint()}],y_invers => [-CheckBox => '~y_inverse', 0, $repaint],rotation_dir => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(no left right)}], 0, &Wx::wxHORIZONTAL, $repaint),app_mode => Wx::Perl::RadioGroup->new($frame, [@l18n{qw(lateral rotary free)}], 0, &Wx::wxHORIZONTAL, sub{}),

});

$frame->SetSmartLayout({flags => &Wx::wxGROW|&Wx::wxALL},[ # left part

'<drawboard>',10,{border => 10, flags => &Wx::wxALL|&Wx::wxGROW},'<fav_select>',['<format_select>', 10,'<save>', 10, '<save_all>', \1, '<forget>', 10, '<remember>'],

],[ # right half-TabbedBox => [

'~oscillators' =>[{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},['~mode :', '<app_mode>'],-LabeledBox =>['~frequency' =>[qw( <frequency_x> <frequency_y>)]], #<y_invers>-LabeledBox =>['~start_amp' =>[qw( <amplitude_x> <amplitude_y>),

{border => 5, flags => &Wx::wxALL|&Wx::wxGROW},['~phase :', \1, '<no_phase>', \1,'<closed_phase>', \1, '<open_phase>'],

]],-LabeledBox =>[ '~rotation ' =>[qw( <rotation_dir> <rotation> )]],{border => 10}, '<friction>',

],'~visuals' => [

{border => 5, flags => &Wx::wxGROW|&Wx::wxALL},-LabeledBox =>['~line' =>[qw( <length> <density> )]], #<thickness>-LabeledBox =>['~color' =>[qw( <start_colour> <flow_colour> <scale_colour>)]],{border => 10},'<zoom>',

],],

]);$frame->ResetValues();$app->Repaint();$app->SetTopWindow($frame);1;

}

Page 13: Wx::Perl::Smart

Wx::Perl::Smart

Wx::Perl::Smart::FrameWx::Perl::Smart::DialogWx::Perl::Smart::PanelWx::Perl::Smart::SizerWx::Perl::Smart::WidgetFactory

Page 14: Wx::Perl::Smart

Nucleus

Wx::Perl::Smart::PanelWx::Perl::Smart::Sizer

Page 15: Wx::Perl::Smart

aus Kephra

Kephra::App::PanelKephra::App::Sizer

Page 16: Wx::Perl::Smart

KephraXP

Page 17: Wx::Perl::Smart

K. GUI LibsKephra::App::EditorKephra::App::DialogKephra::App::DocBarKephra::App::FocusKephra::App::PanelKephra::App::SizerKephra::App::SplitterKephra::App::WindowKephra::App::Util

Page 18: Wx::Perl::Smart

'kleine Projekte'App::Harmonograph

App::Spirograph

Trigon

Fraktalzeichner

Games:Sudoku::Algosolver

Page 19: Wx::Perl::Smart

Wx::Perl::Smart

In 5 Schrittenzur Intelligenz

Page 20: Wx::Perl::Smart

Wx::Perl::Smart

WidgetsKompositionAbstraktion

Page 21: Wx::Perl::Smart

Das sind nur 3

WidgetsKompositionAbstraktion

Page 22: Wx::Perl::Smart

Jetzt sind es 5

Wid getsKompositionAbstr aktion

Page 23: Wx::Perl::Smart

Wx::Perl::Smart

Wid getsKompositionAbstr aktion

Page 24: Wx::Perl::Smart

Nummer 1

einfach & sichereWidgeterzeugung

Page 25: Wx::Perl::Smart

Nummer 2

mächtige Widgets

Page 26: Wx::Perl::Smart

Wx::Perl::*

mächtige Widgets

Page 27: Wx::Perl::Smart

Nummer 3

leicht änderbar,kompakte

Komposition

Page 28: Wx::Perl::Smart

Nummer 4

Trennung vonDaten & Layout

Page 29: Wx::Perl::Smart

Nummer 5

MVC – GUI Layer

Page 30: Wx::Perl::Smart

GUI Comp. Lang.

MVC – GUI Layer

Page 31: Wx::Perl::Smart

Wx::Perl::Smart

Wid getsKompositionAbstr aktion

Page 32: Wx::Perl::Smart

Schritt 1

EinzelneWidgets

Page 33: Wx::Perl::Smart

Einzelne Widgets

Wx::Button

Page 34: Wx::Perl::Smart

Wx::Button->new(..., ..., ...)

Erzeugen

Page 35: Wx::Perl::Smart

$parent $frame ID -1 $label wxEmptyString, wxPoint wxDefaultPosition, [-1,-1] wxSize& size = wxDefaultSize, [-1,-1] style 0, wxValidator, wxString $name

New Parameter

Page 36: Wx::Perl::Smart

$button = Wx::Button->new( $parent, -1, 'label', [-1,-1], [30,-1]);

Wx::Event::EVT_BUTTON ($frame, $button, \&callback);

Button Erzeugen

Page 37: Wx::Perl::Smart

Wx::Perl::Button ($parent, 'label', \&callback, 30);

Smart Button

Page 38: Wx::Perl::Smart

Wx::Perl::Button ($parent, 'label', \&callback, 30);# required , opt

Smart Button

Page 39: Wx::Perl::Smart

wxWindow* parent,wxWindowID id, wxString& value,wxPoint& pos,wxSize& size,long style,wxValidator& (validator),wxString& name,

Textc. Parameter

Page 40: Wx::Perl::Smart

$txt = Wx::TextCtrl->new( $parent, -1, 'content', [-1,-1], [30,-1], &Wx::wxTE_MULTILINE Wx::Perl::TextValidator->new (qr//));

Wx::Event::EVT_KEY_DOWN ($txt, -1, \&callback);Wx::Event::EVT_TEXT ($frame, $txt, \&callback);

TextCtrl Erzeugen

Page 41: Wx::Perl::Smart

$txt = Wx::Perl::TextEdit->new( $pa,'content',\&callback,qr/.../,[30,-1]);

Smart TextEdit

Page 42: Wx::Perl::Smart

$txt = Wx::Perl::TextEdit->new( $pa,'content',\&callback,qr/.../,[30,-1]);# required ,opt

Smart TextEdit

Page 43: Wx::Perl::Smart

weglassen was nicht wichtig istnimmt hinzu was wichtig wäreoptional auch mit benannten Param.Def als Code oder String (compilien) alles normalen Widgets (Moose)Wx::Perl::Button ... kommt vielleicht

Einzelne Widgets

Page 44: Wx::Perl::Smart

weglassen was nicht wichtig ist

Einzelne Widgets

Page 45: Wx::Perl::Smart

weglassen was nicht wichtig ist

Perl hat besseres

ObjRef statt WxID | WidgetName

Einzelne Widgets

Page 46: Wx::Perl::Smart

weglassen was nicht wichtig ist

Weil du es nicht kontrollieren willst

Position und Größe regeln Sizer

Einzelne Widgets

Page 47: Wx::Perl::Smart

weglassen was nicht wichtig ist

Weil es Probleme macht

auf undef gesetzte parents

Einzelne Widgets

Page 48: Wx::Perl::Smart

weglassen was nicht wichtig istnimmt hinzu was wichtig wäre

callbacks (coderef)

Einzelne Widgets

Page 49: Wx::Perl::Smart

weglassen was nicht wichtig istnimmt hinzu was wichtig wäre

callbacks (coderef) & zus. styles

Einzelne Widgets

Page 50: Wx::Perl::Smart

weglassen was nicht wichtig istnimmt hinzu was wichtig wäreoptional auch mit benannten Param.Def als Code oder String (compilien) alles normalen Widgets (Moose)Wx::Perl::Button ... kommt vielleicht

Einzelne Widgets

Page 51: Wx::Perl::Smart

weglassen was nicht wichtig istnimmt hinzu was wichtig wäreoptional auch mit benannten Param.Def als Code oder String (compilien) alles normalen Widgets (Moose)Wx::Perl::Button ... kommt vielleicht

Einzelne Widgets

Page 52: Wx::Perl::Smart

weglassen was nicht wichtig istnimmt hinzu was wichtig wäreoptional auch mit benannten Param.Def als code oder String (compilien) alles normalen Widgets (Moose)Wx::Perl::Button ... kommt vielleicht

Einzelne Widgets

Page 53: Wx::Perl::Smart

weglassen was nicht wichtig istnimmt hinzu was wichtig wäreoptional auch mit benannten Param.Def als code oder String (compilien) alles normalen Widgets (Moose)Wx::Perl::Button ... kommt vielleicht

Einzelne Widgets

Page 54: Wx::Perl::Smart

weglassen was nicht wichtig istnimmt hinzu was wichtig wäreoptional auch mit benannten Param.Def als code oder String (compilien) alles normalen Widgets (Moose)Wx::Perl::Button ... kommt vielleicht

Einzelne Widgets

Page 55: Wx::Perl::Smart

Wx::Perl::Button ($parent, 'label', \&callback, 30);

neues Modul für den einen AufrufSoftwarearchitektur: factory method

Smart Button ?

Page 56: Wx::Perl::Smart

Wx::Perl::Button ($parent, 'label', \&callback, 30);

neues Modul für den einen AufrufSoftwarearchitektur: factory method

Smart Button ?

Page 57: Wx::Perl::Smart

@widgets = factory method([ [-Button => 'label', \&callback, 30], …]);

Smart Factory

Page 58: Wx::Perl::Smart

@widgets = $factory->MakeWidget([ [-Button => 'label', \&callback, 30], {widget => 'Button', label =>'...', },]);

Benannte Param.

Page 59: Wx::Perl::Smart

$factory = Wx::Perl::Smart:: WidgetFactory->new($parent);

Kürzt Aufruf

Page 60: Wx::Perl::Smart

$factory = Wx::Perl::Smart:: WidgetFactory->new($parent);

Wx::Perl::Smart::WidgetFactory-> MakeWidget([ ….

Und vermeidet

Page 61: Wx::Perl::Smart

im Sinne einer Factory Methoderzeugt normale Widgets & weitere

Smart Factory

Page 62: Wx::Perl::Smart

Schritt 2

Zusammen-gesetzteWidgets

Page 63: Wx::Perl::Smart

Zusam. Widgets

RadioButtonsTextSliders

Page 64: Wx::Perl::Smart

Zusam. Widgets

sammle mehrere Einzelwidgets und deren Daten & Event-handling in ein Widgeteinfacherer Umgang,Layout wird übersichtlicher

Page 65: Wx::Perl::Smart

Schritt 3

Komposition

Page 66: Wx::Perl::Smart

Komposition

Wx::Perl::Smart::UtilWx::Perl::Smart::WidgetFactoryWx::Perl::Smart::SizerWx::Perl::Smart::PanelWx::Perl::Smart::FrameWx::Perl::Smart::Dialog

Page 67: Wx::Perl::Smart

Komposition

Wx::Perl::Smart::WidgetFactoryWx::Perl::Smart::SizerWx::Perl::Smart::PanelWx::Perl::Smart::Frame

Page 68: Wx::Perl::Smart

:WidgetFactory

einfache, robuste Erzeugungin TabellenanordnungTrennung vom GUI-Layoutkeine Daten ins Layoutstrukturierte Programme

Page 69: Wx::Perl::Smart

:WidgetFactory

einfache, robuste Erzeugungin TabellenanordnungTrennung vom GUI-Layoutkeine Daten ins Layoutstrukturierte Programme

Page 70: Wx::Perl::Smart

Komposition

Wx::Perl::Smart::WidgetFactoryWx::Perl::Smart::SizerWx::Perl::Smart::PanelWx::Perl::Smart::Frame

Page 71: Wx::Perl::Smart

::Smart::Sizer

einfache und robuste Erzeugung Erzeugung von Deko-Widgets Kommentaremehr Abstraktion (tabs = Sizer)einfache und effektive Benutzung

Page 72: Wx::Perl::Smart

::Smart::Sizer

einfache und robuste Erzeugung Erzeugung von Deko-Widgets Kommentaremehr Abstraktion (tabs = Sizer)einfache und effektive Benutzung

Page 73: Wx::Perl::Smart

::Smart::Sizer

einfache und robuste Erzeugung

$sizer = Wx::Perl::Smart::Sizer->new([$widget, $widget, ...]);

Page 74: Wx::Perl::Smart

::Smart::Sizer

einfache und robuste Erzeugung Erzeugung von Deko-Widgets Kommentaremehr Abstraktion (tabs = Sizer)einfache und effektive Benutzung

Page 75: Wx::Perl::Smart

::Smart::Sizer

Erzeugung von Deko-Widgets

$sizer = Wx::Perl::Smart::Sizer->new([$widget, '---', $widget, ...]);

Page 76: Wx::Perl::Smart

::Smart::Sizer

einfache und robuste Erzeugung Erzeugung von Deko-Widgets Kommentaremehr Abstraktion (tabs = Sizer)einfache und effektive Benutzung

Page 77: Wx::Perl::Smart

::Smart::Sizer

einfache und robuste Erzeugung Erzeugung von Deko-Widgets Kommentaremehr Abstraktion (tabs = Sizer)einfache und effektive Benutzung

Page 78: Wx::Perl::Smart

::Smart::Sizer$sizer = Wx::Perl::Smart::Sizer->new(-TabbedBox => [ [$widget, ...], [...]]);

mehr Abstraktion (tabs = Sizer)

Page 79: Wx::Perl::Smart

::Smart::Sizer

einfache und robuste Erzeugung Erzeugung von Deko-Widgets Kommentaremehr Abstraktion (tabs = Sizer)einfache und effektive Benutzung

Page 80: Wx::Perl::Smart

::Smart::Sizer

einfache und robuste Erzeugung Erzeugung von Deko-Widgets Kommentaremehr Abstraktion (tabs = Sizer)einfache und effektive Benutzung

Page 81: Wx::Perl::Smart

Komposition

Wx::Perl::Smart::WidgetFactoryWx::Perl::Smart::SizerWx::Perl::Smart::PanelWx::Perl::Smart::Frame

Page 82: Wx::Perl::Smart

::Smart::Panel

Panel mit Smart::Sizer

Page 83: Wx::Perl::Smart

::Smart::Panel

Panel mit Smart::Sizer

$panel = Wx::Perl::Smart::Panel->new([$widget, $widget, ...]);

Page 84: Wx::Perl::Smart

::Smart::Panel

Panel mit Smart::Sizer

Sichbarkeit und Verwandschaft wird automatisch geregelt

Page 85: Wx::Perl::Smart

Komposition

Wx::Perl::Smart::WidgetFactoryWx::Perl::Smart::SizerWx::Perl::Smart::PanelWx::Perl::Smart::Frame

Page 86: Wx::Perl::Smart

::Smart::Frame

Hauptenster einer Appnoch eine Abstraktionvereinfachter Zugriff auf Panel, Sizer und WidgetFactoryverwaltet auch Widgets und Localisationstrings

Page 87: Wx::Perl::Smart

Widgets mit ID

$frame->MakeWidgets({ drawboard => Wx::Perl::Draw... fav_select => [-ComboBox => ..]

Page 88: Wx::Perl::Smart

def Layout$frame->EvalSmartLayout ( \{flags => &Wx::wxGROW|&Wx::wxALL},

[ '<drawboard>',10,'<fav_select>',

['<format_select>', 10,'<save>', 10, '<save_all>', \1, '<forget>', 10,...],

Page 89: Wx::Perl::Smart

ohne Ränder

$frame->EvalSmartLayout ([ '<drawboard>',

'<fav_select>', ['<format_select>', '<save>', '<save_all>', \1, '<forget>', ...],

Page 90: Wx::Perl::Smart

Panel mit ID

$frame->EvalSmartPanel ( 'my_panel' => [ '<drawboard>',

10,'<fav_select>',

['<format_select>', 10,'<save>', 10, '<save_all>', \1, '<forget>', 10,...],

Page 91: Wx::Perl::Smart

Nutze wie Widget

$frame->EvalSmartLayout (

[ '<my_panel>','<fav_select>',

['<format_select>', '<save>', '<save_all>', \1, '<forget>', ...],

Page 92: Wx::Perl::Smart

Smart > GUI Designer

Page 93: Wx::Perl::Smart

''can't touch this'

Page 94: Wx::Perl::Smart

Smart > GUI Designer

Designercode darf nicht berührt werden

Page 95: Wx::Perl::Smart

Smart > GUI Designer

Brauch mehrere Programme / Formate

Page 96: Wx::Perl::Smart

Smart > GUI Designer

Smart ist schneller effektiver als GUI

Page 97: Wx::Perl::Smart

Smart > GUI Designer

Smart ist schneller effektiver als GUI

änder Abstandsklassen

Page 98: Wx::Perl::Smart

Smart > GUI Designer

Smart ist schneller effektiver als GUI

denk in Proportionen

Page 99: Wx::Perl::Smart

Komponenten

Wx::Perl::Smart::UtilWx::Perl::Smart::WidgetFactoryWx::Perl::Smart::SizerWx::Perl::Smart::PanelWx::Perl::Smart::FrameWx::Perl::Smart::Dialog

Page 100: Wx::Perl::Smart

Gen Comp AbstrWx::Perl::Smart::UtilWx::Perl::*Wx::Perl::Smart::WidgetFactoryWx::Perl::Smart::SizerWx::Perl::Smart::PanelWx::Perl::Smart::FrameWx::Perl::Smart::Dialog

Page 101: Wx::Perl::Smart

Zukunft

TemplatesSchablonen

WerteEvents

Page 102: Wx::Perl::Smart

Schritt 5

Abstraktion

Page 103: Wx::Perl::Smart

GCL

GUIComposition

Lang

Page 104: Wx::Perl::Smart

AbstraktionWikiformat für's layout

(oft besser als GUI designer)kompiliert zu Datenstruktur(jedes Format funktioniert)

kompiliert zu GUIandere Backends denkbar(GCL::Prima, GCL::GTK)

Page 105: Wx::Perl::Smart

AbstraktionWikiformat für's layout

(oft besser als GUI designer)kompiliert zu Datenstruktur(jedes Format funktioniert)

kompiliert zu GUIandere Backends denkbar(GCL::Prima, GCL::GTK)

Page 106: Wx::Perl::Smart

AbstraktionWikiformat für's layout

(oft besser als GUI designer)kompiliert zu Datenstruktur(jedes Format funktioniert)

kompiliert zu GUIandere Backends denkbar(GCL::Prima, GCL::GTK)

Page 107: Wx::Perl::Smart

AbstraktionWikiformat für's layout

(oft besser als GUI designer)kompiliert zu Datenstruktur(jedes Format funktioniert)

kompiliert zu GUIandere Backends denkbar(GCL::Prima, GCL::GTK)

Page 108: Wx::Perl::Smart

Danke