I have a (desktop) container control containing a label, a couple of canvases, and a textfield. It gets instantiated and embedded into two other containercontrols at runtime to make a scrolling list. It’s been 36 pixels high for a long time. Now I want to make it taller, so I made it taller in the IDE - it’s 178 pixels high. When I run the app, however, it’s alway 36 pixels high. I even exported it and dragged it back into the project - still 36 pixels high.
In the layout editor for the cc:
Breakpointed where the cc is being embedded: Height = 36
Do you have an instance on a layout that you are cloning from? If so, you’ll need to change the size there too.
There is no prototype container, I apparently create them out of thin air.
A possibly related oddness is that one of the subclassed canvases in the ContainerControl in question has no Height property in the IDE
I’ve made lots of controls subclassed from Canvas in the past and have never seen this before AFAIK.
That’s caused by unchecking the visibility box of the property in the Inspector Behavior dialog. Unfortunately it makes the property invisible in the editor too so you’ll need to fix it in your source file.
Could you show the code that you use to create these containers?
Just thinking about this… you didn’t happen to hide that property because you shadowed the Height property in your subclass by any chance?
dim CLI as new ChecklistControl
After having its properties populated, CLI gets embeddedWithin the inner container of the scrolling list
I thought of that, but no. There’s no method called “Height” either.
Height doesn’t appear anywhere in Inspector Behavior
Right it wouldn’t appear there. You’ll have to look at that object in text or xml format on disk.
What does it say the height is at this point?
Thanks, that led me to the source of the problem, which is poorly-written code: buried in the class is a method that sets the height to hard-coded values
Thanks for the debugging help.
@Greg_O how do you make the property visible again in the inspector behavior, if by mistake you unchecked it ? it happened in one of my class and I’m unable to make it visible again… the property is in the class, but the inspector doesn’t show it. it is shown in the superclass, and it’s not shadowed by a subclass property I checked. thanks.
You need to find it in the ViewBehavior section of the text or xml project.
and if the project is in binary ? I must save as text or xml, modify it and reopen it ?
my class is in an external item, do I need to search in the class file, or in the project ?
You can’t fix it in a binary project as is. I agree that it’s not optimal but it’s also something that Xojo would have to fix for us.
I remember having a discussion with NP shortly after the change was made and the problem is that there needed to be two states for visibility. One for “Internal” that Xojo could use for making things not visible to users and one for “visible” which allowed users to determine which ones were visible in their own classes. Unfortunately this is an implementation issue that goes all the way back to when the dialog was introduced in Real Studio. Do I think that it’s impossible to fix? No. Do I think that it’s going to get refactored anytime soon? Also no.