Objects resize to window?

Hi all,

I’m playing around some more, and am a bit stuck with something -

I’m placing things in the window… I have a few things places around.

I want everything to resize when the window is resized, so the text blocks, list boxes, and the such, will all move and resize to the window?

Thanks.

You’re looking for RubberViews!
It just happens to be part of a bundle right now too.
http://xjbundle.com

As great as that is, I’m not in the position to be buying anything right now.

I was hoping there was a simpler solution, or a free one.

The simpler and more basic solution is to use the locking properties of controls to allow them to resize or move as the window size changes.

Thank you!

Might you have a wiki article or anything that you could point me towards?

I had assumed you tried the locks and didn’t like the way it sized…
Here’s the manual
You’re going to want Book 2: User Interface

You could try ElasticControls (http://www.xojodevspot.com/download.php?view.100).

But my recommendation is RubberViews (http://rubberviews.com/). It is not that expensive, all the heavy lifting is done for you, and it just works.

RubberViews: I hadn’t gotten around to using it until now, but want to use it in my upcoming game, to allow it to play inside a 1366x768 window with a consistent look font wise, even if the user has their system on larger fonts (125%, etc). I have the window so it can’t be resized, so that isn’t an issue. This has caused me no end of grief using VB6.

Will RubberViews work for that purpose? The window has a graphic in the Backdrop, and some text labels (using TrueType fonts) and canvas graphics.

I placed the RubberViews item from the RubberViews_Classes onto the window, put the following code in the Open event:

RubberViews1.Init(Self) RubberViews1.SizAll(Self)

Is that all I need to do to accomplish this? Will this work even in Windows 7, where fonts are known to be handled oddly?

RubberViews1SizAll(self)

must go into the Resizing and Resized events.

Then everything will be resized automatically, and the scale is taken care as well.

For canvases, backdrop will be resized automatically. But you must make sure everything in Paint is proportional to the size of the canvas. Otherwise, you can replace by RubberCanvas, which will also resize what is in Paint.

For the window backdrop, you want to set StretchWindowBackdrop true, so whatever size the window takes, the graphic will be resized as well.

RubberViews is compatible with Windows XP, Windows Vista, Windows 7, Windows 8.x and Windows 10.

[quote=243388:@Michel Bujardet]RubberViews1SizAll(self)
must go into the Resizing and Resized events.[/quote]

This is true of the fonts as well, and applies even if the window itself isn’t resizable?

Yes.

Thanks. I think I should be ok now.

Just one last thing: does “RubberViews1.SizAll(Self)” need to go in the Window Open event as well, or just “RubberViews1.Init(Self)” in Open?

[quote=243616:@Derek DiBenedetto]Thanks. I think I should be ok now.

Just one last thing: does “RubberViews1.SizAll(Self)” need to go in the Window Open event as well, or just “RubberViews1.Init(Self)” in Open?[/quote]

Just RubberViews1.Init(Self) .

This all explained here http://rubberviews.com/ReadMe.htm

And of course I am here if you need clarification.

Thanks!

Actually, the manual doesn’t specify where to put the resizing code, which is why I was confused. It just states where to put the Init, then says:

“Then to have the controls resized
RubberViews1.SizAll(Self)”

Going to test it out on a Win7 system with 125% fonts now. Thanks for the help!

You are right, the manual did not tell where SizAll was to go. I have corrected that. Thank you.

I wrote you an email about an issue…just in case it went to your spam folder. Thanks!

Yes. I got it. It seems indeed that Windows 7 has its way of addressing font size scaling.

Working on that.

Thank you.

OK.

Windows 7 has indeed a strange way of addressing text size only, which throws off RubberViews.

The workaround consists into setting the textsize in the Open event of the controls, to reinstate the design size.

For instance

Me.TextSize = 12

will keep a label textsize the same as what would have happened with setting System font, size zero, in the IDE, and font scaling was at 100%.

I know it is some work to implement, but that is the only way I found to go around Windows 7 text scaling. Afterward, RubberViews will give you results proportional to your design.

Thanks for figuring that one out! I’d like to see design-time text size recording be a part of RubberViews, as it definitely would fix a lot of weird presentation issues with many people, as we’ve read on these threads. That way, I know, no matter what Windows version they have and no matter if their system font size is set to Normal or Large, it will always look the same on all systems. Don’t know if that could be built into the product, but just a request. :slight_smile:

Thanks for your hard work!

That would be great, but unfortunately just like the actual design time size of a window, that is only accessible in the project, not at run time.

All RubberViews knows is what it detects in the window Open with Init. By then, Windows 7 scaling has already modified the font sizes, and under Windows (the system) Windows (the control) that are bigger at design time than the screen will have been resized to fit.

So the only way to fix that is to inform RubberViews of the design size of the window in Init, and to reset the TextSize of controls to design size.