Group Box with no title

The second screen grab shows what happens when a group box title is set to blank. As can be seen it gets mangled. Expected (by me) behaviour is for the group box dimensions to remain unchanged and the outline to be displayed as continuous all the way around, i.e. no gap in the border at the top left unless I set the title to a space.

Thanks! We've fixed that for the next beta.

Either this fix didn't make it into the next beta or the problem has been reintroduced in a subsequent release. This is on 12.29.2.


<resources>
	<resource name="groupboxlabel" type="dialog">
		<dialog fontsize="8" height="74" lang="english" width="123">
			<control height="42" name="group1" title="" type="group" width="104" x="9" y="4" />
			<control height="14" name="button1" title="Group Label?" type="button" width="50" x="8" y="52" />
			<control height="14" name="Quit" title="Quit" type="button" width="50" x="62" y="52" />
			<control halign="left" height="8" name="static1" title="" type="static" valign="top" width="87" x="15" y="20" />
			<control halign="left" height="8" name="static2" title="" type="static" valign="top" width="87" x="15" y="32" />
		</dialog>
	</resource>
</resources>

Whilst tinkering with this I see another issue which is probably related to the original problem assuming my expectation of what should happen is correct. The attached test button demonstrates what happens vs what I expect to happen.

GroupBoxLabel.dcf (5.4 KB)

GroupBoxLabel1

Now click the label1 button which explicitly sets the group box label to the value label1. The displayed label does indeed change, as expected, but the underlying object property does not.

GroupBoxLabel2

Same anomaly when the label2 button is clicked.

GroupBoxLabel3

Clicking the blank label button sets the group box label to "" which demonstrates the original issue whereby the top border of the box shifts down to the half way point. In this demo it is partially obscured by the static control showing the first message.

GroupBoxLabel4

Clicking label1 again restores the top border of the box but does not remove the half way down stuff,

GroupBoxLabel5

The fix was just for the dialog editor shown in the root post. That's the only part Opus draws itself.

When the real dialog is on screen, Windows is drawing the group box controls. It probably always draws a small gap around the label, even if the label is an empty string.

With the other issues:

  • It resizing when set to an empty string seems to be something Windows is doing, at least as far as I can tell. We'll add a workaround that sets the label to a space if an empty string is requested, but you can also do the same in your code. (I am not sure when this change will go out.)

  • The issue with reading back the control object's label is already fixed in our long-term dev branch, so a fix for that will be coming in the future. The changes it's tied to are part of a much larger piece of work, however.

Thanks @leo for the comprehensive response. I already resort to " " instead of "" in my code when necessary and since setting the object label works correctly, reading it back reliably is not really a problem.

1 Like

We looked into this in some more detail and worked out why the empty label was causing that resize/painting issue. It was something we were doing, not Windows as I first thought.

We've fixed that internally and the fix will be included in the next beta, which also means the workaround of using a blank space won't be needed after that.

We've also made it close the gap so you get a solid line if there is no label set.

1 Like