App-GUI-Harmonograph

 view release on metacpan or  search on metacpan

lib/App/GUI/Harmonograph/Frame.pm  view on Meta::CPAN

    $self->SetSize($size);
    $self->SetMinSize($size);
    $self->SetMaxSize($size);

    $self->update_recent_settings_menu();
    $self->{'btn'}{'draw'}->SetFocus;
    $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 (reverse @$recent){
        my $path = $_;
        $self->{'recent_menu'}->Append($Recent_ID, $path);

lib/App/GUI/Harmonograph/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/Harmonograph/Frame/Panel/Pendulum.pm  view on Meta::CPAN

    $self->{ 'offset'}->SetValue( int( $settings->{'offset'} * 400 ), 'passive');
    $self->{ 'radius' }->SetValue( $settings->{'radius'} * 100, 'passive' );
    $self->{ 'radius_damp' }->SetValue( $settings->{'radius_damp'}, 'passive' );
    $self->{ 'radius_damp_acc' }->SetValue( $settings->{'radius_damp_acc'}, 'passive');
    $self->{ 'radius_damp_type'}->SetValue(  $settings->{ 'radius_damp_type'} // '-' );
    $self->{ 'radius_damp_acc_type'}->SetValue(  $settings->{ 'radius_damp_acc_type'} // '+' );
    $self->update_enable;
    1;
}

sub update_enable {
    my ($self) = @_;
    my $val = $self->{ 'on' }->IsChecked;
    $self->{$_}->Enable( $val ) for qw/
        freq_dez freq_factor invert_freq invert_dir neg_freq half_off quarter_off offset
        frequency freq_damp freq_damp_acc freq_damp_type freq_damp_acc_type
        radius radius_factor neg_radius reset_radius
        radius_damp radius_damp_acc radius_damp_type radius_damp_acc_type/;
}

1;

lib/App/GUI/Harmonograph/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/Harmonograph/Frame/Tab/Visual.pm  view on Meta::CPAN

    my ( $self ) = @_;
    my $settings = { map { $_ => $self->{'widget'}{$_}->GetValue } @state_widgets};
    $settings->{'duration'} = ($self->{'widget'}{ 'duration_min' }->GetValue * 60)
                             + $self->{'widget'}{ 'duration_s' }->GetValue;
    $settings->{'dot_density'} = ($self->{'widget'}{ '100dots_per_second' }->GetValue * 100)
                                + $self->{'widget'}{ 'dots_per_second' }->GetValue;
    $settings->{'draw'} = $self->{'widget'}{'draw'}->GetString( $self->{'widget'}{ 'draw' }->GetSelection );
    $settings;
}

sub update_enable {
    my ( $self ) = @_;
    my $type = $self->{'widget'}{'color_flow_type'}->GetValue;
    if      ($type eq 'no'){
        $self->{'widget'}{$_}->Enable(0) for qw/color_flow_speed invert_flow_speed colors_used color_flow_dynamic/;
    } elsif ($type eq 'one_time'){
        $self->{'widget'}{$_}->Enable(1) for qw/color_flow_speed invert_flow_speed colors_used color_flow_dynamic/;
        $self->{'widget'}{'color_flow_speed'}->Enable(0);
        $self->{'widget'}{'invert_flow_speed'}->Enable(0);
    } else {
        $self->{'widget'}{$_}->Enable(1) for qw/color_flow_speed invert_flow_speed colors_used color_flow_dynamic/;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.312 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )