240 Commits

Author SHA1 Message Date
Vladimir Markelov
7749b29367
Merge pull request #103 from dorileo/fix-window-draw
Fix window draw
2018-09-04 21:52:33 -07:00
Leandro Dorileo
e6d379e7ec fix clui's window corruption
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>
2018-09-04 15:00:16 -07:00
Vladimir Markelov
e0218b9490 conflict fix 2018-08-13 21:45:44 -07:00
Vladimir Markelov
9a5b4343de closes #68 2018-08-13 21:44:19 -07:00
Vladimir Markelov
8709a0b782
Update fselect.md 2018-08-04 21:21:34 -07:00
Vladimir Markelov
74dcb98571
Update README.md 2018-08-04 21:20:45 -07:00
Vladimir Markelov
71de988673
Update README.md 2018-08-04 21:19:40 -07:00
Vladimir Markelov
bca28ea40c closes #98 2018-08-04 21:18:33 -07:00
Vladimir Markelov
1d1beb797c changelog updated 2018-07-17 20:17:32 -07:00
Vladimir Markelov
33e9f9b685
Merge pull request #99 from dorileo/color-map
textutil: add color map facilities
2018-07-17 20:07:51 -07:00
Leandro Dorileo
62143d041e textutil: add color map facilities
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>
2018-07-17 15:14:59 -07:00
Vladimir Markelov
06931cad8b
Merge pull request #97 from dorileo/fix-linear-control-search
ctrlutil: fix NextControl()
2018-06-27 18:21:03 -07:00
Leandro Dorileo
a1babea8cb ctrlutil: fix NextControl()
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>
2018-06-27 15:54:31 -07:00
Vladimir Markelov
9979c8781a
Merge pull request #96 from dorileo/fix-set-visible
base_control: fix set visible event dispatching
2018-06-21 19:02:11 -07:00
Leandro Dorileo
1fc1fdd776 base_control: fix set visible event dispatching
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>
2018-06-21 17:22:26 -07:00
Vladimir Markelov
4f279ead6b
Merge pull request #93 from dorileo/navigation
Navigation with arrow keys
2018-04-19 13:15:17 -07:00
Leandro Dorileo
0b2b6067c1 clui: NextControl() also filter out disabled controls
When selecting previous or next controls in we want to also filter
out the disabled controls - since they will never get focused.
2018-04-19 10:33:16 -07:00
Leandro Dorileo
212c6b3a41 clui: control selection
Implements the control selection with keyUp and keyDown besides the
KeyTab selection.
2018-04-19 10:33:10 -07:00
Leandro Dorileo
4c9bc9f83a clui: simplify NextControl() method
This patch simplifies the implementation of NextControl(),
FindLastControl() and FindFirstControl() methods.
2018-04-18 16:26:07 -07:00
Vladimir Markelov
483948365c
Merge pull request #92 from dorileo/on-active
base: add OnActive() callback
2018-04-12 12:30:04 -07:00
Leandro Dorileo
8a4b55d6a3 base: add OnActive() callback
In order to notify the user we have gained or lost focus this patch
adds the OnActive() callback. The callback argument is the new value.
2018-04-12 10:29:55 -07:00
Vladimir Markelov
b3385431bc README upadte v0.8.0 2018-04-07 14:29:13 -07:00
Vladimir Markelov
83584b30ce fix new dialog 2018-04-07 14:23:36 -07:00
Vladimir Markelov
143171225b
Merge pull request #85 from Viv1k/master
Confirmation Dialog with editbox input
2018-04-07 14:08:40 -07:00
Vladimir Markelov
ecc435355d
Merge pull request #91 from dorileo/edit-onkeypress
edit: pass event.Ch to OnKeyPress callback
2018-04-03 20:25:35 -07:00
Leandro Dorileo
efa32413a4 edit: pass event.Ch to OnKeyPress callback
It seems beneficial the callback to also know the event.Ch so we can
implement more "sophisticated" field filling validation strategies.
2018-04-03 13:07:49 -07:00
Vladimir Markelov
8d3cd97d8e
Merge pull request #90 from dorileo/control-destroy
Control destroy
2018-03-26 21:01:47 -07:00
Leandro Dorileo
be1a2b7283 BaseControl: add a Destroy() interface
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.
2018-03-23 14:35:30 -07:00
Leandro Dorileo
1f44a01230 BaseControl: add refID
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.
2018-03-23 14:34:01 -07:00
Vladimir Markelov
c051927c58
Merge pull request #88 from dorileo/fixes-for-review
Fixes for review
2018-03-20 21:06:16 -07:00
Leandro Dorileo
8e0a86e5c7 edit: reset the cursor position
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.
2018-03-20 15:22:13 -07:00
Leandro Dorileo
492d582ad6 label: multiline
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.
2018-03-20 15:22:02 -07:00
Leandro Dorileo
4d8b1ae09a listbox: call onSelectItem on keyboard selection
Now listbox will only call onSelectItem() after a mouse selection,
this patch does the same also for keyboard selection.
2018-03-20 15:21:53 -07:00
vivek kumar
47585bb173 edit dialog working 2018-03-16 17:48:53 +05:30
vivek kumar
f48a68a048 Merge remote-tracking branch 'upstream/master' 2018-03-16 15:56:32 +05:30
Vladimir Markelov
7d2469f651 fix for #84 2018-03-15 20:56:29 -07:00
Vladimir Markelov
9d75bfad5a closes #86 - fix crash when the last Window is closed by an internal call 2018-03-14 20:38:52 -07:00
vivek kumar
5ad405ae99 fixed package name 2018-03-14 15:33:29 +05:30
Vivek Kumar
755d6c63d4
Merge pull request #2 from Viv1k/confirmation-dialog-with-editbox-input-1
dialog box with editfield
2018-03-14 14:17:17 +05:30
vivek kumar
c83e8ea28f working dialog with edit box 2018-03-14 13:44:32 +05:30
Vladimir Markelov
77ee1b7531 #84 - add new Control property Visible 2018-03-13 22:14:40 -07:00
Vladimir Markelov
d1b209b51f Merge branch 'master' of https://github.com/VladimirMarkelov/clui 2018-01-27 14:21:52 -08:00
Vladimir Markelov
efca4aaa22 #82 #78 - do not run callbacks in separate thread 2018-01-27 14:21:28 -08:00
Vladimir Markelov
6cc955a07d
Merge pull request #77 from pjebs/master
Made some adjustments which may be useful
2018-01-26 21:38:56 -08:00
Vladimir Markelov
5d3a40175d #79 - allow Windows to handle terminal resize event 2018-01-26 21:36:46 -08:00
pj
ae7a061585 Merge branch 'master' of https://github.com/VladimirMarkelov/clui 2018-01-26 18:15:43 +11:00
Vladimir Markelov
c7750d4e42 #78 - fix some data races 2018-01-25 21:49:43 -08:00
pj
9d4cf1efcf exposed view object. 2018-01-24 19:23:00 +11:00
pj
46578847cb Added alert dialog 2018-01-24 19:21:05 +11:00
pj
cd3c9588ac smoother delay for more natural keyboard entry 2018-01-24 19:20:36 +11:00