28 Commits

Author SHA1 Message Date
Charles Dang
e724bdf483 GUI2/Modal Dialog: don't use pop_back to remove window ptr from open window stack
This seems to have been the cause of some crashes and weird behavior with the new command console.
Likely the problem came from the wrong pointer being removed from the ows, but exactly why a modal
dialog was even being opened I don't know.

Still, this is a safer method overall and it guarantees the correct pointer is always removed.
2017-07-31 04:30:13 +11:00
Celtic Minstrel
5d9cd6d485 Fix some hotkeys not working at titlescreen (fixes #1737) 2017-06-11 17:16:00 -04:00
Celtic Minstrel
5d43078ba4 [WIP] Implement IME support for GUI2 textboxes (#1758)
Implement IME support for GUI2 textboxes
2017-06-11 16:47:46 -04:00
Charles Dang
1cec4e6f57 GUI2: removed obsolete comment about mouse wheel events
[ci skip]

Turns out the reason I couldn't make mouse wheels trigger the unhandled event warnings was that SDL2
no longer treats mouse wheels as buttons and no longer sends SDL_BUTTONDOWN events for them.
2017-05-29 12:43:28 +11:00
Andreas Löf
46f16e1a8a Pipe raw SDL events throught the GUI2 event system for hotkeys
This adds support for passing raw SDL events throught the GUI2
event system in order to allow for hotkey creation in the GUI2 hotkey
dialog. The dialog in turn uses the raw SDL event to query the hotkey
subsystem whether it's a suitable event to create a hotkey from or not.

The first suitable event is used to create a hotkey.
2017-04-29 11:39:54 +12:00
Celtic Minstrel
b4dc11ce36 Belated 2017 copyright update 2017-03-19 10:05:38 -04:00
Charles Dang
5ae33e1f02 Revert "GUI2: fixed a bug that's been causing SDL_KEY_DOWN events to be executed twice."
This reverts commit 585ce88d64d609da0500286e56367a510b2ad466. It breaks text input in text boxes. Seems this
isn't the correct fix for this bug. :(
2017-03-16 01:30:55 +11:00
Charles Dang
585ce88d64 GUI2: fixed a bug that's been causing SDL_KEY_DOWN events to be executed twice.
`SDL_TEXTINPUT` events were being handled after `SDL_KEYDOWN` events and calling the same `key_down` codepath,
result in any registered `SDL_KEY_DOWN` callbacks being executed twice, the second time around with null/0 'key'
data.
2017-03-15 22:14:49 +11:00
Charles Dang
51202f86f4 GUI2: further progress on touch event backend implementation 2017-02-10 10:05:46 +11:00
Charles Dang
823d5b423d GUI2: small fixups to touch event backend 2017-02-10 02:13:59 +11:00
Charles Dang
59ee54dd55 GUI2: added some initial framework for touch event handling 2017-02-09 23:51:59 +11:00
Charles Dang
4d4e3b0d74 GUI2/handler: some C++11 updates 2016-11-30 05:44:39 +11:00
Charles Dang
d6f249e3ac Removed use of custom SDL mouse event macros
These no longer seem to be needed, and if they are, a better solution for the issue
outlined in the comments can be come up with.
2016-11-30 05:44:38 +11:00
Celtic Minstrel
1208dfc2cf Address feedback 2016-11-09 20:35:17 -05:00
Celtic Minstrel
c09125096b Rename GUI2 widget classes to drop t- prefix 2016-11-09 01:27:30 -05:00
Celtic Minstrel
8c929585aa Rename core GUI2 types to drop t- prefix 2016-11-09 01:24:25 -05:00
Celtic Minstrel
90ba2affcf Rename tpoint -> point 2016-11-09 01:15:15 -05:00
Charles Dang
c3eb503c6e GUI2: fixed floating labels drawing over dialogs when tooltips are displayed (bug #22176) 2016-10-19 22:26:40 +11:00
Gregory A Lundberg
6ef5085006 Minor style changes per @jyrkive 2016-10-16 10:56:58 -05:00
Gregory A Lundberg
86adfc47f8 GCC complains about float/double and useless cast 2016-10-16 10:55:09 -05:00
Jyrki Vesterinen
af733360a8 Fix a bunch of MSVC2015 compiler warnings about hiding declarations
This commit still doesn't fix all of them. I decided to leave alone
cases where variables with the same name are assigned in multiple
conditions of the same if...else if...else statement, and cases where a
scope logging macro is used multiple times in the same scope. In any
case, this commit greatly reduces the warning count on MSVC2015 and makes
new warnings much easier to spot.
2016-10-06 00:11:56 +03:00
Charles Dang
1fb26d9e1c Convert remaining SDL1.2 defines to their SDL2 counterparts and dropped compat layer 2016-09-15 15:55:09 +11:00
Charles Dang
ddc8d84c06 Made tpoint default-initializeable and cleaned up its uses 2016-08-15 11:34:17 +11:00
Charles Dang
1bb78a18f1 Expanded use of GUI2_SHOW_UNHANDLED_EVENT_WARNINGS guard 2016-08-05 10:31:11 +11:00
Charles Dang
7538142719 Hide GUI2 unhandled event warnings behind a define guard 2016-07-29 01:59:19 +11:00
Celtic Minstrel
982394fe3a Remove custom FOREACH macro in favour of range-for 2016-04-01 12:08:05 -04:00
Celtic Minstrel
3ac7f8d970 NULL -> nullptr
A few cases of NULL were missed, since changing them led to errors
(Mainly instances where it was passed to a boost::function)
2016-03-31 00:42:38 -04:00
Celtic Minstrel
6307b9459c Move most of gui/auxiliary to gui/core to reflect its true nature 2016-03-20 23:18:48 -04:00