From: Niki Roo Date: Thu, 2 Jan 2020 17:20:14 +0000 (+0100) Subject: Merge branch 'upstream-sep2019-tcombo' into subtree X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=commitdiff_plain;h=77d3a60869e7a780c6ae069e51530e1eacece5e2;hp=-c Merge branch 'upstream-sep2019-tcombo' into subtree --- 77d3a60869e7a780c6ae069e51530e1eacece5e2 diff --combined TWidget.java index d60efd8,f11cbf3..ce22330 --- a/TWidget.java +++ b/TWidget.java @@@ -36,7 -36,6 +36,7 @@@ import java.util.ArrayList import jexer.backend.Screen; import jexer.bits.Cell; import jexer.bits.CellAttributes; +import jexer.bits.Clipboard; import jexer.bits.ColorTheme; import jexer.event.TCommandEvent; import jexer.event.TInputEvent; @@@ -592,8 -591,9 +592,8 @@@ public abstract class TWidget implement * @param command command event */ public void onCommand(final TCommandEvent command) { - // Default: do nothing, pass to children instead - for (TWidget widget: children) { - widget.onCommand(command); + if (activeChild != null) { + activeChild.onCommand(command); } } @@@ -1126,18 -1126,6 +1126,18 @@@ return null; } + /** + * Get the Clipboard. + * + * @return the Clipboard, or null if not assigned + */ + public Clipboard getClipboard() { + if (window != null) { + return window.getApplication().getClipboard(); + } + return null; + } + /** * Comparison operator. For various subclasses it sorts on: *