Commit Graph

250 Commits

Author SHA1 Message Date
Joshua Chia
6dce47a94c Switched to using TBQueue (bounded) instead of Chan (unbounded) 2017-01-07 18:52:38 +08:00
Jonathan Daugherty
339054b17c MouseDemo: import fix 2016-12-03 20:39:51 -08:00
Jonathan Daugherty
104d762dd4 MouseDemo: add an editor and use mouse events to move the cursor 2016-12-03 20:26:19 -08:00
Kevin Quick
3e51e2e5c2 Enhance MouseDemo to show interaction between clickable and viewport. 2016-11-30 00:06:44 -07:00
Jonathan Daugherty
bcf6eededb Rename TerminalLocation row/column fields to avoid commonplace name clashes (fixes #96) 2016-11-20 18:22:52 -08:00
Jonathan Daugherty
346a969886 MouseDemo: remove stale imports 2016-11-12 12:45:54 -08:00
Jonathan Daugherty
e313cc6816 Make customMain take an optional channel; do not set mouse mode by default 2016-11-01 13:22:25 -07:00
Jonathan Daugherty
377cc6cb56 Send MouseDown/Up when matching regions instead of just Clicked 2016-10-30 13:44:51 -07:00
Jonathan Daugherty
3ffd35799a MouseDemo: add missing imports for older GHCs 2016-10-30 13:17:08 -07:00
Jonathan Daugherty
5af29b43f8 Mouse demo: remove dragging code, add demo buttons 2016-10-27 22:02:56 -07:00
Jonathan Daugherty
665e19ebfe Update progress bar demo for API changes 2016-10-27 21:49:35 -07:00
Jonathan Daugherty
27f91a56d3 Cleanup 2016-10-27 21:43:39 -07:00
Jonathan Daugherty
3d50122d5b Merge branch 'master' into feature/mouse-support 2016-10-27 21:43:17 -07:00
Kevin Quick
7fcf3e68e9 Added mapAttrname, mapAttrNames, and overrideAttr functions, with ProgressBarDemo to demonstrate their usage. 2016-10-26 22:49:59 -07:00
Jonathan Daugherty
a85238a115 Add extent-local coordinates to Clicked events 2016-10-25 22:32:36 -07:00
Jonathan Daugherty
940435ddcc Update mouse demo with Clicked event test 2016-10-25 20:44:22 -07:00
Jonathan Daugherty
fc8cfe3b4a Remove appLiftVtyEvent in favor of library event type BrickEvent
This change makes it possible for brick to extent the event space using
its own event notions in addition those provided by Vty and the
application itself. This means we no longer need the user to provide the
type and appLiftVtyEvent went away. This makes pattern-matching in event
handlers a little noisier with the benefit that we can now add events
like mouse clicks or drags to the event type.
2016-10-25 20:19:31 -07:00
Jonathan Daugherty
831092e1bd MouseDemo: clear clicked extent list on mouse-up 2016-10-23 22:52:12 -07:00
Jonathan Daugherty
af11c17612 MouseDemo: indentation fix 2016-10-23 22:49:23 -07:00
Jonathan Daugherty
5bfd9a5537 More exploration of a mouse demo program 2016-10-23 22:42:51 -07:00
Jonathan Daugherty
afe2e7eec5 MouseDemo: move clickedExtent into Brick.Main 2016-10-23 19:24:57 -07:00
Jonathan Daugherty
9154522509 Remove mouse event offset adjustment, depend on Vty with relevant fix 2016-10-23 19:19:16 -07:00
Jonathan Daugherty
12659aced0 Merge master 2016-10-23 18:51:47 -07:00
Jonathan Daugherty
a2badcbd9f CacheDemo: add missing Applicative import 2016-09-20 21:31:23 -07:00
Jonathan Daugherty
464fec9c1d Add CacheDemo (closes #82) 2016-09-20 21:15:25 -07:00
Jonathan Daugherty
ef06be53f2 LayerDemo: language tweak 2016-09-18 10:21:43 -07:00
Getty Ritter
4c528987c7 Strawman implementation of parametric Editor widget
This isn't a fully backwards-compatible change, but the only thing
that needs to be modified for programs involves adding a type parameter,
which will be either `String` or `Text`.
2016-09-07 21:18:24 -07:00
Jonathan Daugherty
f9fc16025b MouseDemo: describe the different drag event cases 2016-06-30 19:28:27 -07:00
Jonathan Daugherty
95b9084bdd MouseDemo: remove old layer functionality to focus on how mouse support works 2016-06-30 19:25:16 -07:00
Jonathan Daugherty
94e3217d5d Add MouseDemo 2016-06-30 19:10:44 -07:00
Jonathan Daugherty
d06004952e LayerDemo: demonstrate a centered top layer 2016-06-10 15:01:28 -07:00
Jonathan Daugherty
29ac664adc Use conditional imports to silence redundancy warnings on GHCs with base >= 4.8.0.0 2016-05-27 11:47:16 -07:00
Jonathan Daugherty
3b604fd5af EditDemo: remove list widget 2016-05-27 11:20:34 -07:00
Jonathan Daugherty
bd95299148 Resolve master merge conflicts 2016-05-19 20:29:12 -07:00
Alan Gilbert
e0f9195737 renaming Data.Vector to avoid ambiguity 2016-05-15 19:34:07 +03:00
Jonathan Daugherty
f3950cf96d API: migrate "lens" usage to "microlens" packages 2016-05-08 18:05:30 -07:00
Jonathan Daugherty
4f0f74b851 API: remove dialogName, dialogNameL, dialog name parameter 2016-03-07 08:52:53 -08:00
Jonathan Daugherty
d3d453737c Make editors focus-aware 2016-03-07 08:25:02 -08:00
Jonathan Daugherty
00eebed6f6 Add Named class, make List focus-aware, add experimental withFocusRing combinator 2016-03-04 15:50:10 -08:00
Jonathan Daugherty
01487b398e edit-demo: use a focus ring 2016-03-04 14:54:43 -08:00
Jonathan Daugherty
3081e7367d Replace "Name" type with custom name type variable everywhere
This experimental change makes it possible to:
* Avoid runtime errors due to name typos
* Achieve compile-time guarantees about name matching and usage
* Force widget functions to be name-agnostic by being polymorphic
  in their name type
* Clean up focus handling by making it possible to pattern-match
  on cursor location names

The change also made many types more heavyweight and in some cases
this is unpleasant when we don't want to have to care about names.
But in those cases we can just use 'n' or '()' depending on how
concrete we need to be.  I'm not yet sure how this is going to play
out in practice.
2016-03-04 14:42:49 -08:00
Jonathan Daugherty
d0cabf95fe edit-demo: support shift-tab to switch editors 2016-02-16 09:18:43 -08:00
Jonathan Daugherty
568df56630 Markup: make markup support multi-line strings (fixes #41) 2016-01-23 15:55:23 -08:00
Markus Hauck
e59559b0d1 Apply hlint hints
- programs/LayerDemo: combine imports
- programs/SuspendAndResumeDemo: redundant do
- programs/ViewportScrollDemo: unused pragma
- src/Brick/Main: redundant do
- src/Brick/Widgets/Center: use fromMaybe
- src/Brick/Widgets/Core: combine imports, redundant do, use >=>
- src/Brick/Widgets/Internals: redundant '$'
- src/Brick/Widgets/List: use fromMaybe
- src/Brick/Widgets/ProgressBar: use fromMaybe
2015-12-09 20:15:09 +01:00
Jøhannes Lippmann
be47eb2a2b Changed ListDemo list type from List Int to List Char, small bugfix.
This might improve the understanding of what is a list item and what
is a position. Also in when running the demo it was possible to create
identical items by removing an element form the middle and adding a
new one (wich got the number (length of list), not (smallest unused
element in list)).
2015-10-22 11:26:51 +02:00
Jonathan Daugherty
1950bc01de Core: remove multiline string and text functions in favor of catch-all versions 2015-08-20 08:36:39 -07:00
Jonathan Daugherty
dc9cee623d Add convenience Brick module and simplify basic demo program 2015-08-19 23:13:07 -07:00
Jonathan Daugherty
fb8dc330bc Types: implement handleEventLensed 2015-08-19 22:26:25 -07:00
Jonathan Daugherty
1671c3732c List: pass the item height to the constructor instead of the draw function to make it available to event handlers 2015-08-19 21:46:55 -07:00
Jonathan Daugherty
0f84d19cdf API: handleEvent now runs in EventM 2015-08-19 19:52:34 -07:00