2013-08-25 16:01:59 +00:00
|
|
|
package Slic3r::GUI::Plater::ObjectPreviewDialog;
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use utf8;
|
|
|
|
|
|
|
|
use Wx qw(:dialog :id :misc :sizer :systemsettings :notebook wxTAB_TRAVERSAL);
|
2013-11-12 20:49:34 +00:00
|
|
|
use Wx::Event qw(EVT_CLOSE);
|
2013-08-25 16:01:59 +00:00
|
|
|
use base 'Wx::Dialog';
|
|
|
|
|
|
|
|
sub new {
|
|
|
|
my $class = shift;
|
|
|
|
my ($parent, %params) = @_;
|
|
|
|
my $self = $class->SUPER::new($parent, -1, $params{object}->name, wxDefaultPosition, [500,500], wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
|
2013-12-12 19:19:33 +00:00
|
|
|
$self->{model_object} = $params{model_object};
|
2013-08-25 16:01:59 +00:00
|
|
|
|
|
|
|
my $sizer = Wx::BoxSizer->new(wxVERTICAL);
|
2013-12-12 19:19:33 +00:00
|
|
|
$sizer->Add(Slic3r::GUI::PreviewCanvas->new($self, $self->{model_object}), 1, wxEXPAND, 0);
|
2013-08-25 16:01:59 +00:00
|
|
|
$self->SetSizer($sizer);
|
|
|
|
$self->SetMinSize($self->GetSize);
|
|
|
|
|
2013-11-12 20:49:34 +00:00
|
|
|
# needed to actually free memory
|
|
|
|
EVT_CLOSE($self, sub {
|
|
|
|
$self->EndModal(wxID_OK);
|
|
|
|
$self->Destroy;
|
|
|
|
});
|
|
|
|
|
2013-08-25 16:01:59 +00:00
|
|
|
return $self;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|