Jump to content
The simFlight Network Forums

Non Aircraft specific Question - Changing Window Positions doesn' have an Effect.


Airbuspilot

Recommended Posts

Hi John,
in this Thread
       

you attached the FPS_MonitorW.lua.

As you documented in ther, i have just to change the Values in this Line of Code: 

image.thumb.png.36af82969d73d11db9cc8930c75e35fa.png

I have tried several Values, but there is no Effect. The Window Size and Position doesn't change.
Could you please explain, why there is no Change visible?

Thanks in Advance, Joachim 

Link to comment
Share on other sites

The specified size/position for ext/wnd windows is only used the first time the window is created - the position/size is then stored in your FSUIPC ini file, under the [ExtWindow] section, and this overrides any position/size specified when the window is created. If you want the new size/position to be used, delete the entry for this window under [ExtWindow].

It is implemented this way so that users can move and resize any such window to their preferred position. You can move and resize such windows by using the arrow keys to move, and ctrl + arrow keys to resize, when the window has the focus. The new size/position is then remembered for the next session.

So the size/position coordinates in the creation are only ever used the very first time the window is created.

Hope that makes sense.

John

Link to comment
Share on other sites

4 minutes ago, Airbuspilot said:

If i understand the Manual in the right Way, those Commands are Manipulators for the whole Text in the Window.

No, you don't understand in the right way - this is the key paragraph that you seem to be missing:

The font details apply for text drawn from then until the font is changed again, so any mix can be used in one window.

 

5 minutes ago, Airbuspilot said:

I wish to Manipulate several Lines of Text in the Window. Is this possible?

Yes, of course. You set the font style you want to use, write those lines, set the next font style, write those lines, rinse and repeat....

John

 

Link to comment
Share on other sites

May i please you, to help me out? I understand, what you have texted, but i don't have any Idea, how to code it.
I will give you a short Overview of my Window:

These are the Font Settings adapted from your Example:
-- These set the colours and font to be used.
wnd.backcol(w, 0x000)
wnd.textcol(w, 0x6c0)
wnd.font(w, WND_ARIAL,64)

And this is a Part of my Window Code:
image.thumb.png.3089fb1c4ed42d1daf3fe56fad1a9e5f.png

On the left Side, you can see the Line Numbers in the Code.
Could you please give a short Code Example, how to set the Text in LineNbr. 30 to Bold and underlined and to reset them back to normal at LineNbr. 31 and further?
I know, you normally code not for your Customers. But i would highly appreciate a little Help.
Thanks a lot in Advance

Joachim 

Link to comment
Share on other sites

You don't make things easy...please paste text rather than pictures, as I can then copy adjust and paste...
This is explained in the documentation and I have also explained this - I do not understand why this is so difficult for you to understand...

wnd.backcol(w, 0x000)
wnd.textcol(w, 0x6c0)
wnd.font(w, WND_ARIAL,64)
wnd.txt(w, "This text is normal")
wnd.font(w, WND_ARIAL,64,WND_BOLD)
wnd.txt(w, "This text is in bold")
wnd.font(w, WND_ARIAL,64)
wnd.txt(w, "This text is normal again")

 

Link to comment
Share on other sites

Sorry for asking again.
This is from your Example before except from the Time Values. 
    fstime = string.format("%02d:%02d:%02d", ipc.readUB(0x0238), ipc.readUB(0x0239), ipc.readUB(0x023A))
    zulu = string.format("%02d:%02d:%02d", ipc.readUB(0x0238) - 2, ipc.readUB(0x0239), ipc.readUB(0x023A))

    wnd.font(w, WND_ARIAL,64,WND_UNDER)    
    wnd.text(w, "Arbeitsliste FBW A20N" .. "    Local Time " .. fstime  .. "    Zulu Time ".. zulu)
Unfortunately it seems not to work. I expected an Underline, but this is the Result.
image.thumb.png.45cb38edace5f684c04ac55796250022.png
There is no Underline to see. Do you have any Hint for me please?

 

Link to comment
Share on other sites

Took a quick look and the problem was a lot easier than I thought - it was just that the global definitions for WND_ITALIC, etc hadn't been defined. Also the globals for the font specification weren't defined, so even font selection wasn't working.

I have corrected this in the attached version, 7.3.25d. if you would like to try.

John

FSUIPC7.exe

Link to comment
Share on other sites

Tried the new Version. Works okay. But i got a Question about Multi Combinations like this:
    wnd.font(w, WND_ARIAL,64, WND_UNDER, WND_BOLD)
This shows the Text Underlined but not Underlined and Bold as expected.

Tried several Writings like this:
    wnd.font(w, WND_ARIAL,64)
    wnd.font(w, WND_UNDER, WND_BOLD)
   wnd.text(w, "Arbeitsliste FBW A20N" .. "    Local Time " .. fstime  .. "    Zulu Time ".. zulu)
This shows the so small, that is unreadable.
Is there a Solution for?

Joachim

Link to comment
Share on other sites

5 minutes ago, Airbuspilot said:

wnd.font(w, WND_ARIAL,64, WND_UNDER, WND_BOLD)
This shows the Text Underlined but not Underlined and Bold as expected.

As the documentation states:

The options can be any mix of these (add them together):WND_BOLD, WND_ITALIC, WND_UNDER, WND_STRIKE.

So it would be:
    wnd.font(w, WND_ARIAL,64, WND_UNDER, + WND_BOLD)
As I have said, can you please consult the documentation before asking such questions. If it doesn't work according to the documentation, then post.

5 minutes ago, Airbuspilot said:

Tried several Writings like this:
    wnd.font(w, WND_ARIAL,64)
    wnd.font(w, WND_UNDER, WND_BOLD)

That obviously won't work, i don't understand why you would even try that as there is no such function for that second call. Again, please read the documentation.

John

Link to comment
Share on other sites

So, where is my Fault?
I issued this Command: wnd.font(w, WND_ARIAL,64, WND_UNDER, WND_BOLD)
That doesn't work.

From where should i know, that those Attributes had to be combined with a +?
Is this stated anywhere in the Docs? I didn't find it.

Anyway thank you for the Help.

Link to comment
Share on other sites

23 minutes ago, Airbuspilot said:

Is this stated anywhere in the Docs? I didn't find it.

Yes, and I quoted it in my previous comment....again:

The options can be any mix of these (add them together):WND_BOLD, WND_ITALIC, WND_UNDER, WND_STRIKE.

 

24 minutes ago, Airbuspilot said:

So, where is my Fault?
I issued this Command: wnd.font(w, WND_ARIAL,64, WND_UNDER, WND_BOLD)
That doesn't work.

Of course that doesn't work. As stated in the document, the signature for this function (when using options) is:

bool = wnd.font(w, face, size, options)

and not

bool = wnd.font(w, face, size, option, option)

which is what you were trying. That doesn't exist.

Link to comment
Share on other sites

14 hours ago, John Dowson said:

Yes, and I quoted it in my previous comment....again:

The options can be any mix of these (add them together):WND_BOLD, WND_ITALIC, WND_UNDER, WND_STRIKE.

Okay, Thats what is stated in the Docs. Do you see a + Sign in here?
I can add them together. Maybe you should explain this more clearly that this only works with the + Sign and not as stated here with the , Sign.

But anyway, thanks for the Help.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.