How to autosize monitor-screen?

Post your Gambas programming questions here.
Post Reply
User avatar
Gamba_Dance
Posts: 11
Joined: Wednesday 30th September 2020 8:43am

How to autosize monitor-screen?

Post by Gamba_Dance »

Hi there,

since I have not found a solution so far, I would like to share a problem here. I have a small routine running on Gambas 3.12.2 that displays a menu card
with 4 different labels on one monitor. The problem occurs when the monitor resizes and the panels do not fit the new size afterwards. I have not found a
command or routine to solve this problem as there is no viable solution anywhere. Have any of you solved such a problem in the past? Help is needed.

Greetings from GD
Attachments
4-fach-Panel.jpg
4-fach-Panel.jpg (288.35 KiB) Viewed 1661 times
If even one line of "Hello World" program code requires an intelligent :idea: riginator, how can anyone claim that the human genome with 3,300,000,000 lines :o f intelligent code could have been created by chance :?:
User avatar
cogier
Site Admin
Posts: 1127
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: How to autosize monitor-screen?

Post by cogier »

Does the attached help?
MenuDisplay-0.0.1.tar.gz
(166.02 KiB) Downloaded 135 times
User avatar
Gamba_Dance
Posts: 11
Joined: Wednesday 30th September 2020 8:43am

Re: How to autosize monitor-screen?

Post by Gamba_Dance »

Hi cogier,

thank you and your script shows the final solution, the automatic size of the whole visible frame as it should be. You have used container elements like HBox and Panel.
You split the content into 4 png images. In my solution there is a lot of add-on programming behind the scene, for example each of the 4 labels and red stripes retrieves its own data from a database.
There are also other routines, but they are not important at this point. What I want to say is that I have to change everything that has to do with the output of the data on the screen,
because my used fields can't be converted to container elements only. That doesn't work. Either I program a conversion from the data fields into 4 separate .png as output (which could
work with your solution), or I have to change something in the programming code. Since this is internal company stuff, I can't publish the code.

Greetings GD
If even one line of "Hello World" program code requires an intelligent :idea: riginator, how can anyone claim that the human genome with 3,300,000,000 lines :o f intelligent code could have been created by chance :?:
User avatar
cogier
Site Admin
Posts: 1127
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: How to autosize monitor-screen?

Post by cogier »

I think I better understand what you are trying to do. Have a look at this code.

Image
MenuDisplay-0.0.2.tar.gz
(166.88 KiB) Downloaded 130 times
User avatar
Gamba_Dance
Posts: 11
Joined: Wednesday 30th September 2020 8:43am

Re: How to autosize monitor-screen?

Post by Gamba_Dance »

Super! :idea: Thanks much, because this solution gets the problem completely out of the way. I can now address the text fields with data from saved content and the size automatically adjusts to different monitor sizes. That's all I wanted. You've additionally added more fields to the panel than I need, but that's not a problem. I only need 2 fields per panel and can customize it that way.

Have a nice weekend 8-)
and many greetings from
GD
If even one line of "Hello World" program code requires an intelligent :idea: riginator, how can anyone claim that the human genome with 3,300,000,000 lines :o f intelligent code could have been created by chance :?:
Post Reply