Real Studio is pretty easy to learn. Navigation is pretty easy and switching between the layout and code editors is pretty straightforward for the most part. There are times, however, where the simplicity of Real Studio fights you.
Take for example, this report that comes with the examples folder. It has a number of layered controls (meaning the controls have a parent) and in this case, their are quite a few ReportLabel and ReportField controls on a ReportRectangle. In the layout editor this isn’t a big deal because the layout is simple. Click on any one of the controls and you can get its properties.
However, once you get into the code editor, all you see is a list of controls, sorted by name. There is absolutely no hierarchy that you can deduce from the list. It’s a major headache for complex layouts, in my opinion.
In my ideal world I’d love the ability to right-click on the item in the code editor and select ‘reveal’ (or similar) and have the layout editor displayed with the control selected. It would solve some headaches such as the occasional hiccup where Real Studio puts the child control outside of the visible region of the parent. When that happens, you can no longer see it. So how does one ‘select’ the control to either move it, delete it, or otherwise edit it?
You can easily do the opposite case. In the layout editor, right click on a control and use the “Edit Code” submenu to quickly get to an event in the code editor. However, for some reason, I rarely use this command.
The contextual menu (i.e. right-click) in the layout editor provides some nifty commands that you might not be aware of. The one we’re interested in, in this case, is the Select menu.
What the Select menu does, is give you a listing of all the controls, in their hierarchical, and alphabetical order. So in this example from one of my current projects shows a relatively simple hierarchy with a GroupBox control (SSFrame6) hosting two canvas controls (cvsHusband, cvsWife) hosting DateControls, Labels, RadioButtons and Pushbuttons.
In some instances, this might be the only way that I could select one of the controls. It’s easy enough to screw it up. Make the canvas big enough to fit all the controls in it and then reposition it and resize it so that none of the other controls are visible.
Once this happens you’ll never ‘see’ the control in the layout editor but the code behind the controls might be firing anyway (for example if you have code in their open events) which might cause some issues.
While I’m here I’ll make a plea for some common sense naming conventions. If you take a look at the RS example, GasReport.rbp above, you’ll notice that all the controls are using their default names. At a glance you can’t tell what Field1 vs Field10 does. This is one of those things that drives me crazy!
I see too many OPC (Other Peoples Code) projects every month to condone this behavior. If I were to get this project to fix, the first thing I’d do is name the major controls (I might skip labels – but only if they’re not referenced in code) so when I see them in the code editor I can, from a glance, see what their intent is.
I know this is nit-picky, but I see it time and time again. If you’ve subscribed to my Real Studio Video Training Series, you’ll note that I rarely leave the controls with their default name. The few times I do I tend to apologize for breaking my own ‘rule’. My thought behind this rule is that I’m not only coding for now, but for five years from now when I open the project again. I don’t want to have to switch between the code and layout editors to figure out what a pushbutton does. If it’s named properly I can tell its function.
Anyway, enough of the soapbox. I hope you learned something.
Any tricks that you’ve discovered in the IDE?