~ubuntu-branches/ubuntu/utopic/slic3r/utopic

« back to all changes in this revision

Viewing changes to lib/Slic3r/GUI/Plater/ObjectPreviewDialog.pm

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2014-06-17 01:27:26 UTC
  • Revision ID: package-import@ubuntu.com-20140617012726-2wrs4zdo251nr4vg
Tags: upstream-1.1.4+dfsg
ImportĀ upstreamĀ versionĀ 1.1.4+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package Slic3r::GUI::Plater::ObjectPreviewDialog;
 
2
use strict;
 
3
use warnings;
 
4
use utf8;
 
5
 
 
6
use Wx qw(:dialog :id :misc :sizer :systemsettings :notebook wxTAB_TRAVERSAL);
 
7
use Wx::Event qw(EVT_CLOSE);
 
8
use base 'Wx::Dialog';
 
9
 
 
10
sub new {
 
11
    my $class = shift;
 
12
    my ($parent, %params) = @_;
 
13
    my $self = $class->SUPER::new($parent, -1, $params{object}->name, wxDefaultPosition, [500,500], wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
 
14
    $self->{model_object} = $params{model_object};
 
15
    
 
16
    my $sizer = Wx::BoxSizer->new(wxVERTICAL);
 
17
    $sizer->Add(Slic3r::GUI::PreviewCanvas->new($self, $self->{model_object}), 1, wxEXPAND, 0);
 
18
    $self->SetSizer($sizer);
 
19
    $self->SetMinSize($self->GetSize);
 
20
    
 
21
    # needed to actually free memory
 
22
    EVT_CLOSE($self, sub {
 
23
        $self->EndModal(wxID_OK);
 
24
        $self->Destroy;
 
25
    });
 
26
    
 
27
    return $self;
 
28
}
 
29
 
 
30
1;