App-GUI-Juliagraph
view release on metacpan or search on metacpan
arrows. If you like the seen color push "Load". This single color store
has also Buttons to store your own favorite colors or delete the ones
you dont like. The only way to bring back deleted default colors is to
delete the config file: ~/.config/juliagraph.
Mouse
The drawing board responds to three types of clicks. A left click moves
the visible section. Double click means zoom in and right click is zoom
out.
Menu
The upmost menu bar has only three very simple menus. Please not that
each menu shows which key combination triggers the same command and
while hovering over an menu item you see a short help text the left
status bar field.
The first menu is for loading and storing setting files with arbitrary
names. Also a sub menu allows a quick load of the recently used files.
The first entry lets you reset the whole program to the starting state
and the last is just to exit (safely with saving the configs).
lib/App/GUI/Juliagraph.pm view on Meta::CPAN
has also Buttons to store your own favorite colors or delete the ones
you dont like. The only way to bring back deleted default colors is to
delete the config file: ~/.config/juliagraph.
=head2 Mouse
The drawing board responds to three types of clicks. A left click moves
the visible section. Double click means zoom in and right click is zoom out.
=head2 Menu
The upmost menu bar has only three very simple menus.
Please not that each menu shows which key combination triggers the same
command and while hovering over an menu item you see a short help text
the left status bar field.
The first menu is for loading and storing setting files with arbitrary
names. Also a sub menu allows a quick load of the recently used files.
The first entry lets you reset the whole program to the starting state
and the last is just to exit (safely with saving the configs).
lib/App/GUI/Juliagraph/Frame.pm view on Meta::CPAN
Wx::Event::EVT_BUTTON( $self, $self->{'btn'}{'draw'}, sub { draw( $self ) });
Wx::Event::EVT_CLOSE( $self, sub {
$self->{'tab'}{'color'}->update_config();
$self->{'config'}->save();
$self->{'dialog'}{about}->Destroy();
$_[1]->Skip(1)
});
# GUI layout assembly
my $settings_menu = $self->{'setting_menu'} = Wx::Menu->new();
$settings_menu->Append( 11100, "&Init\tCtrl+I", "put all settings to default" );
$settings_menu->Append( 11200, "&Open\tCtrl+O", "load settings from an INI file" );
$settings_menu->Append( 11400, "&Write\tCtrl+W", "store curent settings into an INI file" );
$settings_menu->AppendSeparator();
$settings_menu->Append( 11500, "&Quit\tAlt+Q", "save configs and close program" );
my $image_size_menu = Wx::Menu->new();
for (1 .. 20) {
my $size = $_ * 100;
$image_size_menu->AppendRadioItem(12100 + $_, $size, "set image size to $size x $size");
Wx::Event::EVT_MENU( $self, 12100 + $_, sub {
my $size = 100 * ($_[1]->GetId - 12100);
$self->{'config'}->set_value('image_size', $size);
$self->{'board'}->set_size( $size );
});
}
$image_size_menu->Check( 12100 +($self->{'config'}->get_value('image_size') / 100), 1);
my $image_format_menu = Wx::Menu->new();
$image_format_menu->AppendRadioItem(12201, 'PNG', "set default image format to PNG");
$image_format_menu->AppendRadioItem(12202, 'JPEG', "set default image format to JPEG");
$image_format_menu->AppendRadioItem(12203, 'SVG', "set default image format to SVG");
Wx::Event::EVT_MENU( $self, 12201, sub { $self->{'config'}->set_value('file_base_ending', 'png') });
Wx::Event::EVT_MENU( $self, 12202, sub { $self->{'config'}->set_value('file_base_ending', 'jpg') });
Wx::Event::EVT_MENU( $self, 12203, sub { $self->{'config'}->set_value('file_base_ending', 'svg') });
$image_format_menu->Check( 12201, 1 ) if $self->{'config'}->get_value('file_base_ending') eq 'png';
$image_format_menu->Check( 12202, 1 ) if $self->{'config'}->get_value('file_base_ending') eq 'jpg';
$image_format_menu->Check( 12203, 1 ) if $self->{'config'}->get_value('file_base_ending') eq 'svg';
my $image_menu = Wx::Menu->new();
$image_menu->Append( 12300, "&Draw\tCtrl+D", "complete a sketch drawing" );
$image_menu->Append( 12100, "S&ize", $image_size_menu, "set image size" );
$image_menu->Append( 12200, "&Format", $image_format_menu, "set default image formate" );
$image_menu->Append( 12400, "&Save\tCtrl+S", "save currently displayed image" );
my $help_menu = Wx::Menu->new();
$help_menu->Append( 13300, "&About\tAlt+A", "Dialog with general information about the program" );
my $menu_bar = Wx::MenuBar->new();
$menu_bar->Append( $settings_menu, '&Settings' );
$menu_bar->Append( $image_menu, '&Image' );
$menu_bar->Append( $help_menu, '&Help' );
$self->SetMenuBar($menu_bar);
Wx::Event::EVT_MENU( $self, 11100, sub { $self->init });
Wx::Event::EVT_MENU( $self, 11200, sub { $self->open_settings_dialog });
Wx::Event::EVT_MENU( $self, 11400, sub { $self->write_settings_dialog });
Wx::Event::EVT_MENU( $self, 11500, sub { $self->Close });
Wx::Event::EVT_MENU( $self, 12300, sub { $self->draw });
Wx::Event::EVT_MENU( $self, 12400, sub { $self->save_image_dialog });
Wx::Event::EVT_MENU( $self, 13300, sub { $self->{'dialog'}{'about'}->ShowModal });
my $std_attr = &Wx::wxALIGN_LEFT|&Wx::wxGROW|&Wx::wxALIGN_CENTER_VERTICAL;
lib/App/GUI/Juliagraph/Frame.pm view on Meta::CPAN
$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);
Wx::Event::EVT_MENU( $self, $Recent_ID++, sub { $self->open_setting_file( $path ) });
}
$self->{'setting_menu'}->Insert( 2, $set_menu_ID, '&Recent', $self->{'recent_menu'}, 'recently saved settings' );
}
sub init {
my ($self) = @_;
( run in 0.964 second using v1.01-cache-2.11-cpan-49f99fa48dc )