Search the archive:
YaBB - Yet another Bulletin Board
 
   
 
Pages: 1 
Send Topic Print
How do I position windows? (Read 1349 times)
Jun 5th, 2003 at 8:55pm

WebbPA   Ex Member
I Like Flight Simulation!

*
 
I've been getting into panel design, primarily tweaking my own panels by moving, replacing, etc. gauges. But the window design escapes me.  I want to move and resize some GPS windows and after I get the hang of that afew other popups.  I have a panel with this configuration that puts a GPS window in the bottom right, but not in the default position in the corner:

[Window01]
Background_color=0,0,0
size_mm=640
window_size_ratio=1.00   
position=0
visible=0
ident=GPS_panel
window_size= 0.226, 0.482
window_pos= 0.774, 0.432

Having read my Panel Design SDK it appears that:

size_mm means the window is 640 pixels - width, depth or what?

Window size ratio=1.00 "Determines the width of panel window as a ratio of the client area of Flight Simulator main window"  Huh?  If the default is 1, why is this in here?

Position=0 This should put it in the upper left corner, shouldn't it?

visible=0.  Finally, a line I understand.
ident=GPS.  OK, I understand this one, too.

window_size= 0.226, 0.482
window_pos= 0.774, 0.432 - according to the SDK, I have just overridden the previous size, ratio and position settings.

Should I always set size, ratio and position as above so I can reset them here?

What do the numbers mean?  I get the impression they are relative positions, 0.0, 0.0 being upper left corner and 1.0, 1.0 being bottom right.

Anything else I'm missing?







 
IP Logged
 
Reply #1 - Jun 6th, 2003 at 2:12am

Hagar   Offline
Colonel
My Spitfire Girl
Costa Geriatrica

Posts: 33159
*****
 
You might like to try my method. http://www.simviation.com/lair/AddGPS.htm

I've been working with panels since FS98. I find the FS98-style window entries work fine for general use in all versions of FS.
size_mm=640 is the width of the panel window. It affects the gauge sizes & positioning. This has no relationship to the actual size of the panel BMP but is usually the same. Higher resolution (1024 x 768 ) main panel BMPs would usually be used in the later sims.
Some windows are defined with both width & depth like this size_mm=1024, 768. This is useful for the smaller pop-up windows to fit them exactly to the gauge.

I discovered long ago that the window_size_ratio= line is a corrupt command which has no effect. Try changing it to windowsize_ratio=
Delete or remark the FS2000 window_size= & window_pos= entries.
As you say, these conflict with the FS98-style position= entries. position=8 will put the GPS in its usual location at bottom right. I see no point in using both methods.

You can do all this in CfgEdit if you prefer.
 

...

Founder & Sole Member - Grumpy's Over the Hill Club for Veteran Virtual Aviators
Member of the Fox Four Group

Need help? Try Grumpy's Lair

My photo gallery
IP Logged
 
Reply #2 - Jun 6th, 2003 at 2:14am

JohnP   Offline
Colonel
I love YaBB 1G - SP1!

Posts: 182
*****
 
SmileyThe file in question seems to have a lot of entries, which might make this confusing. Here is the GPS entry for the microsoft Boeing 737:
   [Window02]
size_mm=150,250
position=8
BACKGROUND_COLOR=16,16,16
VISIBLE=0
ident=GPS_PANEL
gauge00=gps!gps,0,0,150,250

The top line is the size line(Heigth, Width)
The second line is the position, which in this case is 8. Position 8 is the lower right corner. It usually starts with 0(upper left corner), then 1,2,3,4,etc. going across the top and down to the lower left to the middle right.
  The last line is X axis, Y axis, heigth, width.
  Hope this helps a little, even though it sounds confusing.
 
IP Logged
 
Reply #3 - Jun 6th, 2003 at 7:56am

WebbPA   Ex Member
I Like Flight Simulation!

*
 
Thanks, but it's still very confusing.  My first goal is to move the "standard" GPS position from a big popup in the corner to something that fits nicely over other gauges.  This is what the example does - it's from John Consterdine's Baron RTW panel.

Despite the size=640 and position=0 it's custom sized and positioned closer to position=5 (middle left) than position=0 (position=0 should be upper left, shouldn't it?).  When I use position=8 I can't move the gauge out of position 8, like to overlap 5 and 8.  Can I just use size=640, position=0 for ALL windows and just concentrate on window_size and window_position?

According to the SDK these entries will override everything else anyway.  But what do these numbers mean - are they the relative positions I mentioned earlier?

I've just started using CfgEdit but I can't get it to work with popup windows.  It's ok for general positioning of gauges but I always have to back and fine tune them with notepad.  I can see any window I want but only one at a time.  And I just tried opening the above panel and I got an error message - CfgEdit offered to change the GPS position for me.

 
IP Logged
 
Reply #4 - Jun 6th, 2003 at 8:40am

WebbPA   Ex Member
I Like Flight Simulation!

*
 
Maybe a picture will help.  Here's my entries for a an F86/100 panel:


[Window03]
Background_color=16,16,16
size_mm=150,250
window_size_ratio=1.00  
position=0
visible=1
ident=GPS_PANEL
window_size= 0.239, 0.345
window_pos= 0.765, 0.625
gauge00=gps!gps,  0,0,150,250

and here's the panel

...

I tried size_mm=640 but it didn't work.  The gauge was tiny picture inside of the window.  The size is per the original designer.

The left/right position is pretty good (blind luck) but the right edge of the gauge is cut off.  Which entry should I modify to make the left/right size smaller - size_mm, window_size, or gauge00?

Then I need to move it down a little (just under the red warning lights) and when I have the top of the gauge perfectly aligned I need to stretch it so the bottom of the gauge lines up with the bottom of the panel.

Which entries control moving/dragging the whole gauge and which ones control the size?  Note that position=0 seems to be irrelevant.

Do I need to first define the window parameters then put the gauge into it?

 
IP Logged
 
Reply #5 - Jun 6th, 2003 at 12:10pm

JohnP   Offline
Colonel
I love YaBB 1G - SP1!

Posts: 182
*****
 
SmileyDo you use a panel program? Pop-up gauges will go into a specific location, and can be moved around with the mouse. With a panel program you could move it into the location you want and see what the numbers are, which might help you understand them. Also there is a setting in Fs2002 that if checked will not allow you to move windows around, if checked.
Hopefully, this helps a little and is not to confusing.
 
IP Logged
 
Reply #6 - Jun 6th, 2003 at 12:18pm

WebbPA   Ex Member
I Like Flight Simulation!

*
 
No, I just started using CfgEdit for general positioning and sizing of gauges, then I tweak the .cfg file with notepad.  I can't get CfgEdit to properly show window position and it comes up with error messages every time it sees something it doesn't understand.
 
IP Logged
 
Reply #7 - Jun 6th, 2003 at 1:01pm

Hagar   Offline
Colonel
My Spitfire Girl
Costa Geriatrica

Posts: 33159
*****
 
Did you try the example in my tute? This should work on any panel. Change the [Windowxx] header number & windowsize_ratio= entry to suit the panel. No other modifications required.

[Window03]
size_mm=150,250
windowsize_ratio=2.0
position=8
BACKGROUND_COLOR=16,16,16
VISIBLE=0
ident=GPS

gauge00=gps!gps,0,0,150,250

The above example is for a panel with a 1024 x 768 main panel BMP. This is what it looks like.

...
 

...

Founder & Sole Member - Grumpy's Over the Hill Club for Veteran Virtual Aviators
Member of the Fox Four Group

Need help? Try Grumpy's Lair

My photo gallery
IP Logged
 
Reply #8 - Jun 6th, 2003 at 1:06pm

JohnP   Offline
Colonel
I love YaBB 1G - SP1!

Posts: 182
*****
 
Smileyposition      Specifies the relative position of a panel window to the main window. For example:
position = 7
A number from 0 to 8 (as shown below) designates the position of the panel window. If nothing is specified, 7 is the default.

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_pos      Overrides the position and windowsize_ratio variables. Provide an x(,y) value.
window_pos=0.85, 0.3

window_size      Overrides the position and windowsize_ratio variables. Provide a w(,h) value.
window_size=0.5, 0.5


The above is an excerpt from the Microsoft panel SdK. I know that you have read it, but The window pos and size entries are overriding your other entries.
I know that with POP-UP windows I just let them come up and reposition them with the mouse to my desired location. If you are dealing with fixed windows, that is a different story.
 
IP Logged
 
Reply #9 - Jun 6th, 2003 at 1:33pm

WebbPA   Ex Member
I Like Flight Simulation!

*
 
Hagar,

As I understand your example you double the size of the gauge and put it in position 8.  I'm after a little more artistic effect.  In this case I would want to move it down so it isn't covering the fuel gauge, then left so it lines up with the MFD that is already mostly covered up.

After moving it I would have to resize it so the bottom right corner of the gauge lines up with the bottom right corner of the panel.

Or maybe I would want to move and resize it so it fits exactly over the right MFD.

Since Position=XX is irrelevant there must be something in window_size and window_pos that will place the gauge on the screen.

I thought these coordinates would have the same meaning as gauge coordinates except that the numbers go from 0 to 1 instead of 0 to 1024.  With a little trial and error I should have been able to figure out some sort of correlation but it hasn't worked that way.  the gauge moves around and resizes unpredictably.

JohnP's quote from the SDK shows how frustrating this is.  It's incomprehensible and it's the only thing the manual that even mentions window placement.
 
IP Logged
 
Reply #10 - Jun 6th, 2003 at 1:52pm

JohnP   Offline
Colonel
I love YaBB 1G - SP1!

Posts: 182
*****
 
SmileyQuestion? "After relooking at your file setup for the GPS, you have it marked as visible=1. This means that your gauge is more like a fixed window instead of a pop-up one. If you intend it to be a pop-up one then you entry should read visible=0". Second question is what is behind the GPS screen? That would give a better idea as to how you plan on placing it visually, instead of trying to explain it.
 
IP Logged
 
Reply #11 - Jun 6th, 2003 at 2:19pm

JohnP   Offline
Colonel
I love YaBB 1G - SP1!

Posts: 182
*****
 
FS2000, FS2002, CFS and CFS2

FS2000/2 and CFS/2 can use the FS98 mode of Window placement, but also introduced a more flexible method. Window Size and Window Position are easier to use, and, if defined, will override Window Size Ratio and Position. Both range in value from 0.0 to 1.0.

Window Position defines where on the Main Window the radio stack (using the same example) will appear, by defining the precise percentage of the Window at which the top left corner of the radio stack is placed. For example, a Window Position value of 0.5, 0.5 (for X and Y) will place the radio stack Panel Window top left corner at the exact middle of the Main Window.

Window Size defines the size of the radio stack as a ratio of the size of the Main Window. A value of 0.2, 0.2 will produce a radio stack width and height scaled to exactly 1/5th, or 20%, of the Main Window width and height.

FS2000/2 and CFS/2 allow you have a Window with no background bitmap. In this case, you can specify the background color using an RGB value. FS Panel Studio allows you to modify this in the Window Properties dialog. In this case positioning is relative to the Size_MM of the Window.


The above is another excerpt from the panel program that I use(FS Panel Studio). It seems to give a clearer explanation of how sizing and positioning nuimbers work. It seems a little less confusing than the Microsoft Panel SDK.
Again, hope this helps a little.
 
IP Logged
 
Reply #12 - Jun 6th, 2003 at 2:35pm

WebbPA   Ex Member
I Like Flight Simulation!

*
 
Visible=1 is just so I don't have to click the icon every time I reload the panel.  When I'm done editing I'll set it back to 0.  There's nothing behind it but the main panel.

I found another example that may illustrate what I want to do.  It's the left 1/3 of the screen.  The code is:

[Window13]
size_mm=260,258
window_size_ratio=1.00   
visible=0
ident=205
pixel_size=0,0
window_pos= 0.030, 0.522
gauge00=gps!gps,  -8,1,275,255

and it looks like this
...

Size looks like the window size - 260x280 pixels.

Window_pos looks about right - upper left corner is 30 pixels from the left edge of the screen and 522 pixels from the top of the screen.

The gauge00 entries look like gauge placement within the window, the negative number being the reason why the left border of the guage is invisible.

So I conclude that

1. Size=mm means window size?  (OK, I'm still lost on this one but either 640 or the same as the gauge size).

2. Position=xx is irrelevant since I am going to override it later.  This example doesn't even have that line.

3. Window size ratio should always be 1.00 since I am going to override it later.

4. Window_pos is the position of the window (w,h) on the screen (not just relative to the panel bmp).

5. Window_size is the size of the window (w,h).

6. Window_size and window_pos are numbers between 0 and 1 where 1,1=the right bottom pixel (1024, 768 for my resolution).

7. Gauge=(gaugename), X position within the window, Y position within the window, Width of gauge, height of gauge.  The first 2 numbers will usually be 0,0.

Am I getting closer?

 
IP Logged
 
Reply #13 - Jun 6th, 2003 at 2:46pm

WebbPA   Ex Member
I Like Flight Simulation!

*
 
John,

Thanks for the explanation.  I think my dissertation is pretty close to that.  But if you have time for one more question, the SDK says that size=mm "Specifies the size of the panel window, in millimeters" (Pixels?).

So is size_mm=W,H normally going to be the same as the width and height entries in gaugexx=(gaugename),0,0,W,H?
 
IP Logged
 
Reply #14 - Jun 6th, 2003 at 2:46pm
RollerBall   Ex Member

 
Haven't read the whole of this thread - life's too short at the moment(!) - but using CFGEdit I've had no problem positioning popups - esp GPS using the position feature which lets you see exactly where it'll be on the panel, resize it and move it round.

Load your panel in CFGEdit and open your GPS panel, then click on Window-Set Default Position. Couldn't be easier. If you're getting error messages you've got a prog problem. Works with all mine and I've done loads.

Roger
 
IP Logged
 
Reply #15 - Jun 6th, 2003 at 2:56pm

WebbPA   Ex Member
I Like Flight Simulation!

*
 
That looks a hell of a lot easier than what I've been trying to do.  And it worked in about a minute on the first try.

Still, it's good to know what the numbers actually mean in case I have to troubleshoot something manually.
 
IP Logged
 
Reply #16 - Jun 6th, 2003 at 3:01pm
RollerBall   Ex Member

 
Shocked

Blimey Jim - that was quick.

My gast is totally flabbered.....
 
IP Logged
 
Reply #17 - Jun 6th, 2003 at 4:04pm

Hagar   Offline
Colonel
My Spitfire Girl
Costa Geriatrica

Posts: 33159
*****
 
All these CFG entries did get a bit confusing. LOL
Can I just point something out.
Quote:
You can do all this in CfgEdit if you prefer.

 

...

Founder & Sole Member - Grumpy's Over the Hill Club for Veteran Virtual Aviators
Member of the Fox Four Group

Need help? Try Grumpy's Lair

My photo gallery
IP Logged
 
Reply #18 - Jun 6th, 2003 at 5:02pm

WebbPA   Ex Member
I Like Flight Simulation!

*
 
Sorry, Hagar,

I guess I should have asked you how to do it in CfgEdit.
 
IP Logged
 
Reply #19 - Jun 6th, 2003 at 5:07pm

Hagar   Offline
Colonel
My Spitfire Girl
Costa Geriatrica

Posts: 33159
*****
 
No problem. I guess I could have elaborated. As long as you fixed it. Wink
 

...

Founder & Sole Member - Grumpy's Over the Hill Club for Veteran Virtual Aviators
Member of the Fox Four Group

Need help? Try Grumpy's Lair

My photo gallery
IP Logged
 
Pages: 1 
Send Topic Print