Commit graph

156 commits

Author SHA1 Message Date
vrld
4eadfee6f4 Merge pull request #13 from ficoos/mouse_override
Allow overriding of the mouse position getter.
2014-06-03 14:12:12 +02:00
Saggi Mizrahi
944a250ec5 Allow overriding of the mouse position getter.
Useful if the ui is positioned behind the camera as opposed as in front
of it.

Signed-off-by: Saggi Mizrahi <ficoos@gmail.com>
2014-05-10 19:11:23 +03:00
hryx
52d06037d1 Added utf8.encode
Here's a function that takes a Unicode code point and returns the corresponding UTF-8 encoded character bytes. Example:

    utf8.encode(0x265c) -- returns '♜'

Please feel free to edit or revert if it's not your style. It might not be relevant to Quickie, though it's a handy UTF-8 utility.
2013-12-31 04:37:04 -08:00
Matthias Richter
b63895a2c7 [utf8.la] Add license, documentation. 2013-12-11 15:55:28 +01:00
Matthias Richter
66a089a07f Fix bug in input.lua, make 0.9-ready, add utf8 editing
1) [input.lua] Pressing backspace while the cursor was at the beggining
   of the text removed the first character. Fixed thanks to riidom.
2) [LÖVE 0.9] Use setLine(Width|Style) instead of setLine. Split
   keyboard.pressed() into keyboard.pressed() and keyboard.textinput().
   (see readme)
3) [utf8.lua] Add support for UTF-8 text editing. May still fail
   spectacurlarly with invalid UTF-8 strings.
2013-12-11 15:25:06 +01:00
Matthias Richter
ffd187dc17 Fix #11: Right click support.
When clicked, Button() and Input() return the respective mouse button
constant ('l', 'r', 'm') instead of just true.
When activated by keyboard, Button() and Input() return 'return'.
Otherwise Button() and Input() return false.
2013-11-04 21:52:36 +01:00
Matthias Richter
935c91f042 Fix #9: Default input style and the scissor state.
Better late than never - thanks Boolsheet!
2013-11-04 21:51:23 +01:00
Matthias Richter
63124bd1fa Remove save_(un)pack 2013-04-08 15:52:20 +02:00
hryx
54f9222990 Default Input style handles long text better
Changes to default-style.lua:
Prevent text from being drawn past bounding box via love.graphics.setScissor().
The cursor and surrounding text are kept in visible range by calculating a draw offset.
2013-03-29 19:01:59 -07:00
hryx
5827cd2527 Only show Input cursor when selected
Previously all Inputs would show the text cursor, which looks odd and makes
it harder for the user to see which one is selected.
2013-03-25 23:49:17 -07:00
hryx
c911165c41 Tweak Slider style
Made a marginally simpler & more readable Slider draw routine using rectangles instead of lines.
Also the ends of the slider "track" are capped now. I split this commit in case a rollback is desired.
2013-03-25 23:37:09 -07:00
hryx
ddd4791e8c Fix vertical Slider
Slider, when vertical, was drawing the grab box with inverted position. Center "track" had incorrect orientation.

Also, slider.lua was passing a bunk table to group.getRect().
2013-03-25 23:15:50 -07:00
Matthias Richter
43265a44ca Fix #7: Pressing return crashes Input.
Add arguments to call of keyboard.pressed() in input.lua.
Add sanity check to keyboard.pressed().
2013-03-24 19:59:27 +01:00
Matthias Richter
ebe0ce2ac0 Fix #8: Misnamed function in mouse.disable() 2013-03-24 19:53:20 +01:00
Matthias Richter
e6d397ef87 Fix #6: Arrow key input on Slider2D widget 2013-03-24 19:53:20 +01:00
Matthias Richter
2c24ba3ca0 Input-widget only fires event when activated 2013-02-06 13:28:23 +01:00
Matthias Richter
7f0689d012 Fix example in readme 2013-02-06 13:27:55 +01:00
Matthias Richter
3cc1581bf4 [Input] Clear focus and key event when pressed return 2013-01-27 11:23:29 +01:00
Matthias Richter
e5c9e7e29f Allow setting custom widget ids 2013-01-23 13:18:58 +01:00
Matthias Richter
f799f48164 Update readme 2013-01-23 13:18:32 +01:00
Matthias Richter
90eb0a9184 Change gui.checkbox interface.
Remove `info' table. The user is responsible for updating the checking
condition. Old style:

	checkbox = {checked = true, label = "foo", align = "left"}
	(...)
	gui.Checkbox{info = checkbox}

New style:

	checked = false
	(...)
	if gui.Checkbox{checked = checked, text = "foo", align = "left"} then
		checked = not checked
	end

Also note that `label' is renamed to `text'.
2013-01-23 12:40:07 +01:00
Matthias Richter
84ac3c2782 Cleanup default style 2013-01-23 12:39:39 +01:00
Matthias Richter
cb553037e7 Fully disable mouse module on mouse.disable 2013-01-23 12:38:26 +01:00
Matthias Richter
c1d743ddbd Add gui.group{arguments-gui.group.push, func}.
Convenience function that wraps func() in a push/pop pair, i.e.

	gui.group{grow=grow, spacing=spacing, size=size, pos=pos, function()
		do_stuff()
	end}

is equivalent to

	gui.group.push{grow=grow, spacing=spacing, size=size, pos=pos}
	do_stuff()
	gui.group.pop()
2013-01-23 12:32:16 +01:00
Matthias Richter
6f46983115 Proper tail recursion in core.save_unpack() 2013-01-23 12:23:10 +01:00
Matthias Richter
faa295651a Add gui.keyboard.getFocus() and gui.mouse.getHot() 2012-12-15 15:58:52 +01:00
Matthias Richter
c85a877dcc Add gui.mouse.disable(), gui.mouse.enable() 2012-10-10 15:21:06 +02:00
Matthias Richter
24c3cc18c5 Rename (dis|en)ableFocus() to (dis|en)able() 2012-10-10 15:20:45 +02:00
vrld
0d85670851 Merge pull request #5 from PierreLu/patch-1
Remove keyboard focus print
2012-09-09 10:43:55 -07:00
PierreLu
9fc7b933eb Remove keyboard focus print 2012-09-09 19:53:49 +03:00
Matthias Richter
d3b1a1c00d Fix #4: keyboard.disableFocus() not working.
Used undefined variable NO_WIDGET to clear keyboard focus.
Same error was made in mouse.lua.
2012-09-03 15:30:17 +02:00
Matthias Richter
fd8664c80a Fix #3 - Thanks martinfelis! 2012-07-30 19:27:04 +02:00
Matthias Richter
fed243a8af Slick default style 2012-05-09 21:29:02 +02:00
Matthias Richter
57861b26fd Delete now obsulete documentation 2012-05-09 21:28:46 +02:00
Matthias Richter
adc7887587 Mega update: Auto layout, code cleanup, api change.
Basically half a rewrite.
2012-05-09 21:27:45 +02:00
Matthias Richter
7b1b6e4176 More documentation 2012-04-12 00:54:06 +02:00
Matthias Richter
44005d0f2c remove unused parameter 2012-04-12 00:53:52 +02:00
Matthias Richter
ff9caa39ca Fix issue #2: init doesn't grab BASE correctly. 2012-04-10 12:40:17 +02:00
Matthias Richter
2fd060184e Add some documentation 2012-03-29 13:56:49 +02:00
Matthias Richter
dff80a6942 Add license header. 2012-03-29 13:55:56 +02:00
Matthias Richter
6de65888dc Externalize widget hit test to style definition. 2012-03-14 16:19:46 +01:00
Matthias Richter
2e5927e963 Add enableKeyFocus (alias to clearKeyFocus) 2012-03-14 16:17:09 +01:00
Matthias Richter
465aaf1885 Add gui.core.(disable|clear)KeyFocus 2012-03-14 14:14:16 +01:00
Matthias Richter
370c10c787 Rename makeTabable() to makeCyclable() 2012-02-22 23:33:54 +01:00
Matthias Richter
d6ed0f9301 Replace keyboard.controls() with generic binding scheme. 2012-02-22 23:29:00 +01:00
Matthias Richter
154c93e0f2 Fix file permissions 2012-02-22 22:56:10 +01:00
mkosler
7cfe7a0c5d Fixed the borked select functionality. Also improved the user interface
for core.keyboard.controls.
2012-02-21 16:05:03 -06:00
mkosler
3a414b52e2 Made changing controls API a bit more understandable 2012-02-21 12:53:18 -06:00
mkosler
d51babb366 Merge branch 'master' of git://github.com/vrld/Quickie.git 2012-02-21 12:50:21 -06:00
mkosler
541145560a Added ability to change controls for tabbable with hacky LOVE quirks. 2012-02-21 12:30:42 -06:00