App-GUI-Juliagraph
view release on metacpan or search on metacpan
lib/App/GUI/Juliagraph/Frame.pm view on Meta::CPAN
$self->SetSize($size);
$self->SetMinSize($size);
$self->SetMaxSize($size);
$self->update_recent_settings_menu();
# $self->init();
$self->sketch();
$self;
}
sub update_recent_settings_menu {
my ($self) = @_;
my $recent = $self->{'config'}->get_value('last_settings');
return unless ref $recent eq 'ARRAY';
my $set_menu_ID = 11300;
$self->{'setting_menu'}->Destroy( $set_menu_ID );
my $Recent_ID = $set_menu_ID + 1;
$self->{'recent_menu'} = Wx::Menu->new();
for (@$recent){
my $path = $_;
$self->{'recent_menu'}->Append($Recent_ID, $path);
lib/App/GUI/Juliagraph/Frame/Panel/ColorPicker.pm view on Meta::CPAN
}
sub current_color_name { $_[0]->{'color_names'}->[ $_[0]->{'color_index'} ] }
sub get_current_color {
my ( $self ) = @_;
my $color = $self->{'colors'}->{ $self->current_color_name };
{red=> $color->[0], green=> $color->[1], blue=> $color->[2] };
}
sub update_select {
my ( $self ) = @_;
$self->{'color_names'} = [ sort keys %{$self->{'colors'}} ];
$self->{'select'}->Clear ();
$self->{'select'}->Append( $_) for @{$self->{'color_names'}};
$self->update_display();
}
sub update_display {
my ( $self ) = @_;
$self->{'color_index'} = $#{$self->{'color_names'}} if $self->{'color_index'} < 0;
$self->{'color_index'} = 0 if $self->{'color_index'} > $#{$self->{'color_names'}};
$self->{'select'}->SetSelection( $self->{'color_index'} );
$self->{'display'}->set_color( $self->get_current_color );
}
sub get_config { $_[0]->{'colors'} }
1;
lib/App/GUI/Juliagraph/Frame/Panel/ColorSetPicker.pm view on Meta::CPAN
$self->SetSizer($sizer);
$self->update_display;
$self;
}
sub current_set_name { $_[0]->{'set_names'}->[ $_[0]->{'set_index'} ] }
sub get_current_color_set { @{$_[0]->{'set_content'}} }
sub update_select {
my ( $self ) = @_;
$self->{'set_names'} = [ sort keys %{$self->{'sets'}} ];
$self->{'select'}->Clear ();
$self->{'select'}->Append( $_) for @{$self->{'set_names'}};
$self->update_display();
}
sub update_display {
my ($self) = @_;
$self->{'set_index'} = $#{$self->{'set_names'}} if $self->{'set_index'} < 0;
$self->{'set_index'} = 0 if $self->{'set_index'} > $#{$self->{'set_names'}};
$self->{'select'}->SetSelection( $self->{'set_index'} );
my $set_name = $self->{'set_names'}[ $self->{'set_index'} ];
my $set_length = @{ $self->{'sets'}{$set_name} };
$self->{'set_content'} = [ map { color( $self->{'sets'}{$set_name}[ $_ ] ) } 0 .. $set_length - 1 ];
$self->{'set_content'}[$_] = color( $default_color ) for $set_length .. $self->{'max_display_count'}-1;
$self->{'display'}[$_]->set_color( $self->{'set_content'}[ $_ ]->rgb_hash ) for 0 .. $self->{'max_display_count'}-1;
}
lib/App/GUI/Juliagraph/Frame/Tab/Color.pm view on Meta::CPAN
$self->{'used_colors'} = [@colors];
$self->{'used_colors'}[$_] = color( $default_color_def ) for @colors .. $self->{'color_count'}-1;
$self->{'color_display'}[$_]->set_color( $self->{'used_colors'}[$_]->values(as => 'hash') ) for 0 .. $self->{'color_count'}-1;
$self->set_current_color_nr;
$self->{'call_back'}->( 'color' ); # update whole app
}
sub get_all_colors { @{$_[0]->{'used_colors'}} }
sub get_active_colors { @{$_[0]->{'used_colors'}}[ 0 .. $_[0]->{'active_color_count'} - 1] }
sub update_config {
my ($self) = @_;
$self->{'config'}->set_value('color', $self->{'picker'}->get_config);
$self->{'config'}->set_value('color_set', $self->{'setpicker'}->get_config);
}
1;
lib/App/GUI/Juliagraph/Frame/Tab/Constraints.pm view on Meta::CPAN
} else {
my $new_x = ($delta_x_percent / 2 / $zoom ) + $cx;
my $new_y = -($delta_y_percent / 2 / $zoom ) + $cy;
$self->{'center_x'}->SetValue( $new_x );
$self->{'center_y'}->SetValue( $new_y );
}
$self->RestoreCallBack;
$self->RunCallBack;
}
sub update_iter_count {
my ( $self ) = @_;
$self->{'tab'}{'mapping'}{'scale_max'}->SetValue( int $self->{'stop_nr'}->GetValue**2 ) if ref $self->{'tab'}{'mapping'};
}
sub zoom_size { 0.1 / ($_[0]->{'zoom'}->GetValue ** 2) }
sub connect_polynome_tab {
my ($self, $ref) = @_;
return unless ref $ref eq 'App::GUI::Juliagraph::Frame::Tab::Polynomial';
$self->{'tab'}{'polynome'} = $ref;
lib/App/GUI/Juliagraph/Frame/Tab/Mapping.pm view on Meta::CPAN
$self->{ $_ }->Enable( $on ) for qw/background_color begin_color end_color lbl_begin lbl_end lbl_backg/;
}
sub enable_subgradient {
my ( $self, $on ) = @_;
$on //= $self->{'use_subgradient'}->GetValue;
$self->{'use_subgradient'}->SetValue($on) unless int($on) == int $self->{'use_subgradient'}->GetValue;
$self->{$_}->Enable( $on ) for qw/subgradient_steps subgradient_dynamic subgradient_space subgradient_distro
lbl_sub_dyn lbl_sub_space lbl_sub_distro subgradient_size/;
}
sub update_max_color {
my ( $self ) = @_;
my $begin_color = substr $self->{'begin_color'}->GetStringSelection, 6;
my $end_color = substr $self->{'end_color'}->GetStringSelection, 6;
my $max_color = $begin_color > $end_color ? $begin_color : $end_color;
$self->{'tab'}{'color'}->set_active_color_count( $max_color ) if ref $self->{'tab'}{'color'};
}
sub connect_color_tab {
my ($self, $ref) = @_;
return unless ref $ref eq 'App::GUI::Juliagraph::Frame::Tab::Color';
( run in 1.418 second using v1.01-cache-2.11-cpan-95122f20152 )