Reposition/resize object when app maximized
I want if my program maximized, then the object inside it will be resized/repositioned, just like FusionManager by Sphax. If the program maximized, the IconView object will become larger, the buttons is repositioned etc. How to do it? Thanks in advance.
Sorry for my english..
Re: Reposition/resize object when app maximized
Use the window control object...
Then (window control object) 'On maximized'...
Then (window control object) 'On minimized'...
Re: Reposition/resize object when app maximized
yeah I know that but I asking for the action to reposition/resize the object inside the frame when app is maximized/minimized.
Re: Reposition/resize object when app maximized
...ooowwwkaay.
lets say for example; you want the title(a string in this case) to move to the left when the window is a maximized.
+On maximized
-set x position to (string width *0.5)
+On maximized (not)
-set position to (window width *0.5)+(string width *0.5)
Re: Reposition/resize object when app maximized
If you provide your file, I would be happy to (attempt to) implement it for you.
Re: Reposition/resize object when app maximized
For each object you will need to calculate the percentage of change and then increae or decrease the x,y position and the height and width of each object.
There really needs to be an extension designed to do this I believe.
In the Window Control you can get the height and width of the client area. The x and y of the frame should be 0, 0.
Lets take a simple example. I have a frame that is 640 x 480 when the program starts. I have one object, a quick backdrop,
that is 320 x 240. The quick backdrop is located in the center of the client area. The frame's x and y positon is 0, 0.
The x position of the backdrop is (640-320)/2.
The y position of the backdrop is (480-240)/2.
So the margin of space around the backdrop is 25% of the client area.
So the x and y of the backdrop will always be 25% of the size of the client area no matter what size the client area becomes.
So now your program ONRESIZE will need to recompute the x,y positon of the backdrop relative to the client area as it changes.
Next, is to have the program determine the new height and width of the backdrop relative to the new size of the client area also.
The width will be 320/640 or 50%.
The height will be 240/480 or 50%.
The new width of the backdrop will be .5 * (New width of client area)
The new height of the backdrop will be .5 * (New heidht of client area).
(You are getting the client width and height from the Windows Control as you ONRESISE the window.)
Summary: You would need to do this for every object on the frame.
Thats why an extention would be helpful.
However, with some objects like the datagrid or Static Text you still might have issues to consider. For example, with the datagrid the overall size would increase or decrease but the columns don't, so you could endup with a lot of gray space unless you also compute a new size for the columns. But I don't believe you can set the column widths in the program with the current object.
Text fonts also can cause issues and may not look good if enlarged for example.
Hope this helps.
Re: Reposition/resize object when app maximized
wow, what a long explanation...
Thank you droberson! I will try it!
But I will be glad if someone make me an example :)