273 Commits

Author SHA1 Message Date
Vladimir Markelov
626f13a36e update tableview demo to show how to edit a value 2019-06-06 20:53:41 -07:00
Vladimir Markelov
4848282327 UX improvement - separate close window icon from other icons v1.2.0 2019-05-10 21:01:21 -07:00
Vladimir Markelov
9406044044 dual licencse: BSD-2 license added 2019-05-10 19:34:00 -07:00
Vladimir Markelov
17ae50e353 style and typo fixes 2019-05-07 21:47:56 -07:00
Vladimir Markelov
9e72c95fac change default window close button character to ■, closes #122 2019-05-07 19:51:28 -07:00
Vladimir Markelov
561dfd3507 rename TextReader to TextDisplay to avoid confusion with io.Reader (TextReader is still avaialble but deprecated) v1.1.0 2019-03-16 15:44:03 -07:00
Vladimir Markelov
1f6ccfb9aa docs update v1.0 2018-12-01 18:49:49 -08:00
Vladimir Markelov
403ab18660
Merge pull request #114 from dorileo/fix-window-process-event
window: fix event processing
2018-11-14 13:08:55 -08:00
Leandro Dorileo
97f58ec224 window: fix event processing
Avoid invalid memory address access by no trying to get parent's
control if next control is nil on event processing.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-11-14 09:49:07 -08:00
Vladimir Markelov
380e4a5118 TableView's OnBeforeDraw feature closes #113 2018-11-09 22:52:36 -08:00
Vladimir Markelov
80da317c70
Merge pull request #111 from enciris/master
Add OnChange() callback function on radio buttons
2018-10-26 20:10:41 -07:00
rd
fe2b9bfba6 Change line feed sequence from CRLF to LF 2018-10-26 09:53:24 +02:00
Vladimir Markelov
bc8d1ba9f9 fix title display for Frame 2018-10-09 08:43:09 -07:00
Vladimir Markelov
a83e4ab41b Fix Frame border drawing 2018-10-08 00:26:34 -07:00
Vladimir Markelov
8c84a8b2ae fix ENTER key processing in TableView 2018-09-30 11:46:14 -07:00
Vladimir Markelov
a2c441f678
Merge pull request #110 from dorileo/fix-clipper
clui: fix Clipper() function
2018-09-26 21:21:39 -07:00
Leandro Dorileo
6ab34c5f92 clui: fix Clipper() function
We're using the wrong control to calculate the clipped area, it should
be the clipped control not its clipped parent.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-26 13:54:54 -07:00
rd
0425b8aabc Add OnChange() callback function on radio buttons 2018-09-26 15:38:02 +02:00
Vladimir Markelov
ef8620db14
Merge pull request #108 from mdhorn/borderless
Allow for No Border on Window
2018-09-20 08:58:54 -07:00
Mark D Horn
7097e0a5f9 Allow for No Border on Window
Keeps current API as-is by defaulting to the new BorderAuto BorderStyle
which keeps the default borders on Windows and defaults on none on Frames.

Allows setting a Window Border to BorderNone for a frameless Window.

Need to allow setting the border default in the Window Manager to avoid
the border from being drawn and then removed.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-09-19 18:26:19 -07:00
Vladimir Markelov
7d56d2e459
Merge pull request #107 from dorileo/add-strollto
frame: add ScrollTo() API
2018-09-13 18:45:29 -07:00
Leandro Dorileo
a444bbed4b frame: add ScrollTo() API
Frequently a user needs forcefully scroll a scrollable frame to an
arbitrary position. This API will scroll the content leaving the
clipper untouched.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-13 16:24:23 -07:00
Vladimir Markelov
ace300005c
Merge pull request #105 from dorileo/fix-child-at
Don't consider hidden children on ChildAt
2018-09-12 12:56:59 -07:00
Vladimir Markelov
b25f59a7ef
Merge pull request #104 from dorileo/fix-next-control
NextControl also considers parent's visibility
2018-09-12 12:56:22 -07:00
Leandro Dorileo
825d1c1f49 Don't consider hidden children on ChildAt
When dealing with mouse events we use ChildAt() to find the controls
in the clicked area, but we may have hidden elements in the same position
in that case we want to dispatch events to the visible one. This patch
fixes this issue by filtering out the non visible elements.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-12 10:37:41 -07:00
Leandro Dorileo
85c09dabf1 NextControl also considers parent's visibility
Whenever running through NextControl() also exclude those controls
which parents are also non visible.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-12 09:28:22 -07:00
Vladimir Markelov
89a7c86623 update readme 2018-09-06 22:19:36 -07:00
Vladimir Markelov
1051263ca4
Merge pull request #102 from dorileo/scrollable-frame
Scrollable frame
2018-09-06 22:12:51 -07:00
Leandro Dorileo
3d8191b368 demo: add a scrollable frame demo
With this demo we show how to use the scrollable frame with a frame
containing 10 buttons.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-06 14:44:21 -07:00
Leandro Dorileo
9153ec6718 frame: scrollable frame
This patch introduce internal changes in order to #1 actually clip
content avoid growing parent's size and keeping controls with their
own pre-set sizes and also #2 add a scrollable feature to frame control.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-06 14:44:21 -07:00
Leandro Dorileo
e259a9d776 add context to OnKeyDown
In order to keep caller's context this patch introduces a interface{}
argument to carry on arbitrary data and pass it back based on the
registered callback.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-06 14:44:21 -07:00
Leandro Dorileo
f432809086 fix getLinearControlList() fn callback call
If no fn callback is provided don't try to call it and avoid segfault.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-06 14:44:21 -07:00
Leandro Dorileo
6cede82cb7 add custom theme support
With this change users can specify custom theme extensions.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-06 14:44:15 -07:00
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