Airbuspilot Posted October 18, 2023 Report Posted October 18, 2023 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: 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
John Dowson Posted October 18, 2023 Report Posted October 18, 2023 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
Airbuspilot Posted October 18, 2023 Author Report Posted October 18, 2023 Hey John, great Explanation. Thanks for the valuable Hints. I will now try to change the Code for displaying fixed Text Values. Hope, i can make it. If i have Questions, i hope for your great Help. Joachim
Airbuspilot Posted October 21, 2023 Author Report Posted October 21, 2023 Hey John, this Window Technic is great. Got highly Efforts on them. But i have a short Question. Is it possible to manipulate the Text except from the Font Height? I mean underlined and Bold. Joachim
John Dowson Posted October 22, 2023 Report Posted October 22, 2023 18 hours ago, Airbuspilot said: library document. JohnIs it possible to manipulate the Text except from the Font Height?lua I mean underlined and Bold. Yes, please see the provided documentation - look at the wnd.font function in the FSUIPC Lua Library documentation.
Airbuspilot Posted October 22, 2023 Author Report Posted October 22, 2023 If i understand the Manual in the right Way, those Commands are Manipulators for the whole Text in the Window. I wish to Manipulate several Lines of Text in the Window. Is this possible?
John Dowson Posted October 22, 2023 Report Posted October 22, 2023 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
Airbuspilot Posted October 23, 2023 Author Report Posted October 23, 2023 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: 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
John Dowson Posted October 23, 2023 Report Posted October 23, 2023 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")
Airbuspilot Posted October 26, 2023 Author Report Posted October 26, 2023 Thanks for your Help and sorry for complicating Things for you. This will never happen again.
Airbuspilot Posted October 26, 2023 Author Report Posted October 26, 2023 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. There is no Underline to see. Do you have any Hint for me please?
John Dowson Posted October 26, 2023 Report Posted October 26, 2023 Ok, I have just checked and none of the font options (bold, italic, under, strike) seem to be working. No idea why this is at the moment. I will look into this when time permits, but it will be a few days before I can get a chance to look into this in detail. John
John Dowson Posted October 26, 2023 Report Posted October 26, 2023 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
Airbuspilot Posted October 26, 2023 Author Report Posted October 26, 2023 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
John Dowson Posted October 26, 2023 Report Posted October 26, 2023 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
Airbuspilot Posted October 26, 2023 Author Report Posted October 26, 2023 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.
John Dowson Posted October 26, 2023 Report Posted October 26, 2023 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.
Airbuspilot Posted October 27, 2023 Author Report Posted October 27, 2023 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.
John Dowson Posted October 27, 2023 Report Posted October 27, 2023 I would hope that most people understand what is meant by add ....the comma is used there as this is the list of options that can be used. The meaning is perfectly clear and I see no reason to change this. John
Recommended Posts