… | |
… | |
9 | use Gtk2; |
9 | use Gtk2; |
10 | use Gtk2::Gdk::Keysyms; |
10 | use Gtk2::Gdk::Keysyms; |
11 | use Gtk2::SimpleMenu; |
11 | use Gtk2::SimpleMenu; |
12 | |
12 | |
13 | use Crossfire; |
13 | use Crossfire; |
|
|
14 | use Crossfire::Map; |
14 | use Crossfire::MapWidget; |
15 | use Crossfire::MapWidget; |
15 | |
16 | |
16 | use GCE::AttrEdit; |
17 | use GCE::AttrEdit; |
17 | use GCE::MapEditor; |
18 | use GCE::MapEditor; |
18 | use GCE::StackView; |
19 | use GCE::StackView; |
… | |
… | |
80 | $w->open_map ($mapfile); |
81 | $w->open_map ($mapfile); |
81 | |
82 | |
82 | ::set_pos_and_size ($w, $main::CFG->{map_window}, 500, 500, 200, 0); |
83 | ::set_pos_and_size ($w, $main::CFG->{map_window}, 500, 500, 200, 0); |
83 | |
84 | |
84 | $w->show_all; |
85 | $w->show_all; |
85 | # my $w = $self->{last_map_window} = Gtk2::Window->new ('toplevel'); |
|
|
86 | # $w->set_title ('gce - map editor'); |
|
|
87 | # $w->add (my $mapedit = $self->{mapedit} = new GCE::MapEditor); |
|
|
88 | # $mapedit->open_map ($mapfile); |
|
|
89 | # |
|
|
90 | # |
|
|
91 | # $w->show_all; |
|
|
92 | } |
86 | } |
93 | |
87 | |
94 | sub show_stack_view { |
88 | sub show_stack_view { |
95 | my ($self) = @_; |
89 | my ($self) = @_; |
96 | |
90 | |
… | |
… | |
337 | ::set_pos_and_size ($self, $main::CFG->{main_window}, 150, 200, 0, 0); |
331 | ::set_pos_and_size ($self, $main::CFG->{main_window}, 150, 200, 0, 0); |
338 | } |
332 | } |
339 | |
333 | |
340 | sub new_cb { |
334 | sub new_cb { |
341 | my ($self) = @_; |
335 | my ($self) = @_; |
342 | warn "new map not yet implemented\n"; |
336 | |
|
|
337 | my $w = Gtk2::Window->new ('toplevel'); |
|
|
338 | my $width = [width => 20]; |
|
|
339 | my $height = [height => 20]; |
|
|
340 | $w->add (my $tbl = Gtk2::Table->new (2, 3)); |
|
|
341 | add_table_widget ($tbl, 0, $width, 'string'); |
|
|
342 | add_table_widget ($tbl, 1, $height, 'string'); |
|
|
343 | add_table_widget ($tbl, 2, 'new', 'button', sub { |
|
|
344 | if ($width->[1] > 0 and $height->[1] > 0) { |
|
|
345 | my $map = Crossfire::Map->new ($width->[1], $height->[1]); |
|
|
346 | $self->open_map_editor ($map); |
|
|
347 | } |
|
|
348 | $w->destroy; |
|
|
349 | 1; |
|
|
350 | }); |
|
|
351 | add_table_widget ($tbl, 3, 'close', 'button', sub { $w->destroy }); |
|
|
352 | $w->show_all; |
343 | } |
353 | } |
344 | |
354 | |
345 | sub new_filechooser { |
355 | sub new_filechooser { |
346 | my ($self) = @_; |
356 | my ($self) = @_; |
347 | |
357 | |