44 Commits

Author SHA1 Message Date
Ignacio R. Morelle
d6a3de1938 Apply patch #2213 by stikonas, using file #11274 2010-11-21 01:56:29 +00:00
Guillaume Melquiond
eeb047de55 Fixed file headers so that they match the content of the COPYING file. 2010-09-01 21:12:38 +00:00
Mark de Wever
b2b64014ef Remove an accidentally committed function. 2010-04-25 08:56:37 +00:00
Mark de Wever
f1733385a3 Change the key peek function to a signal handler. 2010-04-25 08:56:30 +00:00
Mark de Wever
98a95e914b Add a missing access specifier. 2010-04-24 13:58:33 +00:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Mark de Wever
88a1069ee1 Remove code disabled with GUI2_OLD_EVENT_HANDLING 2009-11-13 19:18:35 +00:00
Mark de Wever
0788c3d81e Create new events for getting and losing focus.
Uses the new notifications to send the events, this means only the
widget getting or losing the focus gets the event not it's parents.

Also comment out the old code to handle mouse focus.
2009-10-10 15:36:37 +00:00
Mark de Wever
207ae7c28b Disable old event handling code. 2009-10-04 06:10:46 +00:00
Mark de Wever
d4a058fcc0 Enable the middle mouse button for the textwidget. 2009-10-03 17:51:56 +00:00
Mark de Wever
06e3b3fa96 Add new keyboard event handling. 2009-10-03 10:39:28 +00:00
Mark de Wever
130e8d7cf9 Initialize all members. 2009-08-30 13:42:17 +00:00
Mark de Wever
671b0b256c Strip trailing whitespace. 2009-08-29 18:46:38 +00:00
Jörg Hinrichs
6093d40a23 Provide ttext_ with a text_changed event to be able to grab...
...the text of a textbox after it got changed by keystrokes.
2009-07-14 19:16:52 +00:00
Mark de Wever
4613a2f5ac Update comment and set the handled flag properly. 2009-07-10 21:01:57 +00:00
Tomasz Śniatowski
d6dcef068c Add gui2::ttext_ key press callback 2009-07-10 21:20:54 +01:00
Mark de Wever
8b31dec40d Remove the old easy block algorithm code. 2009-06-21 14:08:29 +00:00
Ignacio R. Morelle
d94c66f307 You Fail at Copy-Paste, part 3 (the Prequel!). 2009-04-12 23:49:13 +00:00
Gunter Labes
c34314a915 typo fix 2009-03-09 09:02:02 +00:00
Mark de Wever
fecdb7660c Expose more parts of the ttext_ member.
This is needed to have more control over where to place the ellipse.
2009-03-08 18:01:47 +00:00
Mark de Wever
19fc6b8d4b Changed the textbox history.
The textbox history now uses CTRL+TAB and CTRL+SHIFT+TAB so the arrow
keys are no longer overloaded. It would be nice to make these keys
configurable, but that will be postponed until post 1.6.
2009-03-01 10:38:50 +00:00
Mark de Wever
9efa34b263 Implement the keyboard focus for the text widget.
Now it should be clear which widget has the keyboard focus.
2009-02-10 19:47:39 +00:00
Thomas Baumhauer
798e0a1001 Added a textbox widget that displays its input as stars to be used...
...in the mp login dialogs.
2009-01-15 17:38:23 +00:00
Mark de Wever
15f8094adb Fix a comment copy paste error. 2009-01-03 21:39:53 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Mark de Wever
bdd600d006 Remove trailing whitespace. 2008-12-25 14:52:20 +00:00
Mark de Wever
cbac265dfb Add the easy close feature to the new widgets.
The easy close feature closes windows by a single mouse click, without
the need for a close button. Also converted the test dialog for the
remove addons to use this feature and commenting out the button in the
config (it will be needed later again).
2008-10-31 18:45:33 +00:00
Pauli Nieminen
715b7d031b Fixed signed/unsigned comparision warnings 2008-09-11 12:34:33 +00:00
Mark de Wever
585fe35df7 Implemented the maximum length for a text.
The maximum length got implemented in font::ttext instead of the
gui2::ttext_ class since that simplified the length checks to one
location. Also add return values to indicate what happened upon
insertion. Added the maximum length to the user name in the mp selection
dialog.
2008-09-02 18:05:13 +00:00
Mark de Wever
45ebc2acf0 Avoid the text box text overflow termination.
When the text was too long the cursor would be drawn out of bounds which
caused an assert which terminated Wesnoth. Now the text will no longer
be drawn out of bounds and be ellipized. (The ellipses are always drawn
at the end, which will be fixed later.)
2008-08-30 15:17:58 +00:00
Mark de Wever
f052bdb6b3 Load the font info for the text box.
This avoids the cursor to be at the wrong offset it the default isn't
the default font.
2008-08-29 17:19:01 +00:00
Mark de Wever
5c1fe9bec3 Let the text widget use a font text object.
With this change a lot of helper code can be moved to pango. This is
also required since the text size between pango and the old SDL_TTF
library might differ. Also fixes some crashing bugs when special
characters were used in the text boxes.
2008-08-27 16:43:54 +00:00
Mark de Wever
4ad1d1c5d2 Cleanup.
Removed some direct access to member via a non const reference.

Renamed sel_len to selection_length and sel_start to selection_start.
2008-08-26 22:20:47 +00:00
Mark de Wever
d4f8cc7021 Code and comment cleanup. 2008-08-16 10:28:47 +00:00
Mark de Wever
6a5e2af2d2 Mark a parameter const. 2008-08-14 19:11:13 +00:00
Mark de Wever
806b0bf7e7 Renaming to make some names more generic:
ttext_::get_text() to ttext_::get_value()

ttext_::set_text() to ttext_::set_value()
2008-07-24 16:33:20 +00:00
Mark de Wever
8a34fb1a55 Make some parameters const. 2008-07-16 17:18:28 +00:00
Mark de Wever
a6a82d0050 Remove the double underscores from the inclusion guards, spotted by ilor. 2008-05-25 12:34:06 +00:00
Mark de Wever
1062758361 Fix small typo. 2008-05-01 06:44:21 +00:00
Mark de Wever
07df021d5b load_config() should be called in the constructor. 2008-04-29 17:18:33 +00:00
Mark de Wever
174966c394 Implement the different copy buffer...
...for mouse selection and keyboard copy under X11 systems. The old
widget library doesn't use it the new one does.
2008-04-27 15:09:20 +00:00
Mark de Wever
dae63c82da Add some debug info.
Fix a bug where every click was a left click.

Middle click in a text box now pastes on UNIX systems.

Pasting only works withing Wesnoth.
2008-04-27 08:55:31 +00:00
Mark de Wever
3db4fddac8 [[Mouse and select improvememts]]
* Added code allow the mouse the click in a text and set the cursor at the 
  proper location.

* Added the selection indication.

* Added mouse dragging to select a range.

* Mouse double click selects all (doesn't work due to bug in event code).

* ctrl-C, ctrl-X and ctrl-P do copy paste (doesn't work yet on Mac).

* On UNIX based sytsems select does copy (middle mouse paste doesn't work yet).

* Fixed some minor bugs.
2008-04-20 11:08:34 +00:00
Mark de Wever
dac9c4af2e Move ttext to its own file. 2008-04-19 07:13:08 +00:00