Commit graph

39 commits

Author SHA1 Message Date
Simon Howard
f0d613f188 textscreen: Remove superfluous first_widget param.
This avoids a warning from doxygen about the fact that the parameter
is undocumented. Since it's not necessary anyway, it can just be
removed.
2018-12-26 13:58:58 -05:00
Simon Howard
1d2fe63a94 textscreen: Add TXT_MakeTable().
When creating a table widget is is often convenient to be able to create
and populate it in a single function call. It's possible to do this with
"horizontal boxes" already but there wasn't a more generic mechanism for
making a table. So add one as TXT_MakeTable().
2017-01-25 21:08:53 +00:00
Fabian Greffrath
71cc7a163d Fix warning: variable ‘widget’ set but not used 2015-11-17 17:33:13 +01:00
Jonathan Dowland
0b27583c5c Add constraint check to CellOverflowedSize
Fixes #585.
2015-07-22 10:08:16 +01:00
Simon Howard
41f216bc13 textscreen: Fix struct initializers.
I think this is valid ANSI C, but it seems to cause problems with MSVC
compilation. As the initializer isn't strictly necessary, let's just
get rid of it.
2015-07-11 17:39:38 -04:00
Simon Howard
6878629637 textscreen: Allow cycling through tables with tab key.
Most GUI toolkits allow using the tab key to cycle through windows, so
support this (and shift-tab to cycle backwards) just for completeness.
2015-07-11 17:13:20 -04:00
Simon Howard
1cab001bfe textscreen: Fix separator special case handling.
The table widget has special case handling for separator widgets, but
this doesn't work if the window the separator is being added to has
more than one column. Now that multiple columns are permitted, improve
how separators are handled in a way that is convenient.
2015-07-10 01:20:08 -04:00
Simon Howard
c754eaf364 textscreen: Add TXT_SetTableColumns() function.
It's common to want to divide a window into columns, but this has
until now only been possible by adding an inner table with multiple
columns. To simplify laying out windows, this function allows the
number of columns in a window (or any table) to be changed after it
is allocated.
2015-07-10 01:18:23 -04:00
Simon Howard
e365e664d7 textscreen: Add further table conveniences.
Add TXT_TABLE_EMPTY to work around the inability to add a NULL cell
using TXT_AddWidgets(), and TXT_TABLE_EOL to immediately start a new
row, padding appropriately.
2015-07-09 02:19:02 -04:00
Simon Howard
5da27e00a5 textscreen: Add table cell overflowing.
It's a common pattern in the setup tool that widgets are laid out in
a grid, except there inevitably end up being widgets that do not
conform to this grid. This become ugly to code around, as it ends up
requiring packing tables inside tables to get the desired result, when
all that is really wanted is a widget that can take up more than one
cell in the table. Overflowing allows cells in the table to be
designated as "overflows" of neighboring cells, to facilitate this.
2015-07-09 01:51:05 -04: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
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
eac4192d1b Fix crash.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2322
2011-04-04 20:12:59 +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
ec81c27ef5 Allow PGUP/PGDN to scroll up and down in scroll panes (thanks
LionsPhil).

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1631
2009-08-27 23:27:47 +00:00
Simon Howard
39b7cb7bb2 Fix layout of widgets within scroll panes. Scroll scroll panes in
response to keyboard events.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1440
2009-01-30 23:53:47 +00:00
Simon Howard
65ed2a3208 Update chocolate-setup to the new screen mode config system.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1042
2008-02-04 22:43:11 +00:00
Simon Howard
7216263bb7 Shut up compiler warnings
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 695
2006-10-11 23:03:19 +00:00
Simon Howard
0755f5ac88 Add TXT_AddWidgets for adding multiple widgets to a table.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 672
2006-09-26 23:47:27 +00:00
Simon Howard
c083656d0e Convenience function for creating a horizontal box.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 659
2006-09-24 13:07:30 +00:00
Simon Howard
0cff90defc Fix some warnings in textscreen code.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 645
2006-09-21 16:25:10 +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
3dd7131d41 Check column is valid when finding a selectable column. Fixes weird
scrolling behavior.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 620
2006-09-19 21:13:56 +00:00
Simon Howard
e558fa3f2d Fix TXT_SelectWidgets with NULL spacers.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 615
2006-09-18 22:19:30 +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
7cd8727f6c Add TXT_SelectWidget function to select a widget in a table,
TXT_SetColumnWidths to set table column widths. Don't send key presses
to unselectable widgets.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 573
2006-08-31 18:09:34 +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
b3e5170bbb Add ability to make widgets right aligned or centered within tables.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 546
2006-05-29 21:39:12 +00:00
Simon Howard
1531993b05 Allow struts to force height as well as width. Hide "start game" button
for players which are not the game controller.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 541
2006-05-29 19:54:11 +00:00
Simon Howard
42ebb5bebb Allow NULL to be added to tables to specify a spacer (empty cell).
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 530
2006-05-25 21:27:34 +00:00
Simon Howard
1de18c1397 Add window action class for action area labels at the bottom of windows.
Adjust txt_table_t to expand tables to their maximum width when they
only have one column (ensures separators reach the window edges).

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 515
2006-05-23 00:07:02 +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
9908aee502 Initialise the table selection on table creation.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 498
2006-05-21 20:56:28 +00:00
Simon Howard
9ba105fa4e Always select a valid widget in a table before drawing the table.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 497
2006-05-21 00:07:11 +00:00
Simon Howard
56912a4dcc Make all windows be tables with one column.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 493
2006-05-20 21:01:04 +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