… | |
… | |
233 | } |
233 | } |
234 | |
234 | |
235 | sub build_buttons { |
235 | sub build_buttons { |
236 | my ($self) = @_; |
236 | my ($self) = @_; |
237 | |
237 | |
238 | my $tbl = Gtk2::Table->new (2, 2); |
238 | my $tbl = Gtk2::Table->new (2, 4); |
239 | my $plcinfo = { width => 1, height => 3, next => [0, 0] }; |
239 | my $plcinfo = { width => 1, height => 4, next => [0, 0] }; |
240 | |
240 | |
241 | $self->{edit_collection}{pick} = GCE::EditAction::Pick->new; |
241 | $self->{edit_collection}{pick} = GCE::EditAction::Pick->new; |
242 | $self->{edit_collection}{place} = GCE::EditAction::Place->new; |
242 | $self->{edit_collection}{place} = GCE::EditAction::Place->new; |
243 | $self->{edit_collection}{erase} = GCE::EditAction::Erase->new; |
243 | $self->{edit_collection}{erase} = GCE::EditAction::Erase->new; |
|
|
244 | $self->{edit_collection}{select}= GCE::EditAction::Select->new; |
244 | |
245 | |
245 | $self->set_edit_tool ('pick'); |
246 | $self->set_edit_tool ('pick'); |
246 | |
247 | |
247 | $self->add_button ($tbl, $plcinfo, "Pick", sub { $self->set_edit_tool ('pick') }); |
248 | $self->add_button ($tbl, $plcinfo, "Pick", sub { $self->set_edit_tool ('pick') }); |
248 | $self->add_button ($tbl, $plcinfo, "Place", sub { $self->set_edit_tool ('place') }); |
249 | $self->add_button ($tbl, $plcinfo, "Place", sub { $self->set_edit_tool ('place') }); |
249 | $self->add_button ($tbl, $plcinfo, "Erase", sub { $self->set_edit_tool ('erase') }); |
250 | $self->add_button ($tbl, $plcinfo, "Erase", sub { $self->set_edit_tool ('erase') }); |
|
|
251 | $self->add_button ($tbl, $plcinfo, "Select", sub { $self->set_edit_tool ('select') }); |
250 | |
252 | |
251 | return $tbl; |
253 | return $tbl; |
252 | } |
254 | } |
253 | |
255 | |
254 | sub set_edit_tool { |
256 | sub set_edit_tool { |
… | |
… | |
258 | $self->update_edit_tool ($self->{edit_collection}{pick}, "Pick");; |
260 | $self->update_edit_tool ($self->{edit_collection}{pick}, "Pick");; |
259 | } elsif ($name eq 'place') { |
261 | } elsif ($name eq 'place') { |
260 | $self->update_edit_tool ($self->{edit_collection}{place}, "Place");; |
262 | $self->update_edit_tool ($self->{edit_collection}{place}, "Place");; |
261 | } elsif ($name eq 'erase') { |
263 | } elsif ($name eq 'erase') { |
262 | $self->update_edit_tool ($self->{edit_collection}{erase}, "Erase");; |
264 | $self->update_edit_tool ($self->{edit_collection}{erase}, "Erase");; |
|
|
265 | } elsif ($name eq 'select') { |
|
|
266 | $self->update_edit_tool ($self->{edit_collection}{select}, "Select");; |
263 | } |
267 | } |
264 | } |
268 | } |
265 | |
269 | |
266 | sub update_edit_tool { |
270 | sub update_edit_tool { |
267 | my ($self, $tool, $name) = @_; |
271 | my ($self, $tool, $name) = @_; |