1
0
Fork 0
Commit graph

515 commits

Author SHA1 Message Date
mfranz
7512553a9a don't reset list to top after having changed a value 2006-05-18 12:51:32 +00:00
mfranz
6d24d7496e Ctrl-Click on bool entry toggles property 2006-05-18 12:12:10 +00:00
mfranz
5a38a9d071 - undefine PUCLASS_LIST, as we have our own (old_warning--)
- PropertyObject: remove additional "values" member again
- don't create entry lists for <list>, <select>, and <combo> at dialog
  creation and delete them on dialog close, but let a separate class
  fgValueList handle this. The three widgets are now subclassed and the
  derived widget lets fgValueList manage the lists
- make <select> consistent with <list>. This breaks backwards
  compatibility, but not a single dialog in fgfs uses it and did so
  since ... forever. (Shoot me!)

Rationale: now that dialogs are a bit more dynamic than they used to be
(thanks to embedded Nasal), we have to delete and recreate entry lists
during dialog use. Deleting only at dialog closing doesn't cut it anymore.
Especially list widgets that are updated several times per second would
use up a lot of memory otherwise. The route-manager doesn't update that
often, but it did already leak. One TODO less.  :-)
2006-05-16 12:45:38 +00:00
fredb
b30d903a56 Use puAux widgets available in plib 1.8.4 instead of using pui deprecated widgets now removed from CVS 2006-05-14 09:03:50 +00:00
mfranz
d409d5dbbe add "signals" for start and end of screenshot capturing. Like the other
signals, this is meant for attaching listeners. The ufo will use that to
hide/reveal the status line in screenshots. The following signal properties
are now available:

  /sim/signals/exit       ... set to 1 right before quitting
  /sim/signals/reinit     ... set to 1 on re-init  (Shift-Esc)
  /sim/signals/screenshot ... set to 1 before and to 0 after screenshot
  /sim/signals/click      ... set to 1 after mouse clicks at terrain, signalling
                              that the geo coords in /sim/input/click/ were updated
2006-05-09 09:39:28 +00:00
mfranz
95a97dbee4 remove obsolete menu functions 2006-05-08 15:00:10 +00:00
mfranz
30a38b2c3a remove obsolete fgcommands 2006-05-08 14:56:46 +00:00
mfranz
f9959b7f2c - move auto_gui's addWaypoint to routemgr.cxx
- add command interface property (monitored by listener)
- remove all traces of auto_gui.[ch]xx
- remove some trailing spaces, fix indentation
2006-05-08 14:35:29 +00:00
mfranz
ff52ed5072 add an optional property node pointer to ObjectProperty. This is currently
only used by the <list> widget. It allows to "dialog-update" the list,
which rescans the <value> children and redraws the list widget with new
contents. The old contents are only freed at dialog close, which should
eventually get changed.
2006-04-28 15:55:41 +00:00
mfranz
5b1dd6c8ae empty names aren't names 2006-04-28 12:56:11 +00:00
mfranz
ce8e28f1f5 what about using the right variable? 2006-04-28 12:14:23 +00:00
mfranz
29ff85142b - merge FGDialog::{update,apply}Value{,s} ... there's really no need to have
two almost identical functions for these methods. It only forces to repeat
  the redundancy for every small change to either.
- abstract out generation and destruction of plib string arrays
- abstract out generation of lists from <value> children
2006-04-28 11:49:11 +00:00
mfranz
eb19c2650d newgui.[ch]xx: implement FGDialog *NewGUI::getDialog(cont string&)
fg_command.cxx: add possibility to "dialog-apply" or "dialog-update"
                an arbitrary active (= open) dialog or widget
2006-04-28 10:27:54 +00:00
mfranz
ca46e8d5d5 rename NewGUI::getDialog() to NewGUI::getDialogProperties()
getDialog wrongly implies that it returns an FGDialog, and we might later
need a real getDialog.
2006-04-28 09:59:31 +00:00
mfranz
52306b9093 add optional SGPropertyNode* argument to NasalSys::createModule. This is
used in dialog.cxx to allow XML dialogs access to their own prop tree via
Nasal's cmdarg(). That way dialogs can generate dynamic content, such as
list entries.
2006-04-27 15:56:51 +00:00
mfranz
e354b810fa - work around plib bug that crashes fgfs if no airport was found (empty
list) and the arrows are clicked  (patch sent to plib; workaround it to
  be removed once fgfs officially depends on a plib version that includes
  the fix)
- fix (very unlikely) crash in case the widget is redrawn between list
  destruction and setting of the new list.
2006-04-18 15:21:19 +00:00
mfranz
2e7cab820b make headers include headers they depend on, don't rely on the c(xx)
file to do that. (This is a requirement for header precompiling.)
2006-04-17 13:40:20 +00:00
mfranz
fe78690623 allow to not only set a general widget <color>, but also specific element
colors:  <color-{{back,fore}ground,highlight,label,legend,misc,editfield}>
<input-misc>, for example, sets the input field cursor color, <input-legend>
the input field text color. (This feature was always planned as part of the
'theming' capabilities, and most code is already in place. Only this line
was apparently fogotten. :-)
2006-04-14 10:17:09 +00:00
mfranz
86d606f87a <input> elements that are <live> always update their input field from the
<property>, except if they are activated, in which case the user input
should, of course, not get overwritten. But if such an input was active and
the user selected a different widget, then its contents were dropped.
Fix that by setting the "DownCallback" for live input fields.
2006-04-03 15:00:33 +00:00
mfranz
bff4c3fe22 support filtering to show only a subset of entries 2006-03-31 10:17:43 +00:00
fredb
0abca6be34 Don't restore initial screen geometry because there is nothing in fg_os* to resize an existing window.
Old behavior was to just resize the GL viewport, which doesn't necessarily match the fg window size.
2006-03-30 20:37:34 +00:00
mfranz
8d9f8e5761 - don't crash if user clicked "Apply" but hasn't selected an airport
- re-order information from  "LOXT  Tulln"  to  "Tulln  (LOXT)".
  The list is sorted by airport name and columns aren't aligned, so this
  looks way cleaner.
2006-03-25 08:47:53 +00:00
mfranz
651db1845b - make aircraft list no longer stick out from its dialog box
- cosmetics: consistent coding style (and "if" is not a function :-)
2006-03-25 07:45:50 +00:00
mfranz
bf53d2b117 - set size, otherwise the widget doesn't expand to the size that the layouter
found desirable
- set slider width default correctly (parentHeight? Huh?)
2006-03-23 23:02:48 +00:00
mfranz
b650e86e74 - implement setSize(): We can't just use puObject::setSize() -- we do, of
course, have to re-layout all sub-widgets on resizing
- make slider size configurable, like it's done for the close relative
  puLargeInput
2006-03-23 23:00:31 +00:00
mfranz
d6af5da0a8 - abstract out box slider width (should probably be settable)
- reduce it to 20 (30 is excessive and didn't match the property brower look)
- call puSlider with this size explicitly (otherwise its size is derived
  from the font size, unlike the arrow buttons!)
2006-03-23 19:51:38 +00:00
mfranz
2726cda057 make puList actually useful: call back on list entry selection.
(again: I'll submit all the changes to plib's puaList as soon as
possibe. Just needs a few more fixes first ... :-)
2006-03-23 19:03:31 +00:00
mfranz
a7bab83cc8 make puListBox inherit puList colors (otherwise the GUI style isn't
respected, and black text on dark grey is a bit hard to read).
TODO: - submit that for inclusion in plib's puAuxList
      - drop custom version and use plib's (after 0.9.10)
2006-03-23 17:44:10 +00:00
mfranz
a04aad7a99 puList.cxx: _list_box->getIntegerValue() returns -1 as long as no list
entry was selected. Return 0 in this case, not an invalid string address
  (causing segfaults).
dialogs.cxx: don't set property if no list entry was chosen.
2006-03-22 10:56:49 +00:00
mfranz
9604277484 create /sim/gui if it doesn't exist 2006-03-19 07:10:10 +00:00
mfranz
e4f08637f7 move gui styles from /sim/gui[n] to /sim/gui/style[n] to make /sim/gui
free for other gui related properties
2006-03-09 23:04:41 +00:00
mfranz
b0b5c2dda9 remove useless test 2006-03-08 20:23:31 +00:00
mfranz
2de4fd5d8e add support for <nasal> blocks <open> and <close> in XML dialogs:
<nasal>
      <open>print("I'm called on dialog open")</open>
      <close>print("I'm called on dialog close")</close>
  </nasal>

All Nasal runs in a dialog namespace, so that variables and functions
defined in the <open> block can be used in <binding>s, etc. This is
especially useful for <radio> button handling. See "location-in-air.xml".
2006-03-08 10:44:46 +00:00
mfranz
ef70c9cf41 backspace accelerator 2006-03-01 14:26:17 +00:00
mfranz
c9813d1b5d new FSF address 2006-02-21 01:16:04 +00:00
mfranz
dc1cf77804 make sure the dialog property tree can't disappear until we wrote the
last position back
2006-02-19 08:48:30 +00:00
fredb
36e4045810 Add missing include files needed by the new math code under windows 2006-02-18 13:58:09 +00:00
mfranz
f5469ba9fe only user specified negative coords are interpreted as relative to the upper
right corner, not those that are result of centering a dialog if no x/y are
given. This centers screen.log messages correctly. But maybe we have to
rethink that special meaning of negative coords altogether.
2006-02-12 19:43:53 +00:00
mfranz
e51cd8eaf5 make room for more font specifications in style files 2006-02-04 13:06:47 +00:00
mfranz
aec1d580c2 on closing a dialog write the last position back, so that the caller can
open it there again next time
2006-01-29 21:21:56 +00:00
mfranz
129813e0aa set the /sim/signals/reinit property on reinit, so that aircraft code can
attach listeners. Other relevant stuff should go here, too. (/sim/crashed
could be one.)
2006-01-29 16:20:31 +00:00
mfranz
cabf53537a allow top level <font> definition that applies to text in the whole dialog
and makes the layouter use this font's metrics
2006-01-27 12:57:13 +00:00
mfranz
54ee68291b fonts are now delivered by FGFontCache (except for the splash screen,
because this comes way before the gui subsystem is ready)
2006-01-27 08:01:31 +00:00
mfranz
f729ec6013 cosmetics 2006-01-26 22:22:37 +00:00
mfranz
e2016f9568 fix FGFontCache and make use of it (this allows to assign bitmap fonts
in dialogs)
2006-01-26 21:40:37 +00:00
ehofman
619226e9d0 Integrate a large part of John Wojnaroski's 747 cockpit project.
Erik Hofman:
This patch contains an update to net_ctrls.hxx that adds an extra 100 bytes
(or an equivalent of 25 (u)int32_t types) of reserved space. This could be
used to make the protocol forward and backward compatibel within a certain
scope. Be sure to read the instructions at the begining of the header file
when addinf new variables.
2006-01-20 17:19:01 +00:00
ehofman
fcfe5d2010 Don't display the menubar in e highres screenshot. 2006-01-11 10:53:04 +00:00
ehofman
0b3164c312 Try to prevent a potential buffer overflow for WIN33. 2006-01-04 13:25:56 +00:00
mfranz
f6225f5cb7 remove a few unused vars
menubar: cosmetics of the day
2005-12-15 20:07:14 +00:00
mfranz
98081d9243 don't check for subsequent indices (n), but for child positions; This way
it's also possible to enable/disable menu/item entries with higher numbers.
This can be useful for adding entries from other config files (aircraft
specific or local). I'd say aircraft files can use indices starting with
[100] and local files starting with [1000]. Such high number will never
collide with an entry in menubar.xml, even if entries are added/removed
there.
2005-12-14 07:45:47 +00:00
mfranz
688bcb579f final cosmetics (s/_entries/_objects/ and comments) 2005-12-09 10:43:09 +00:00
mfranz
1990db9ca5 yet more cleanup; clearer warning messages 2005-12-06 21:03:15 +00:00
mfranz
c10f583c11 removal of yet more stuff, left over from development; further simplification;
requires to remove some constness, though (we are adding listeners!);
If I continue like that, nothing will be left.  :-)
2005-12-06 19:51:31 +00:00
mfranz
eb68e9ad36 remove two checks that were only useful during development; fix typo 2005-12-06 18:46:39 +00:00
mfranz
ac2c1fcd43 allow disabling/enabling of menu entries via "enabled" property;
Unfortunately, we don't have an easy way to access the puObjects
only by knowing the respective XML property node, because the
menu structure was built by plib from string lists. That's why
we walk the puMenuBar tree and store {property node}->{puObject*}
pairs in a map. With this infrastructure in place we can now
easily enable/disable entries, but we can also make other changes
to menu buttons as we see need. The structure of puMenuBar is
described in the pui documentation, so it's less of a hack than
it looks.  :-)
2005-12-06 17:56:17 +00:00
mfranz
8d681fd6de "nine" (via IRC):
don't crash if gui subsystem isn't available yet
2005-11-12 11:40:57 +00:00
mfranz
5299ab0304 distinguish editable and non editable textboxes; the former will usually
be colored like input fields, while the others will be colored like normal
text
2005-11-09 18:23:55 +00:00
mfranz
feb555b087 prepare for pending plib change: set combobox/selectbox input field colors
to other color than "Yeukky Pink"; #undef'ed for older plib versions; plib
patch will be made available in case fgfs 0.9.9 is released before plib 0.8.5
2005-11-09 17:59:53 +00:00
mfranz
cff9e51840 reinit(): destroy, reload and re-open dialogs (menu: Debug -> GUI Reload)
redraw(): redraw gui without distroying dialogs (fgcommand "gui-redaw"/Shift-F10)

This change makes sure that Nasal-generated and dynamic dialogs can be
re-opened correctly when cycling through themes.
2005-11-09 17:16:59 +00:00
mfranz
571939e58d replace hard-coded HUD config dialog with NewGUI dialog 2005-11-09 10:47:40 +00:00
mfranz
c6a1ba7f97 don't destroy iterated map entries; delete _menubar; restore closed
non-nasal dialogs
2005-11-08 18:18:55 +00:00
mfranz
4cc3beff42 Don't use the [] notation here to test for the existence of a map member,
because this creates an empty entry if it didn't exist. This made the
activation of the dialog mandatory before the next gui subsystem update()
happened. Otherwise fgfs segfaulted.
2005-11-08 11:05:50 +00:00
mfranz
e4929c1dc1 interpret negative dialog <x> and <y> coordinates as distance from the
right/upper screen edge (analogous to the --geometry spec), assuming
that we never want to draw outside the screen area; for this to work
we need to write the original x/y coords back to overwrite the absolute,
positive values that the layouter stored there
2005-11-06 23:53:30 +00:00
mfranz
63f5947afc backing out all changes to non-depreciated symbols/functions: plib's cvs
isn't tagged, so we can't easily say what was added after the last stable
release
2005-11-06 14:27:17 +00:00
mfranz
47f90a7976 backing out all changes to non-depreciated symbols/functions: plib's cvs
isn't tagged, so we can't easily say what was added after the last stable
release
2005-11-06 14:22:02 +00:00
mfranz
2aceb0e63f PUCLASS_LIST is already defined in <plib/puAux.h>. 2005-11-06 13:38:21 +00:00
mfranz
30f5e63f81 implement <key> property for key names: <keynum>27</keynum> == <key>Esc</key> 2005-11-05 18:41:43 +00:00
mfranz
e7d2718e15 switch from depreciated pui functions to the "new", supported ones
(OK'ed by Curt)
2005-11-05 09:51:01 +00:00
mfranz
533201c7a0 replace depreciated plib symbols with their new forms 2005-11-04 22:20:35 +00:00
mfranz
7f3cd89be5 return correct input object 2005-11-03 20:15:05 +00:00
mfranz
add06e613d cleanup 2005-11-02 13:52:01 +00:00
mfranz
fd5ed5a8fa allow to trigger widgets via accelerator key, which is defined via "keynum"
property (e.g. <keynum>49</keynum>). The numbers are the same as in
keyboard.xml. (Could later be replaced/enhanced with <key>Ctrl-a</key>
notation.) This does, of course, only work for widgets with assigned
bindings.
2005-11-02 13:11:19 +00:00
ehofman
029dda3297 In the process of changing, adding and removing files the last few years
there was the situation where four directories contained jst two files,
of which three directories were aircraft related, and one directory contained
test code from Curt that might be better of in SimGear anyhow.

This is just a patch to move a bunch of files to new locations. In case of
local changes to any of them you can do the following:

move replay.[ch]xx from src/Replay to src/Aircraft
move control.[ch]xx from src/Control to src/Aircraft
move ssgEntityArray.[ch]xx from src/Objects to simgear/screen

In addition it has been decided only to use .[ch]xx files in all directories
unless it's contained within an FDM specific directory, in which case the
author is free to do whatever (s)he wants.

In this repspect the following files have been renamed in src/Multiplayer:

tiny_xdr.[ch]pp has become tiny_xdr.[ch]xx
multiplaymgr.[ch]pp has become multiplaymgr.[ch]xx
2005-11-01 13:41:49 +00:00
mfranz
ec2ff6ae50 We never want to know if a dialog is there or not. If we ask for one and
it isn't there, this is a bug. Thus centralize the error message so that it
doesn't have to be repeated everywhere. Of course, the calling code should
still consider that a returned property node may be 0.
2005-10-22 16:51:27 +00:00
ehofman
12fc19080b Ima Sudonim:
CygWin/gcc-3.4.4 updates.

I replaced my cygwin compiler with 3.4.4, did a make clean of plib, simgear,
and flightgear, then did a make install of all three. With the included changes,
everything builds fine, and runs fine.
2005-10-22 11:22:05 +00:00
mfranz
08744c015f - spelling
- write file name in quotes
2005-10-21 19:34:51 +00:00
mfranz
affa6b8a38 Fix <text> alignment. Because our <text> widget is an empty puObject's
label, we need to compensate for the gap in-between: PUSTR_RGAP (pu.h).
Without that, all text appears shifted right.
2005-10-21 18:50:58 +00:00
mfranz
58179758af add support for a <hide> property, which hides whole XML groups (widgets
or data blocks) from layouter and dialog creator. This is required for
dynamically generated/modified dialogs. Parts in the XML file can be
hidden and turned on by the C++ code. Other hidden parts can be used
as templates that are multiply used. Hidden datablocks can contain
strings that are used in dialog context, that are easier to translate
or modify in the XML file.
2005-10-21 17:47:48 +00:00
mfranz
8e1ae97d3d Replace hard-coded message boxes by ones managed by the gui subsystem.
Remove obsolete functions.
2005-10-20 13:05:02 +00:00
mfranz
685076e9ce Add method to get the property root node of named dialogs. This is
necessary to edit dialog contents from C++, and will allow us to
finally let all the hardcoded dialogs be handled by the "gui"
subsystem.
2005-10-20 11:15:00 +00:00
andy
37b9a23122 Must include config.h before plib headers to prevent them from default
to glut (which breaks SDL builds).
2005-10-19 18:40:19 +00:00
ehofman
dafa6ced1b Mathias Frhlich:
I have done a valgrind run in flightgear. Just start it up and close it at the
fist change I had about half an hour later.

source-leak.diff:
   Also two minor ones, but leaks ...
2005-10-14 16:25:14 +00:00
ehofman
1c3e2d4942 Vivian Meazza:
This adds a TACAN instrument to the inventory. Range and bearing are calculated
to the TACAN or VORTAC beacon selected by means of the Channel Selector in the E
quipment/Radio pull-down menu.

A TACAN beacon has also been added to the aircraft carrier Nimitz (channel #029Y
).
2005-10-01 09:56:53 +00:00
curt
0bb1494452 David Luff:
Attached is a patch to the airport data storage that I would like committed
after review if acceptable.  Currently the storage of airports mapped by ID
is by locally created objects - about 12 Meg or so created on the stack if
I am not mistaken.  I've changed this to creating the airports on the heap,
and storing pointers to them - see FGAirportList.add(...) in
src/Airports/simple.cxx.  I believe that this is probably better practice,
and it's certainly cured some strange problems I was seeing when accessing
the airport data with some gps unit code.  Changes resulting from this have
cascaded through a few files which access the data - 11 files are modified
in all.  Melchior and Durk - you might want to test this and shout if there
are problems since the metar and traffic code are probably the biggest
users of the airport data.  I've also added a fuzzy search function that
returns the next matching airport code in ASCII sequence in order to
support gps units that have autocompletion of partially entered codes.

More generally, the simple airport class seems to have grown a lot with the
fairly recent addition of the parking, runway preference and schedule time
code.  It is no longer just an encapsulation of the global airport data
file, and has grown to 552 bytes in size when unpopulated (about 1/2 a K!).
 My personal opinion is that we should look to just store the basic data in
apt.dat for all global airports in a simple airport class, plus globally
needed data (metar available?), and then have the traffic, AI and ATC
subsystems create more advanced airports for themselves as needed in the
area of interest.  Once a significant number of airports worldwide have
ground networks and parking defined, it will be impractical and unnecessary
to store them all in memory.  That's just a thought for the future though.
2005-09-20 20:26:57 +00:00
ehofman
e4390aac42 Perhaps it's better to compare the contents of the strings instead of comparing the pointers. 2005-07-18 11:55:39 +00:00
ehofman
0666590909 Fix a segmentation fault when switching to a new style and selecting a new dialog. I still need to find out why getColor doesn't work properly. 2005-07-18 10:00:02 +00:00
ehofman
0ec8fa64a4 IRIX fixes.
Somehow the MIPSpro compiler doesn't like an STL map entry being called
using a variable when the reference is an object and not a pointer to an
object.

Preliminary support for a fontcache is added which prevents fonts from
being loaded more than once and takes care of freeing them up again.
The fontcache isn't used yet since there seems to be a problem somewhere.
2005-07-18 09:18:24 +00:00
ehofman
1869b30b58 Mathias Frhlich:
I have traced that reset on carrier problem down to several problems. One of
them is the fact that on reset the carrier is updated while the aircraft is
not. That made the aircraft drop down an elevator sometimes. Depending on the
passed realtime while loading some parts of the scenery.
2005-07-13 12:25:16 +00:00
mfranz
3e38a4d415 - suppress CygWin warnings (Vivian Meazza) 2005-07-13 11:43:00 +00:00
mfranz
036fbdb18e make /sim/current-gui an integer 2005-07-13 10:57:27 +00:00
mfranz
591001a24e - make tabula rasa on re-init
- check /sim/current-gui for where to get gui colors (default "/sim/gui[0]")
- call getFont() with gui font address (default "/sim/gui[0]/font")
2005-07-13 10:16:42 +00:00
mfranz
4ac0776e97 nasal dialogs are separate trees and have an empty name 2005-07-13 07:05:50 +00:00
mfranz
eefd7dee8c - fix alpha handling (hopefully)
- remove another leftover debugging line
2005-07-13 06:37:39 +00:00
mfranz
275a9a5cc0 - don't clamp when setting, but on request (allows to set an invalid color)
- adapt constness
- remove leftover debugging line
2005-07-12 16:48:16 +00:00
mfranz
387888862c - let FGColor setters/mergers report if they found something merge-worthy
- tune "use-<color>-node-for-pucol" masks
2005-07-11 08:01:28 +00:00
mfranz
01bca490b1 add missing paren 2005-07-09 14:01:52 +00:00
mfranz
f3e88fc05d - clear alpha like r/g/b
- fix warning
- replace tabs by 4 spaces, according to the style of the file
2005-07-09 13:53:25 +00:00
mfranz
f65eb6e3d5 tell the layouter about the default font (I wonder why
LayoutWidget::setDefaultFont() wants puFont* /and/ pointsize as extra
parameters, when puFont knows its pointsize anyway. Didn't want to change
that yet, though.) Now the HELVETICA_10 font makes actually sense. :-)
2005-07-08 20:12:06 +00:00
mfranz
18a874f1b2 disable automatic re-opening of dialogs on re-init; this does currently
not work correctly (forgets the bindings)
2005-07-08 16:42:26 +00:00
mfranz
8d2f921618 rename VERA_12B font to SANS_12B (as in sans-serif). This is a "Grotesk"
font similar to Helvetica/Swiss. The license doesn't allow to redistribute
modified fonts under the original name. While it's only a converted font,
and not manually modified, it can no longer be seen as original. Changes
so far are (a) conversion from vector to bitmap, (b) different empty space
width, (c) different & constant gap value, without other kerning information.
Further changes may be necessary in the future.
2005-07-08 13:28:40 +00:00
mfranz
f0b6030d31 Harald JOHNSEN:
[new_gui is] "using copies of puFont objects that are not yet initialized, I
think that dependant of link order (and so tor execution order) it can
work or not. Changing puFont font by puFont *font should work in all cases."
2005-07-08 11:15:17 +00:00
mfranz
ffb1515aa4 add missing copyright statements 2005-07-08 07:37:56 +00:00
mfranz
e675f80a66 remove commented out and non-functional code for now 2005-07-08 06:45:00 +00:00
mfranz
81aaf4c7bd make property picker consider the new_gui colors; unfortunately, plib
hardcodes the text color as black, which makes them a bit hard to read
on dark backgrounds; fix sent to the plib list; (the added code isn't
pretty and hence fits the existing style quite well ;-)
2005-07-07 21:32:33 +00:00
mfranz
f2bf0a7cb3 - use color map information from new_gui.cxx and set puObject colors
accordingly;
- cleanup (call all puObjects "obj" for easier editing/copying)
- commented out code: (not-yet functional props preprocessor)
2005-07-07 21:30:34 +00:00
mfranz
e1a5398e4f - add gui color support: maintain color map with default colors and all
colors from /sim/gui/colors/ into map;
- set default color scheme
- handle fonts
- implement color class
- close all dialogs on reinit, set up style again, and then reopen all
  (non-nasal generated) dialogs again
2005-07-07 21:28:15 +00:00
mfranz
9b47b1b15b add fonts.cxx file 2005-07-07 21:24:28 +00:00
mfranz
9946347fa7 contains two fntBitmap fonts with iso8859-1 character set; this was
generated by freeglut's genfont utility. That application also generates
a copyright message that I did not copy into this file, because it is
wrong: the author of genfont claims copyright for data that *I* generated
using his program; this doesn't fly. Of course, the copyright will remain
in the (heavily edited) version of *his* code. I'll commit that, too.
2005-07-07 21:23:42 +00:00
mfranz
cac0a9b326 - abstract out reading colors from the property tree into a routine.
This could also be used to read the default foreground/background color
  from a definition in preferences.xml or gui/color.xml.
2005-07-04 07:27:17 +00:00
mfranz
11138e3739 - make menubar reloadable ... again. This was lost because FGBindings does
no longer save inaccessible bindings copies, but only pointer to the
  bindings in the property tree (which was desirable to get accurate
  error messages for Nasal bindings).
2005-07-03 14:43:47 +00:00
mfranz
e73dffb99f - fix <hrule>
- add <vrule>
- allow elements to default to foreground color (black)
- remove redundant  if (foo) delete foo;

The rules do currently need a dummy child for the layouter to work correctly,
(<hrule><foo/></hrule>). The goal is to make a simple <hrule/> work.
2005-07-02 20:49:38 +00:00
mfranz
550352c0b6 keep panel and gui bindings nicely separated; useful for debugging,
especially now that the property path is shown in nasal error messages
2005-06-24 14:07:15 +00:00
mfranz
19b09cef28 FGBindings doesn't create its own, detached copy of the bindings property
subtree. Keeping bindings available is in the responsibility of the caller.
2005-06-24 13:44:22 +00:00
mfranz
c70e5f20de - layout frames like groups (I forgot to commit that yesterday :-) 2005-06-21 12:13:07 +00:00
mfranz
0636ebfc86 - fix "frame" (the old code was broken and ... strange)
- add "hrule" (horizontal rule; accepts color and "pref-height" for thickness)
2005-06-20 20:54:47 +00:00
ehofman
70fe768e5c Revert the previous patch. 2005-05-17 09:56:52 +00:00
ehofman
a75c0859bd Oops, I didn't test compile the latest code and this is what happens. 2005-05-16 09:05:17 +00:00
ehofman
d4b8a81a44 Make the dialogs work again. 2005-05-16 08:37:18 +00:00
ehofman
48f45296ce Add support for altering the border thickness of objects and add a 'frame' object as a visual representation of a group. 2005-05-06 11:46:52 +00:00
ehofman
a760869475 Fix a couple of stupid mistakes, I'm off to find a brown paper bag now. 2005-05-03 12:48:31 +00:00
ehofman
a4eebe4277 Shoot, I removed a bit of crucial information just before committing it. 2005-05-03 12:20:17 +00:00
ehofman
2c3b8e075c Make it possible to define a different font for the labels 2005-05-03 11:58:33 +00:00
ehofman
c3ba52d821 Allow for defining the label color. 2005-05-02 14:45:04 +00:00
ehofman
0c61e0dae1 Make it optional whether a dialog can be dragged or not. 2005-05-02 12:14:12 +00:00
ehofman
cc3eacb88e Melchior: Make line wrapping in textboxes configurable, and enable it by default 2005-04-19 13:15:04 +00:00
ehofman
3f6536fee6 Allow for recolloring the dialogs. 2005-04-13 11:39:53 +00:00
ehofman
019a7a186b Melchior FRANZ:
showDialog() is careful not to create a new FGDialog() if a dialog with the
same name is already open (active). But at this point it is already too late:
newDialog(), which was called shortly before, has already overwritten the
dialog properties. This leads to animated garbage in the best case, and a
segfault in format_callback() in the worst case.

- GUI::newDialog(): Don't you overwrite properties of an active dialog!
- GUI::readDir(): You may do that, but delete the old dialog first!
  (necessary for reloading the GUI)

- FGDialog::makeObject(): only set format_callback() with setRenderCallback()
  if the property is "live". Otherwise, only call it once at construction
  time. This isn't only a performance improvement. Without this the label
  was growing until it hit the limit (256).
2005-03-29 08:35:13 +00:00
ehofman
71dd0f8f96 Melchior FRANZ:
The previous message wasn't totally correct. Strings are now allowed, too. And
the pattern is now '[ -+#]?\d*(\.\d*)?l?[fs]' and *may* be embedded in a string.
There may only be one %s or %f, though. %% is allowed in the preamble/postamble.
(Yes, %ls is allowed, too, and treated as %s.)

Also, "end" is superfluous now.
2005-03-26 10:45:00 +00:00
ehofman
db989269b8 Melchior FRANZ:
Printing floats in dialogs with 8 digits after the comma is inappropriate
for most cases.

- implement a "format" property for "text" gui elements (a.k.a. pui label).
  Number formats are set by strtod/snprintf, while formats on non-numbers
  are replaced by "%s". Practical example in the upcoming material.nas update.
  Valid formats regex:  '%[ -]?\d*(\.\d*)?l?f' (IOW: the format must begin
  with '%' and end with 'f').

  # Nasal:
  number = dialog.addChild("text");
  number.set("label", "3.1415926");
  number.set("format", "%.3f");
2005-03-26 10:09:34 +00:00
ehofman
4b116a1196 Melchior FRANZ:
The dialog handling has been written at a time when only one dialog was
shown at the same time, and dialogs were shallow -- with only children, but
no grand-children. This makes finding a draggable spot on modern, dialogs
with nested objects quite a challenge. The patches fixes this, and other things:

- check full object tree on button press, not only the outmost layer;
  and don't give up just because we are in *something* (which could well be
  something harmless, like a group); only ignore a few, sensible objects
  (we don't want to drag after a click on a button or into an input field)

- don't lose dialogs as easily when dragging too fast (it does still happen
  if one manages to enter an editable field while dragging, but this is
  a plib problem and I don't feel like fixing that now  :-)

- don't "live"-update input fields while they are in edit mode

- remove some "if (foo) delete foo;" redundancy
2005-03-24 13:41:43 +00:00
curt
40170cb722 The view frustum is defined in plib apps using calls to ssgSetFOV() and
ssgSetNearFar().  This by default creates a symmetric view frustum which is
typically what an application wants.

However, to get control of the view frustum in order to build support for
asymmetric view frustums, we need to wrap these calls with a bit of our own
logic.

This set of changes wraps all calls to ssgSetFOV() and ssgSetNearFar() with
FGRenderer methods.

I also standardized how the FGRenderer class is handled in globals.[ch]xx.
This led to some cascading changes in a variety of source files.

As I was working my way through the changes, I fixed a few warnings along
the way.
2005-02-25 19:41:53 +00:00
ehofman
5bc15d7a69 Durk Talsma:
I just heard from John Wojnaroski that you and he are going to work on getting
a flightgear demo machine up for the linux expo thursday and Friday. John
indicated that he would very much like to get a CVS version with the new
traffic code up and running before the expo.
2005-02-10 09:01:51 +00:00
ehofman
964349e401 Andrew Midson:
I have made the
'Select Airport from List' option in FlightGear work
(I think) properly. I have some concerns about the
solution, which could be broken by changes to plib (if
they re-use the value I have assigned to
PUCLASS_LIST), but for the moment it seems to work OK.

Erik Hofman:
A request has been sent to John Fay to include the puList
code in the puAux subdirectory of plib so expect some
changes for future version of FlightGear.
2005-01-31 10:36:59 +00:00
curt
3ad6d87576 FGIO::shutdown_all() is called from the FGIO destructor so we don't want
a seperate explicite call or the io channels will be forced to try to shutdown
twice which could cause problems for some IO modules (i.e. attempting to
close an invalid file descriptor the second time ...)
2004-12-29 20:38:17 +00:00
curt
222446df29 Replace the data/Airports/basic.dat.gz and data/Airports/runways.dat.gz with
a single apt.dat.gz file which is in the native X-Plane format.

To do this I wrote a front end loader than builds the airport and runway
list.  Some of the changes I needed to make had a cascading effect, so there
are minor naming changes scattered throughout the code.
2004-12-22 23:57:07 +00:00
curt
d05121ef46 Fix my mailing address by replacing it with my web page. 2004-11-19 22:10:41 +00:00
curt
4214cd6c10 Migrate FlightGear code to use "#include SG_GL*" defined in
"#include <simgear/compiler.h>".
2004-11-18 19:53:00 +00:00
ehofman
a938b5b0df Boris Koenig:
This will modify menubar.cxx/hxx so that it exports the
entire menubar (from menubar.xml) to the property tree, so that it can
now be changed dynamically  using Nasal's setprop() instruction and
afterwards running a newly added fgcommand to update the menubar
based on those changes using the appropriate menubar path within
the property tree.

By default the menubar from menubar.xml will be stored within:

    /sim/menubar/default


Erik:

I have moved the loading of menubar.xml into preferences.xml and
made sure that the menubar is destroyed every time a new menubar
is created.
2004-10-22 09:26:51 +00:00
curt
41e217fb9a Continued work to clean up the hires screen shot code and move it back towards
a working state.  I still see an anomoly when taking a screen shot from inside
a 3d cockpit, but external (chase/tower) views seem to work well.  I also
added a property to control how many screen-res tiles are generated in the
output.  Theoretically, you can now generate unlimited resolution screen shots,
or limited only by your disk space and patience.

Today I successfully generated a 20*1024 x 20*768 (20480x15360) resolution
screen shot.  If you rendered that at 100 dpi it would cover a poster of
about 17 feet by 12.8 feet.

Good luck trying to display something that big or convert it to anything
useful on a typical PC. :-)
2004-10-06 03:29:14 +00:00
ehofman
6f8cae6b87 Boris Koenig:
I'm attaching a small change to Andy's dialog.cxx that I needed
to make so that it enables XML/Nasal-dialogs to also contain
puLargeInput boxes.

The text will be retrieved/buffered from/within a specified
property tree, like:

<textbox>
    <x>100</x>
    <y>100</y>

    <width>200</width>
    <height>100</height>

    <property>/gui/path-to-text-node/contents</property>

    <slider>15</slider>

    <editable>true</editable>
</textbox>
2004-09-27 14:40:31 +00:00
ehofman
06bead966b Cache the renderer in a local pointer. 2004-09-27 09:13:12 +00:00
curt
cc66c8fdca Activate the hi res screen capture functionality again, however it is no
longer working 100% correctly. :-(
2004-09-27 02:39:54 +00:00
ehofman
986492d72d Finish what was committed in a broken state yesterday.
Split up main.cxx into a program manegement part (which remains in
main.cxx) and a render part (the new renderer.?xx files). Also turn
the renderer into a small class of it's own. At this time not really
exctining because most of the stuff is still global, but it allows us
to slowly migrate some of the global definitions into the new class.

The FGRenderer class is now managed by globals, so to get the renderer
just call gloabals->get_renderer()

At some pijt it might be a good idea to also turn the remaining code in
main into a class of it's own. With a bit of luck we end up with a more
robust, and better maintainable code.
2004-09-20 13:21:51 +00:00
ehofman
3b3600fd21 Make it compile, link and run again (pfew\!) 2004-09-19 18:34:47 +00:00
ehofman
de47d1a7d8 Revert to CVS as of 5000 seconds ago. 2004-09-19 17:59:40 +00:00
ehofman
88b8990409 Fix some link errors. 2004-09-19 17:29:07 +00:00
ehofman
887c0c0f65 Fix some link errors. 2004-09-19 17:27:44 +00:00
ehofman
db3bbd25e9 Fix some compile errors. 2004-09-19 17:18:11 +00:00
ehofman
cbdeb3be16 Remove unnecessary inclusions of sg.h ans ssg.h 2004-09-19 16:47:00 +00:00
ehofman
1a87ef23f5 Jim Wilson:
This is a workaround for an issue where the xml dialogs were shrinking on
subsequent pops.

Andy Ross says:

That looks like it should be fine for a release-time workaround.  The
2 pixel border on dialogs is at best a minor feature, and probably
invisible since the sub-frames all have their own padding.

Clearly the right fix would be to find out where the code is getting
confused by the previous layout.  In principle, the layout should be
idempotent: if you don't change the layout constraints, it shouldn't
change its layout.  There's still a bug in there somewhere.
2004-07-23 07:36:32 +00:00