When stacking a popup window on top of #1 a visible window and
all over. This patch fixes the issue by [re]flushing the terminal.
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
Introduce SetColorMap()/GetColorMap() API's. With this the user may
change the termbox's output (i.e with Output256) mode and set a broader
color map.
In the future - if needed - we could introduce an API to switch modes
and automatically remap the colors as required. For now, this API's
are good enough.
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
With this helper we may iterate over the control list and end up
not having any control that match the search criteria (namely: tabStop,
visible and enabled). In that case an index out of bounds error will
happen.
This patch checks for the resulting list and return if no control's
found.
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
Currently when setting a control visible no matter if this control has
active children new KeyTab events will be dispatched. This results in
errors when an application has explicitly set the active control -
i.e with clui.ActivateControl().
In this case the expected behavior is to have that control active
instead of the next one, since we are not considering the the children
state then we always emit the KeyTab event resulting into a focus/active
status change.
This patch changes this behavior by querying the children's status and
checking if there is a child with active state set and only triggering
the KeyTab event when no child is active.
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
This interface should be used to remove an object from its parental
chain, this destroyed object will not receive events nor will be
drawn neither will impact on other objects position and sizing.
These objects if properly handled could be eligible for collection
as well.
In order to guarantee BaseControl and Control are fully comparable in the
BaseControl level this patch introduces a refID interface, so the objects
can safely be comparable based on this interface.
Whenever changing an edit' content with SetTitle() method the cursor
position must also be updated, otherwise the cursor will be placed based
on previous content.
Currently when a label is multiline Draw() will paint it with black/while
foreground/background colors.
This patch makes sure we keep theme consistent across the single line and
multiline use cases.