RubberViews resizes window controls / Version 1.8 released

I have hijacked enough the thread https://forum.xojo.com/21525-elasticwindow-code-or-replacement/last and it is probably time to start a new thread. I will follow up James Redway’s last post :

[quote=180544:@James Redway]
As others have stated AutoLayOut can be rather tedious to work with - especially when you have scores of controls on a single window. It has not been determined when it will be released in Xojo desktop and how well it will work with desktop apps. I develop apps for customers who are running anything from a 1024 x 768 laptop to a 5120 x 2880 iMac. As it is now, simply anchoring controls to one edge just does not cut it for those users. It all comes down to the customer experience. [/quote]

If and when Auto Layout comes to Xojo Desktop, hopefully Xojo will try not to break existing code, as not be as demanding as what exists today in iOS. In fact, the present system is not unlike what Xojo layout constraint Left relative to view left, Top relative to view top, Width and Height are under iOS. If present code is compatible with Auto Layout, RubberViews which is written in pure Xojo code should work just fine.

At any rate I do intend to adapt if and when autolayout comes to desktop. As it stands now, having to set constraints for every control and the absence of content management make RubberViews better and simpler to implement. Besides, Desktop Auto Layout is to this day pure hypothesis.

Thank you for your support. I will do my best to be up to expectations.

Actually, I just placed 1.00 Trial for download at the link I posted before Rubberviews Trial

Now the site is up at http://RubberViews.com and I plan on making the formal announcement soon.

Having never used Elastic Windows, I cannot really tell you how it compares. I did have a look at the demo, but was less interested in copying it than just being curious. The best is probably to just try RubberViews. I think it has the keepRatio feature as a plus, that keeps circles circles and squares squares, but it is possible EW has it too.

From the other thread and the links in there, I already got a few things I plan to work on for version 2. I noted that SegmentedControl, PopupMenu and Combobox as well as button do not resize over 22 points in height in Mac OS X. This can be a problem on very large screens. I think I can come up with replacements that resize as they do on Windows. For buttons, the solution is to use rounded Bevel which under Yosemite look just like the regular button.

I also thought about the need to manage controls and subclasses that are not based on Container Control or on the controls presently in the library. Since they are not recognized automatically upon Init, I plan on adding a property where all custom control names could be listed, so RubberViews could record their position and size in Init, and change them in SizAll, as for regular controls.

I look forward for suggestions and comments.

Michel, do you have any documentation yet for RubberViews that we can look at? I’ve downloaded the demo (and looked at the website including the FAQ section) and played with it enough now to know I’m very interested. Call me daft, but in looking at the what I would need to do to make it play in one of my applications, I can’t quite figure it out. Since I’m a licensed owner of Elastic Window, and have used it in a number of applications I’ve created, I thought of duplicating one such application and replacing Elastic Window with RubberViews in one of the app copies so I would have a truly apples and apples comparison by running the two apps side-by-side simultaneously. I can tell you from what I’ve observed so far that your demo does the expansion/contraction of controls incredibly smoothly!

And FWIW, I share James Redways opinion that Christian (Pariahware) serviced my needs very efficiently and effectively the few times I had either questions or problems. I’m sorry to see him “give up the ghost” and wish him well but glad we have someone like you around to fill the gap. Bravo, Michel!

i take my application and change the stock search to use RubberView and client search with ElasticWindow.

i notice that on the screen using RubberView, the tab panel is really really tiny.

Sorry for the crudeness of the manual. I will work on making it better.

To use RubberViews, simply copy the class to your project, then drag an instance on each window you want to resize controls on.

  • In the Open event, add
RubberViews1.Init(Self)
  • In the Resizing or Resized event, or both,
RubberViews1.SizAll(self)

Init has a couple more parameters you may want to use, which are the dimensions of the window at design, such as

RubberViews1.Init(self,1280,800)

That is necessary on Windows if the screen has a lower resolution than the window (like 1024x768).

SizAll has also additional parameters. Here is an excerpt from the Readme.pdf file within the archive :
noContentResize as its name indicates, makes RubberViews resize controls but not font sizes or pictures.

RubberViews1.SizAll(Self, True)

KeepRatio will insure that no matter the shape of the resized window, controls will keep their original aspect ratio. This is important for circles and squares, for instance.

RubberViews1.SizAll(Self, False, True)

[quote=180575:@Richard Duke]i take my application and change the stock search to use RubberView and client search with ElasticWindow.

i notice that on the screen using RubberView, the tab panel is really really tiny.[/quote]

Normally, RubberViews does not change the design time size. It just picks it up in Init, and changes it in SizAll if the window has changed size. Make sure you have at least RubberViews1.Init(self) in Open, and RubberViews1.SizAll(self) in the Resized/Resizing events.

i did… i just copy the code in the open, resize and resizing event… and those picture is the running application.

Oh, I see. There we are bumping into one of the main limitations of the Mac OS X platform. Like buttons and other controls such as SegmentedControl and PopupMenus, Tabpanel resizes as a whole, but does not resize the tabs beyond 22 pts height. I will change the text size inside, like EW does, but it will hit a limit due to the size of the tabs themselves.

I will add TabPanel to the custom resizeable controls list I plan for version 2.

I just noticed the text size can be increased in groupboxes as well. I will add that tomorrow.

My apologies, Michel … turns out I really was daft! Until I saw this line in your reply, I didn’t even see that ReadMe.pdf file in the archive. I guess I was too anxious to try it out and jumped on the .xojo file a bit too quickly. After now looking at that ReadMe, it would have worked more than adequately to show me how to use RubberViews in my application. I’d like to believe I was “blind” and not daft … regardless, the problem was between my ears, not your documentation. ^^

I use Custom UI (i’m sure you’re aware of it), will this be compatible with those?

It’s alright, Don. No need for apologies. I will add large portions of the read me on the site as well. It will be easier to find.

I believe it should. RubberViews supports all the basic controls available in Xojo, and from what I see, Jérémie employs Canvases as basis for a lot of his controls. I did not test with his product, but you can do it by downloading RubberViewsTrial . It is fully functional, apart from a MsgBox.

I have sent a message to him , too.

One of the things that Autolayout does is first goes around and asks each control how big it wants to be, the it eventually goes around and, based on solving the constraints including compressions and hugging etc resizes and lays out things based on the results.
See session 103 from the 2011 WWDC videos about 27 minutes in til about 30 minutes
Very educational

Michel and myself are going to test RubberViews with CustomUI.

I don’t believe there will be incompatibility, I will post a new message here as soon as it is tested.

[quote=180612:@Norman Palardy]One of the things that Autolayout does is first goes around and asks each control how big it wants to be, the it eventually goes around and, based on solving the constraints including compressions and hugging etc resizes and lays out things based on the results.
See session 103 from the 2011 WWDC videos about 27 minutes in til about 30 minutes
Very educational[/quote]

Auto Layout is indeed able of much more than an automatic resize of all the window controls that one calls in two methods total. The goal of RubberViews was never to replace an eventual Auto Layout, but to provide me with an immediate way to cover a 2x ratio between 1024x768 and 1920x1080 (now 2550x1600 and up). It started back in 2013 as a personal tool much before Auto Layout was mentioned in the forum.

That said, I did add features that are in the realm of treating controls on an individual basis. For instance by making one keep its ratio while changing size, or have the content resize or not. It would not be terribly difficult to add constraints for how much a particular control is enabled to grow. I already placed such limits just today to the way TestSize can grow within Mac OS controls whose height cannot increase, such as PopupMenu and ComboBox, or TabPanel.

Now by definition, RubberViews and the like work with a centralized code that sets left, top, size and content size for all controls. That is quite different from the intricate management of relationships done by Auto Layout. The question is always the existing solutions today versus the ideally conceivable tomorrow. I am sure when the time comes, Xojo Desktop Auto Layout will be quite impressive. But this time is not even slated, as I understand.

I just posted version 1.01 at http://fontmenu.com/xojo/RubberViewsTrial.zip

It now resizes text within TabPanel buttons, as well as GroupBoxes labels.

On Mac OS X, since PopupMenu, GroupBoxes, TabPanel buttons cannot resize in height, I allow TextSize to grow, but only up to 16, so it does not outgrow the control and become cut, as was very unpleasant in ComboBoxes. I also worked quite a bit on PushButtons, which now resize in height as expected.

Resizing should be a bit smoother, too.

From https://forum.xojo.com/14616-elastic-window-up-for-grabs/last

As I said, I have worked quite a bit on that aspect, and discovered amazing things about Cocoa buttons. In Windows, things are simple : one type of button, and it resizes any way you want.

In Mac OS X, things are not quite as simple. Ten different button styles to chose from. Take the plain, out of the box button with Push Style. Does not size vertically. If one increases the size of the control, it simply slides down. But make it Default True, and it becomes a whole new ball game. The blue button resizes height indeed, but completely erratically. For instance, instead of the standard 22 height, just make it 23. Shazam, the actual height of the button turns 15 ! Make it 15, and it turns 18 instead ! Additionally, when all buttons allow changing the text size, it does not. That must be the famous horse of a different color :wink:

As I said, I spent quite a bit of time tracking the Cocoa buttons goblins,and got them behaved with great efforts. I intend to try some declares too eventually, but at this time, here are the button styles that resize in Height :

  • Push when made Default (OK)
  • Gradient
  • Textured
  • Square
  • Bevel

These may be the choice if one needs buttons that resize in height.

These button styles do not resize :

  • Rounded
  • Recessed
  • Rounded Textured
  • Round
  • Help

I have made sure they get properly placed and sized horizontally. I also made sure the text cannot grow too big for its own good, as is seen in Elastic Windows, and the opportunistically recently released ElastiControls (how strange). PopupMenus even become downright unreadable. RubberViews keeps your controls clean. I guess real work is sometimes better than a quickly put together contraption. Especially, it takes actual, real life experience of Mac OS X development, which I may know a thing or two about. After all, seventeen apps currently in the MAS speaks for itself…

I wouldn’t call them opportunistic… the real opportunity was the name RUBBER VIEWS. +1

RubberViews manages all the UI Controls fine. I just verified. Jérémie Leroy builds his controls on canvas, so they are recognized immediately by RubberViews.

Some other publishers controls will require additional work. For instance, I just verified that dtPlugins can be added to RubberViews, and I plan on adding a version of the class that recognizes them. I quickly touched upon custom controls in the documentation, but to be more complete, it is not possible for Xojo to recognize a control type if the plugin is not in the plugins folder. So I cannot support unknown plugins as default, unless they are subclasses of regular controls.

The workaround is to place these controls on top of a canvas and lock them, so they will resize with it. But if anybody has particular needs, I welcome any request.

Same thing for other developers who produce custom controls ; I will be glad to see how to support them.

Can’t wait to try the WE version when it arrives, Michel :slight_smile:

Just an update about custom controls : now RubberViews supports ALL controls, including custom controls, such as dtPlugins which are not subclasses of regular Xojo controls. By supporting RectControl, RubberViews manages everything : declare classes, plugins, etc.

To provide management of content (fonts, pictures, styles) though requires some adaptations, since by definition these controls have methods of their own. But I will be glad to provide assistance to implement content management.

You can get a peek of it working on the site mail form at http://rubberviews.com/cgi-bin/m/mail.cgi but this is just a very elementary job. At the moment the Alpha manages all Xojo controls and subclasses,. The final version is still some weeks away. I need to make sure it plays well with WebSDK and JavaScript.

You see, it is not so difficult to use the RubberViews engine to create a quick implementation for WE. But if possible, I want to go beyond and make it real seamless, and provide services specific to WE. You will understand I keep the details for myself until the beta, as competition seems so eager to undercut.

Fact is, the release of RubberViews is a happenstance. If it was not for James Redway insisting for me to get it out of my lab, I would have kept it for myself. I like sharing, though, and was happy to provide a nice replacement to the unfortunately departed Elastic Window. My original drive is nothing but the enjoyment of meeting a programming challenge. Because the core of my business is elsewhere, and, personally, I am not desperate at all to cash on third party tools. I enjoyed perfecting it, and enhancing the Mac support. I will eventually add more in the next version.

Since I am also in the process of developing a touch enabled Windows app for Windows tablets, I use RubberViews everyday and that forces me to meet the challenge of that particular platform. Building a Metro UI in Xojo seems trivial, when in fact it is quite a set of challenges. I shall put together an article for XDev soon sharing all the solutions I found.

Just developing a new program in Xojo Desktop with @Michel Bujardet RubberViews. It is fantastic!

Lots of options to fine-tune the interface, easy to setup, looks professional, and more!! If you need to dynamically change the size of controls in your window, then this is the software to get.

Great work Michel!

[quote=198364:@Eugene Dakin]Just developing a new program in Xojo Desktop with @Michel Bujardet RubberViews. It is fantastic!

Lots of options to fine-tune the interface, easy to setup, looks professional, and more!! If you need to dynamically change the size of controls in your window, then this is the software to get.

Great work Michel![/quote]

Eugene, you have enlightened my day. I am glad you like the result. Coming from you, it is quite an honor. Thank you for the word of mouth.

Confidentially (smile), I am continuing work, and hope to add soon content support for major custom controls. Also, as one can imagine, the Auto Layout technology already available in the Xojo Web edition. No release date yet, but it is in the works.