Page 2 of 2

Re: Window position when FSX starts

Posted: 19 May 2010, 09:47
by basys
Hi Folks

DaveK -
Sorry, mean't to post this previously,
snippets from a wiki article I was preparing already,
but got distracted by other matters.


Changing screen res will have no effect,
as all FSX's window coords use Universal Screen Coords, (USC),

USC is a scaling system
designed to make screen positions
entirely independent of the user's screen resolution.
i.e.
USC numbers do not represent pixels.



Excepting the FSX GUI,
all FSX window's coords are stored in FSX specific files.
i.e.
for FSX in-game window, child window(s), undocked window(s)



The FSX in-game window default position is defined/stored in fsx.CFG,
(but will be overridden by settings if you load a saved flight file).

With FSX not running.
Using a text editor, e.g.e Notepad, (not Word or WordPad).
Open your fsx.cfg
Find the section titled [Main]
Look for line begining -
Location=USCDATA\\.\DISPLAYWHATEVER

Swap your USC numeric values for -
Location=0,0,4096,3072,\\.\DISPLAYWHATEVER

That should set the FSX in-game window position
to fill the top left hand corner of the screen
i.e.
Origin - Top left hand corner
End - Screen centre



PS
Just in case,
ensure you are editing the fsx.CFG from your profile,
not the MS repair copy in FSX root folder.



PPS
Ensure your fsx.CFG section titled [Main]
includes the line -
DisablePreload=1


Otherwise fsx will be
preloading your default flight in the background,
with the associated window position
which was active when you'd saved it.



HTH
ATB
Paul

Re: Window position when FSX starts

Posted: 21 May 2010, 01:41
by DavidK
DanKH wrote:Instead of a higher resolution, go the other way temporarily, say, good old 640x480 or something rediculus like that, and then revert to you normal higher settings.
Sadly, that didn't work...
basys wrote:Changing screen res will have no effect, as all FSX's window coords use Universal Screen Coords, (USC), USC is a scaling system designed to make screen positions entirely independent of the user's screen resolution. i.e. USC numbers do not represent pixels. Excepting the FSX GUI, all FSX window's coords are stored in FSX specific files. i.e. for FSX in-game window, child window(s), undocked window(s)
The FSX in-game window default position is defined/stored in fsx.CFG, (but will be overridden by settings if you load a saved flight file).

With FSX not running. Using a text editor, e.g.e Notepad, (not Word or WordPad). Open your fsx.cfg
Find the section titled [Main]
Look for line begining Location=USCDATA\\.\DISPLAYWHATEVER
Swap your USC numeric values for Location=0,0,4096,3072,\\.\DISPLAYWHATEVER

That should set the FSX in-game window position to fill the top left hand corner of the screen i.e.
Origin - Top left hand corner ... End - Screen centre

...ensure you are editing the fsx.CFG from your profile, not the MS repair copy in FSX root folder.

Ensure your fsx.CFG section titled [Main] includes the line DisablePreload=1
Otherwise fsx will be preloading your default flight in the background, with the associated window position which was active when you'd saved it.
...and, though this sounded like a deep-level solution, it didn't work either.

The fsx.cfg file within my documents and settings profile has "[Main]" as the first section and "Location=............\\.\DISPLAY1" as the first entry within [Main]. After making a backup, I edited this Location line from "Location=640,465,1664,1206,\\.\DISPLAY1" to "Location=0,0,4096,3072,\\.\DISPLAY1" (as above) and then inserted "DisablePreload=1" underneath it. However, when I then ran FSX, the same sized windows as before appeared: the FSX splash screen, followed by empty black window that did fill the desktop (except taskbar), which then, after a while, disappeared to leave the splash screen before returning behind the splash screen but with its top lefthand corner in the centre of screen and its remaining three quarters off screen (and behind the taskbar). The starting "HOME", "FREE FLIGHT", etc, dialog then appeared centred on top of it.

I immediately exited FSX and, looking once more at the fsx.config file, saw that the "Location=" entry had become "Location=576,418,1728,1253,\\.\DISPLAY1". The "DisablePreload=1" entry was still in place below it.

I'm not so frustrated about this window behaviour as for you guys coming up with good ideas to solve it. Those edits to the fsx.cfg file feel like they should be a solution, so I wonder why they're not.

Incidentally, if it makes any difference, the shortcut I use to run FSX includes the property "Run: Maximised".

DavidK

PS Maybe it matters where the "DisablePreload=1" entry needs to be placed, i.e. it shouldn't be immediately below the "Location=" line?

Re: Window position when FSX starts

Posted: 23 May 2010, 22:51
by basys
Hi Folks

David -
What is your monitor's native resolution ?
What is your desktop's resolution set to ?

Do you have a scrolling desktop running ?
If so disable it.

DavidK wrote:<snip>
Those edits to the fsx.cfg file feel like they should be a solution,
so I wonder why they're not.
It should work,
but guessing your default .flt's windowdata is still somehow overriding.

In your fsx.CFG,
find section [USERINTERFACE]
entry for your default .flt
SITUATION=WHATEVER

Change to comment it out -
SITUATION=
// WHATEVER


DavidK wrote:Incidentally, if it makes any difference,
the shortcut I use to run FSX includes the property "Run: Maximised".
Not aware of that being a valid launch option.
Where did you find that ?

Maximised window is controlled by fsx.CFG
[Main]
Maximized=1

EDIT -
Does your shortcut contain any other parameters ?

Try starting FSX using the default shortcut.


DavidK wrote:PS Maybe it matters where the "DisablePreload=1" entry needs to be placed,
i.e. it shouldn't be immediately below the "Location=" line?
Order makes no difference, (unless there was an inappropriate character above),
as its the variable=value that matters.


HTH
ATB
Paul

Re: Window position when FSX starts

Posted: 24 May 2010, 00:02
by GHD
Paul,

My Location= values are pixel values of the upper-left lower-right window positions.

Re: Window position when FSX starts

Posted: 24 May 2010, 08:05
by basys
Hi Folks

George -
Cheers, you are correct. :thumbsup:

[main]
location= PIXELS

USC for child window coords.



David -
Try -
Location=0,0,1024,768,\\.\DISPLAYWHATEVER



HTH
ATB
Paul

Re: Window position when FSX starts

Posted: 24 May 2010, 19:00
by DavidK
Thanks, Paul, for persevering with this!
basys wrote:David -
Try -
Location=0,0,1024,768,\\.\DISPLAYWHATEVER
Did so (with "1" replacing "WHATEVER") and no joy. However, what seems to be happening is that the first time the empty black window appears, it uses whatever Location setting is given, but when it appears again behind the "HOME", "FREE FLIGHT", etc, window, it's moved to this bottom righthand quarter position. When I then exit FSX and look at fsx.cfg again, Location has been changed to "640,452,1664,1220,\\.\DISPLAY1" (!)

To respond to your earlier idea:
basys wrote:David -
What is your monitor's native resolution ?
What is your desktop's resolution set to ?

Do you have a scrolling desktop running ?
If so disable it.
Native resolution = I don't know and a quick Google search didn't return anything straightforward; it's a 19" CRT monitor.

Desktop resolution = 1152 by 864 but I've now started running FSX at 1024 by 768 by 16-bit (in fullscreen) in an effort to smoothen the graphics' movements. (Although I have a 2 GHz processor, 2 Gb RAM, 256 MB Nvidia-type graphics card and have FSX's global texture resolution set to Low and other graphics settings no higher than Medium Low, the movement can still be jerky -- but that's another issue.)

Scrolling desktop = No (and never have).
In your fsx.CFG,
find section [USERINTERFACE]
entry for your default .flt
SITUATION=WHATEVER

Change to comment it out -
SITUATION=
// WHATEVER
No change here either, so I restored the "WHATEVER".
DavidK wrote:Incidentally, if it makes any difference,
the shortcut I use to run FSX includes the property "Run: Maximised".
Not aware of that being a valid launch option.
Where did you find that ?
I was referring to the Properties of the "Microsoft Flight Simulator X" shortcut that can be used to launch the program, but, not surprisingly, it doesn't have any effect.
Maximised window is controlled by fsx.CFG
[Main]
Maximized=1
I've change this from "0" to "1", but again, like the Location setting above, I find it changed back to "0" when I look at fsx.cfg after exiting FSX.

Strange behaviour. However, since I've now started using Alt+Enter to switch the simulation to fullscreen mode, it's even less of an issue. Just for the record, here's the [MAIN] section I seem to be stuck with:

Code: Select all

[MAIN]
Location=640,452,1664,1220,\\.\DISPLAY1
DisablePreload=1
User Objects=Airplane, Helicopter
SimObjectPaths.0=SimObjects\Airplanes
SimObjectPaths.1=SimObjects\Rotorcraft
SimObjectPaths.2=SimObjects\GroundVehicles
SimObjectPaths.3=SimObjects\Boats
SimObjectPaths.4=SimObjects\Animals
SimObjectPaths.5=SimObjects\Misc
Maximized=0
HideMenuNormal=1
HideMenuFullscreen=1
----------------------------------------

On a different issue, seeing this...
basys wrote:location= PIXELS

USC for child window coords.
...and seeing that folks like you and George seem to've penetrated the innards of these kinds of files, how do the following sets of information about a panel's position and size relate to each other?

Code: Select all

[Window01]
Background_color=0,0,0 
size_mm=331,591
window_size_ratio=1.000  
position=0
visible=0
ident=82
window_size= 0.323, 0.770
window_pos= 0.163, 0.000

gauge00=HS7!Overhead_Port,  0,0,331,591

Code: Select all

[window 4]
name=Overhead Port
x=-2
y=-2
width=380
height=653
I have the feeling the first includes position information in both pixels and "USC", while the second is only pixels... The position information should be equivalent, but I can't work out the conversion from the decimals ("window_size=" and "window_pos=" in the first, "x", "y", "width" and "height" in the second).

----------------------------------------

Whatever you make of any of the above, if I could send you a drink or the like over the internet, I'd be asking for your order!

Thanks again,
DavidK

Re: Window position when FSX starts

Posted: 24 May 2010, 21:58
by basys
Hi Folks

Dave -
No worries.
Sorry we're not apparently getting anywhere with this.

Something somewhere is reintroducing some stored value.

Clutching at straws here -
I realise you're on XP
but it appears that possibly there may be ownership issues.
Are you running FSX -
- From the same account that FSX was installed under ?
- As administrator ?
- Are you performing these edits with FSX running ?
(FSX needs to be shut down).



re: Panel data
DavidK wrote:how do the following sets of information
about a panel's position and size relate to each other?
<snip>
I have the feeling
the first includes position information in both pixels and "USC",
while the second is only pixels...

Sorry,
I didn't explain/expand that correctly.
A panel bod will probably explain the following better.

USC is not involved directly at this level,
rather it works at the "view" level
i.e. for relative scaling to the user's display,
or special purpose overlays, (e.g. 2D mini-panel, or mission gauges).
Data in panel.cfg [Default View] section.



Panel.cfg is the designer's mechanism for defining the panel layout,
for individual gauges on either the main or child windows,
and the initial relative position and size of those child windows.



AIUI, official "position" is
any panel/child panel background bmp can be up to 1024x768px.

Objects, (either gauges, or child windows)
are then placed relative to these background's origin.
Relative placement can be pixels or mm.

Objects can then be scaled,
to give a proportional representation against the main background,
but still allow higher-res display without pixellation,
when the user stretches a child window.

EDIT -
Take a peep at missionpanels.cfg
located in Microsoft Flight Simulator X\Gauges\ folder
as that contains a commented sample.



Whatever the object's relative placement,
USC is then used to extrapolate/scale
the background and child components
to the user's FSX display size, (windowed/fullscreen/multi-monitor).

i.e.
Maintain components relative positions
when the user switches between windowed and fullscreen.
Or -
Temporarily store child window locations,
when the user repositions those windows,
and toggles between show/hide.
Or -
To store/recreate window positions
when saving/loading a "Saved Flight".



From the SDK - Panel Configuration section

size_mm
A definition of the unit size
used for placing and sizing gauges on this panel.

For example,
if the size_mm is 200 x 200
and a gauge’s size is 50, 50,
it will take up 1/16th ( ¼ x ¼) of the panel window.

If no size_mm is defined,
the size of the panel’s background bitmap
(not the gauge’s background bitmap) will be used.

If no background bitmap is defined
(as is often the case with popup panels that contain only one gauge),
a default size of 100 x 100 is used.

If window_size is not specified,
the size of the window on screen will be size_mm
divided by the size_mm
for the first window specified in the panel.cfg.

For example,
if the size_mm for a given panel is 200, 200
and the size_mm for the first panel in the panel.cfg is 1024 x 768,
the given panel would occupy
19% of the screen in the x dimension
and 26% in the y dimension,
or a total of 5% of the total screen area.



position
Specifies the relative position of a panel window to the main window.

A number from 0 to 8 (as shown below)
designates the position of the panel window.

If nothing is specified, 7 is the default,
otherwise,
one of:
0 = upper-left corner
1 = upper-middle side
2 = upper-right corner
3 = middle-left side
4 = middle
5 = middle-right side
6 = lower-left corner
7 = lower-middle side
8 = lower-right corner.



window_size
The percentage of the screen to be taken up by window,
from 0 to 1.

If this is set,
the size of the main panel is ignored for this panel
and size_mm becomes irrelevant for determining the size of the panel window.
(size_mm is still used for calculating
the relative sizes of the gauges within the window).



window_pos
Overrides the position and windowsize_ratio variables.
Provide at least an x value, the y value is optional.



gauge00 to gaugeNN
Specifies which gauge file to load and the X,Y position of the gauge.

The Panel system starts loading gauges,
starting from gauge00 until it reaches gauge99.
After that, it loads gauge100, gauge101, and so on
until it finds a break in the progression.

This comma-delimited variable exists primarily
to specify which gauge DLL file to load
and the X, Y position of the gauge, in millimeters.

This will override the size_mm setting.

The basic format is:
gauge##=gaugefile!gaugename, X, Y, W, H, parameters.

gauge#
indicates the order in which the gauge is loaded

gaugefile!
indicates the specific .gau file in which the gauge is found (if the gauge is C based) or the cabinet file (if the gauge is XML based).

gaugename
displays the name of the gauge you assign in your gauge code via the GAUGE_NAME variable (C based), or the file name (XML based).

X, Y
indicates the X and Y position of the gauge, in millimeters,
relative to the panel background.

W
indicates the width of the gauge in millimeters.

H
indicates the height of the gauge in millimeters.

Parameters are passed to the gauge as a text string argument.
However, if you have set size_mm to be 1024,
these values are also the pixel values,
which can be much easier to deal with.

NB
Thats pixel values on that panel's bmp, not on the user's screen.



HTH
ATB
Paul

Re: Window position when FSX starts

Posted: 24 May 2010, 22:19
by GHD
Desktop resolution = 1152 by 864 but I've now started running FSX at 1024 by 768 by 16-bit
David,

It is recommended that you use the same resolution in FSX that you use for the desktop. Can you set the desktop to 1024x768?

Re: Window position when FSX starts

Posted: 25 May 2010, 17:58
by DavidK
basys wrote:Clutching at straws here -
I realise you're on XP
but it appears that possibly there may be ownership issues.
Are you running FSX -
- From the same account that FSX was installed under ?
- As administrator ?
- Are you performing these edits with FSX running ?
(FSX needs to be shut down).
In order: Yes, yes, no.
I'll try saving the default flight with a fullscreen window, otherwise I'll just use Alt+Enter each time a flight starts.
re: Panel data ......
Thanks for all this info!
I'll apply it to the examples in my previous post a bit later. (I'm wanting to reposition some of the panels in the Hawker Siddeley HS 748.)
GHD wrote:It is recommended that you use the same resolution in FSX that you use for the desktop. Can you set the desktop to 1024x768?
Thanks for this tip; I've reset FSX's resolution to the desktop 1152 by 864.

DavidK