Commit graph

30 commits

Author SHA1 Message Date
Turo Lamminen
898442b101 Make TXT_NewButton2 label parameter const 2018-03-13 19:33:51 +02:00
Turo Lamminen
4b48cd7f9d Make TXT_NewButton parameter const 2018-03-13 19:33:51 +02:00
Turo Lamminen
44b80b2a7a Make TXT_SetButtonLabel label parameter const 2018-03-13 19:33:47 +02:00
Simon Howard
7ad4a11afa textscreen: Make UTF8 the rule, not the exception.
Rename TXT_DrawString() to TXT_DrawCodePageString() and rename
TXT_DrawUTF8String() to TXT_DrawString(). It's better to just assume
everything is UTF8 and deal with the exceptions, as this is less likely
to cause bugs. There is only a small handful of places where we want to
draw a specific character from the native code page.
2017-01-21 17:15:00 +00:00
Simon Howard
06dd832185 textscreen: Change most strings to UTF-8.
If we are to accept arbitrary labels, window names etc., then it makes
sense for these to be in UTF-8 format rather than strings in the code
page extended ASCII format. This should make the API more interoperable
with other data sources.
2017-01-21 16:21:27 +00:00
Simon Howard
7684ddcfd8 Clean up file headers.
This change rewrites and simplifies the copyright headers at the top
of all source files:

 * Remove "Emacs style mode select" line; this line was included in
   the headers for the originally released source files and appears
   to be to set the file type for old versions of Emacs. I'm not sure
   entirely why it was required but I don't think it is any more.
 * Remove "You should have received a copy of..." text from copyright
   header. This refers to the old 59 Temple Place address where the
   FSF headquarters used to be located and is no longer correct.
   Rather than change to the new address, just remove the paragraph
   as it is superfluous anyway. This fixes #311.
 * Remove ---- separator lines so that the file headers are barer
   and more simplified.
2014-05-05 00:20:54 -04:00
Simon Howard
003c82ce37 Remove some calls to TXT_FGColor by using the new TXT_SaveColors system
instead. Remove the unused "embedded color code" system from TXT_Puts.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2508
2012-03-04 12:06:29 +00:00
Simon Howard
dd52766c7b Rework textscreen focus handling so that input boxes will stop editing
when they lose their focus (thanks Twelve).

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2460
2011-10-23 19:25:55 +00:00
Simon Howard
9f3f6683d9 Change the background color when hovering over widgets.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2320
2011-04-04 20:07:07 +00:00
Simon Howard
56824b130b Replace txt_widget_t#selectable with a callback function to query
whether the widget is selectable. This stops the table code from
selecting things that aren't really selectable - eg. empty tables,
scrollpanes containing unselectable widgets, etc.
Fixes a bug with the warp menu (thanks Proteh).

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2207
2010-12-10 20:31:46 +00:00
Simon Howard
d3d4f6587f Add TXT_NewButton2 for creating a button with a callback (for convenience).
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 673
2006-09-26 23:48:23 +00:00
Simon Howard
e903ecbffb Use NULL for initialising pointers rather than 0.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 644
2006-09-21 11:49:13 +00:00
Russell Rice
6339c4cbeb Fix a lot of warnings (for fussy compilers) and one always-true check
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 641
2006-09-21 11:13:28 +00:00
Simon Howard
7bc72c666d Fix textscreen warnings.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 626
2006-09-19 23:49:20 +00:00
Simon Howard
ef8bdb1fea Add function to set button label.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 614
2006-09-18 22:19:00 +00:00
Simon Howard
c0d6fcfe03 Add missing copyright notices to textscreen and setup files.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 590
2006-08-31 20:40:48 +00:00
Simon Howard
cef6abcea6 Always add a bit of padding inside windows (removes the need to add padding
explicitly in labels). Set the window title from the desktop title. 
Only draw widget selection highlight in the window with focus (top window).

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 560
2006-06-20 18:48:21 +00:00
Simon Howard
ef92ce016e Make mouse button presses on widgets actually do useful things
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 553
2006-06-02 20:14:39 +00:00
Simon Howard
517af9477b textscreen: Rejig how the entire drawing process works. Add a recursive
layout method that assigns the position and size of widgets for the whole
window before drawing. Add another method that responds to mouse button
presses. Allow windows to have no title bar by specifying NULL as the
title.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 547
2006-06-02 19:29:24 +00:00
Simon Howard
59864df095 Fix compiler warnings caused by missing includes.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 517
2006-05-23 11:46:09 +00:00
Simon Howard
7666630775 Eat keypresses when pressing buttons.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 514
2006-05-23 00:05:05 +00:00
Simon Howard
7c18ad6ccf CAST -> TXT_CAST_ARG, UNCAST -> TXT_UNCAST_ARG.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 509
2006-05-22 11:59:11 +00:00
Simon Howard
11643c0887 Add casting macros to allow for easy casts between types.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 503
2006-05-22 00:56:12 +00:00
Simon Howard
283f71d0f5 Add a signals architecture to allow callbacks on GUI events.
Make all widget classes initialise widgets by calling TXT_InitWidget.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 501
2006-05-22 00:20:48 +00:00
Simon Howard
47287b6532 Add missing free() call.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 496
2006-05-20 21:37:34 +00:00
Simon Howard
8741ed0339 Add table class. Allow widgets with heights of more than one line.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 492
2006-05-20 20:49:50 +00:00
Simon Howard
62b5f95367 Add main loop function and forward key presses to widgets.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 490
2006-05-20 16:34:34 +00:00
Simon Howard
1ba69c88d2 Clip windows against the workspace boundaries.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 487
2006-05-20 15:45:36 +00:00
Simon Howard
f761f821f9 Add selectable and visible properties to widgets. Allow the position of
windows to be set based on position of top/bottom/center,left/right,center
coordinates.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 486
2006-05-20 15:15:17 +00:00
Simon Howard
978ddf5398 Initial working text-mode GUI framework.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 480
2006-05-18 18:48:24 +00:00