diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index 9f9e8bbc..e121bf6b 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -11,15 +11,28 @@ sub new { my $class = shift; my ($parent) = @_; my $self = $class->SUPER::new($parent, -1, [-1,-1], [-1,-1], &Wx::wxBK_LEFT); - + + $self->{images} = Wx::ImageList->new(16, 16, 1); + $self->AssignImageList($self->{images}); + $self->{imagecount} = -1; + return $self; } sub AddOptionsPage { my $self = shift; my $title = shift; + my $image = (ref $_[1]) ? undef : shift; my $page = Slic3r::GUI::Tab::Page->new($self, @_); - $self->AddPage($page, $title); + + my $bitmap = $image + ? Wx::Bitmap->new("$Slic3r::var/$image", &Wx::wxBITMAP_TYPE_PNG) + : undef; + if ($bitmap) { + $self->{images}->Add($bitmap); + $self->{imagecount}++; + } + $self->AddPage($page, $title, undef, $self->{imagecount}); } package Slic3r::GUI::Tab::Print; @@ -33,7 +46,7 @@ sub new { my ($parent) = @_; my $self = $class->SUPER::new($parent, -1); - $self->AddOptionsPage('Layers and perimeters', optgroups => [ + $self->AddOptionsPage('Layers and perimeters', 'layers.png', optgroups => [ { title => 'Layer height', options => [qw(layer_height first_layer_height)], @@ -48,14 +61,14 @@ sub new { }, ]); - $self->AddOptionsPage('Infill', optgroups => [ + $self->AddOptionsPage('Infill', 'shading.png', optgroups => [ { title => 'Infill', options => [qw(fill_density fill_angle fill_pattern solid_fill_pattern)], }, ]); - $self->AddOptionsPage('Speed', optgroups => [ + $self->AddOptionsPage('Speed', 'time.png', optgroups => [ { title => 'Speed for print moves', options => [qw(perimeter_speed small_perimeter_speed infill_speed solid_infill_speed top_solid_infill_speed bridge_speed)], @@ -70,14 +83,14 @@ sub new { }, ]); - $self->AddOptionsPage('Skirt', optgroups => [ + $self->AddOptionsPage('Skirt', 'box.png', optgroups => [ { title => 'Skirt', options => [qw(skirts skirt_distance skirt_height)], }, ]); - $self->AddOptionsPage('Cooling', optgroups => [ + $self->AddOptionsPage('Cooling', 'hourglass.png', optgroups => [ { title => 'Enable', options => [qw(cooling)], @@ -92,21 +105,21 @@ sub new { }, ]); - $self->AddOptionsPage('Support material', optgroups => [ + $self->AddOptionsPage('Support material', 'building.png', optgroups => [ { title => 'Support material', options => [qw(support_material support_material_tool)], }, ]); - $self->AddOptionsPage('Notes', optgroups => [ + $self->AddOptionsPage('Notes', 'note.png', optgroups => [ { title => 'Notes', options => [qw(notes)], }, ]); - $self->AddOptionsPage('Output options', optgroups => [ + $self->AddOptionsPage('Output options', 'page_white_go.png', optgroups => [ { title => 'Sequential printing', options => [qw(complete_objects extruder_clearance_radius extruder_clearance_height)], @@ -121,7 +134,7 @@ sub new { }, ]); - $self->AddOptionsPage('Advanced', optgroups => [ + $self->AddOptionsPage('Advanced', 'wrench.png', optgroups => [ { title => 'Extrusion width', options => [qw(extrusion_width first_layer_extrusion_width perimeters_extrusion_width infill_extrusion_width)], @@ -132,9 +145,6 @@ sub new { }, ]); - - - return $self; } @@ -149,7 +159,7 @@ sub new { my ($parent) = @_; my $self = $class->SUPER::new($parent, -1); - $self->AddOptionsPage('General', optgroups => [ + $self->AddOptionsPage('General', 'printer_empty.png', optgroups => [ { title => 'Size and coordinates', options => [qw(bed_size print_center z_offset)], @@ -160,7 +170,7 @@ sub new { }, ]); - $self->AddOptionsPage('Extruder and filament', optgroups => [ + $self->AddOptionsPage('Extruder and filament', 'spool.png', optgroups => [ { title => 'Size', options => [qw(nozzle_diameter)], @@ -175,14 +185,14 @@ sub new { }, ]); - $self->AddOptionsPage('Custom G-code', optgroups => [ + $self->AddOptionsPage('Custom G-code', 'cog.png', optgroups => [ { title => 'Custom G-code', options => [qw(start_gcode end_gcode layer_gcode)], }, ]); - $self->AddOptionsPage('Retraction', optgroups => [ + $self->AddOptionsPage('Retraction', 'arrow_up.png', optgroups => [ { title => 'Retraction', options => [qw(retract_length retract_lift retract_speed)], diff --git a/var/arrow_up.png b/var/arrow_up.png new file mode 100755 index 00000000..1ebb1932 Binary files /dev/null and b/var/arrow_up.png differ diff --git a/var/box.png b/var/box.png new file mode 100755 index 00000000..8443c23e Binary files /dev/null and b/var/box.png differ diff --git a/var/building.png b/var/building.png new file mode 100755 index 00000000..11a017cf Binary files /dev/null and b/var/building.png differ diff --git a/var/cog.png b/var/cog.png new file mode 100755 index 00000000..67de2c6c Binary files /dev/null and b/var/cog.png differ diff --git a/var/hourglass.png b/var/hourglass.png new file mode 100755 index 00000000..57b03ce7 Binary files /dev/null and b/var/hourglass.png differ diff --git a/var/note.png b/var/note.png new file mode 100755 index 00000000..244e6ca0 Binary files /dev/null and b/var/note.png differ diff --git a/var/page_white_go.png b/var/page_white_go.png new file mode 100755 index 00000000..7e62a924 Binary files /dev/null and b/var/page_white_go.png differ diff --git a/var/printer_empty.png b/var/printer_empty.png new file mode 100755 index 00000000..94e8c161 Binary files /dev/null and b/var/printer_empty.png differ diff --git a/var/shading.png b/var/shading.png new file mode 100755 index 00000000..09275f9c Binary files /dev/null and b/var/shading.png differ diff --git a/var/spool.png b/var/spool.png new file mode 100644 index 00000000..709006d3 Binary files /dev/null and b/var/spool.png differ diff --git a/var/time.png b/var/time.png new file mode 100755 index 00000000..911da3f1 Binary files /dev/null and b/var/time.png differ diff --git a/var/wrench.png b/var/wrench.png new file mode 100755 index 00000000..5c8213fe Binary files /dev/null and b/var/wrench.png differ