… | |
… | |
338 | can_events => 1, |
338 | can_events => 1, |
339 | on_button_down => $macro_cb, |
339 | on_button_down => $macro_cb, |
340 | ); |
340 | ); |
341 | |
341 | |
342 | $macros->add (1, $y, new CFPlus::UI::Label |
342 | $macros->add (1, $y, new CFPlus::UI::Label |
343 | text => (join "; ", @{ $macro->{action} }), |
343 | text => (join "; ", @{ $macro->{action} || [] }), |
344 | tooltip => $tooltip_commands . $tooltip_common, |
344 | tooltip => $tooltip_commands . $tooltip_common, |
345 | expand => 1, |
345 | expand => 1, |
346 | ellipsise => 3, |
346 | ellipsise => 3, |
347 | can_hover => 1, |
347 | can_hover => 1, |
348 | can_events => 1, |
348 | can_events => 1, |
… | |
… | |
357 | } |
357 | } |
358 | |
358 | |
359 | # this is a shortcut method that asks for a binding |
359 | # this is a shortcut method that asks for a binding |
360 | # and then just binds it. |
360 | # and then just binds it. |
361 | sub quick_macro { |
361 | sub quick_macro { |
362 | my ($self, $cmds, $end_cb) = @_; |
362 | my ($cmds, $end_cb) = @_; |
363 | |
363 | |
364 | my $macro = { |
364 | my $macro = { |
365 | action => $cmds, |
365 | action => $cmds, |
366 | }; |
366 | }; |
367 | |
367 | |
368 | trigger_edit $macro, sub { |
368 | trigger_edit $macro, sub { |
369 | |
|
|
370 | if ($_[0]) { |
369 | if ($_[0]) { |
371 | push @{ $::PROFILE->{macro} }, $macro; |
370 | push @{ $::PROFILE->{macro} }, $macro; |
372 | $REFRESH_MACRO_LIST->(); |
371 | $REFRESH_MACRO_LIST->(); |
373 | } |
372 | } |
374 | |
373 | |