Hmm - no, my prior suggestion doesn’t seem to work. I’m baffled : sometimes, the Label subclass has both a “Caption” and “Text” properties in the VCP-format file, and sometimes it doesn’t. I can remove the “Caption” line, but it sometimes comes back when I save the file again. I’m not sure what’s going on or how to fix it.
Ok, this is really bizarre. I have 2 projects (my old one, and a brand new one).
In the new one, the Label subclass works fine.
In the old one, the Label subclass misbehaves in two ways:
- each time I save the file, this line is added:
Caption = ""
- In the IDE properties window, the order of display is different:
* ID
* Appearance
* Control Set
* Locking
* Focus Control
etc.
In the version that works fine, the display is in this order:
[code]* ID
- Control Set
- Appearance
- Locking
- Focus Control
etc…
[/code]
So, clearly the IDE thinks these 2 label sublcasses are different. What’s weird is that I can look at the source code and they seem pretty much the same.
Here’s the Old label that misbehaves:
Begin cLabel stCustom1
AutoDeactivate = True
Bold = False
Caption = ""
DataField = ""
DataSource = ""
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = "rPlay"
Italic = False
Left = 21
LockBottom = False
LockedInPosition= False
LockLeft = True
LockRight = False
LockTop = True
Multiline = False
Scope = 0
Selectable = False
TabIndex = 0
TabPanelIndex = 0
Text = "Play"
TextAlign = 0
TextColor = &c00000000
TextFont = "SmallSystem"
TextSize = 0.0
TextUnit = 0
Top = 2
Transparent = True
Underline = False
Visible = True
Width = 32
End
The new one that works fine:
Begin cLabel Label11
AutoDeactivate = True
Bold = False
DataField = ""
DataSource = ""
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = "Rectangle1"
Italic = False
Left = 62
LockBottom = False
LockedInPosition= False
LockLeft = True
LockRight = False
LockTop = True
Multiline = False
Scope = 0
Selectable = False
TabIndex = 0
TabPanelIndex = 0
Text = "foobar on a rectangle"
TextAlign = 0
TextColor = &c00000000
TextFont = "System"
TextSize = 0.0
TextUnit = 0
Top = 133
Transparent = False
Underline = False
Visible = True
Width = 144
End
Norman, you there? Any idea why it’s working like this?
D’Oh! I think I figured it out, I’ll create a new thread as it’s probably not related to Kimball’s issue.
https://forum.xojo.com/4930-adding-caption-property-to-label-subclass-does-bad
Caption
Property shadowing
Amazed it ever worked right