Page 1 of 1

Disabling a Group Box Control

Posted: Thu Oct 27, 2016 2:35 pm
by Robert
If I set a Guard on a Group Box to set par.disabled := TRUE nothing seems to happen.

I seem to remember that the Box, and its caption, used to go grey. Anyway, I think it should go grey.

I am currently using BlackBox 1.6 on Windows 7, but I'm pretty sure this also applies to 1.7.


Is this a bug?

(Actually the Box is grey anyway, so I'm really just talking about the caption text.)

Re: Disabling a Group Box Control

Posted: Thu Oct 27, 2016 4:28 pm
by manumart1
Check that the guard is actually executing, e.g.:

Code: Select all

PROCEDURE G* (VAR par:Dialog.Par);
BEGIN
	Log.String("Guard"); Log.Ln;
	IF x = 1 THEN par.disabled := TRUE
	ELSE par.disabled := FALSE
	END;
END G;

Re: Disabling a Group Box Control

Posted: Thu Oct 27, 2016 6:24 pm
by Robert
Very very odd.

I've put both a Caption and a Group Box on the same form, and set their Guards simultaneously, so there is no possibility of there being a spelling mistake on just one.

The Caption goes grey, the Group Box does not.

This test was using BlackBox 1.7 on Windows 7 64-bit Professional.

My previous test was BlackBox 1.6 on Windows 7 64-bit Enterprise.

What operating system are you using?

Re: Disabling a Group Box Control

Posted: Fri Oct 28, 2016 7:32 am
by manumart1
Yes, there is something wrong.

I am using BlackBox 1.7 (built 694). Under Wine (Linux) the label of the Group Box is greyed out via Guard, but it does not under Windows 7 Professional 64 bits.
GroupBox Guard.png
(6.94 KiB) Not downloaded yet

Re: Disabling a Group Box Control

Posted: Fri Oct 28, 2016 12:02 pm
by Josef Templ
This anomaly is caused by a difference in the implementation of COMCTL32.dll or related library.
If you switch back to XP style by removing the BlackBox.exe.manifest file it works.
I have tested this under Vista and XP.
wine seems to ignore the manifest or it has been removed.

- Josef

Re: Disabling a Group Box Control

Posted: Tue Nov 01, 2016 7:49 pm
by Robert
Josef Templ wrote:This anomaly is ...
If you switch back to XP style by removing the BlackBox.exe.manifest file it works.
Yes. In my current task having the Group boxes greyed-out when not relevant looks much better. It provides better user feedback.

I don't, immediately, notice other changes when I disable the Manifest file. I guess it depends on what options you have chosen; mine are pretty much Windows 7 defaults. Does disabling this file cause other problems?

Re: Disabling a Group Box Control

Posted: Wed Nov 02, 2016 1:14 pm
by Josef Templ
It changes the look of various controls slightly but in general I think the old look,
without the manifest, was better. I have not encountered any problems so far.

I don't know if there is an official statement from Microsoft why and if they have changed the look
of group controls or if there is another reason for the difference. In principle it is possible that
there is a subtle combination of flags required somewhere to get the desired behavior.
Unless, of course, there is a design principle behind it, viz. that group controls should be
static parts of a form that do not change their appearance under any condition.

I would expect that there is a document somewhere that describes such design principles but
I don't know where.

- Josef

Re: Disabling a Group Box Control

Posted: Thu Nov 03, 2016 8:22 am
by Josef Templ
I have found the following page on msdn:
https://msdn.microsoft.com/en-us/librar ... 42405.aspx.

It says explicitly: "Don't disable group boxes. To indicate that a group of controls doesn't currently apply, disable all the controls within the group box, but not the group box itself. This approach is more accessible and can be supported consistently by all UI frameworks." as part of the design guidelines.

I don't know what effects on accessibility it refers to and which UI frameworks may have a problem with that.
But it is possible that this feature has been removed in the newer COMCTL32.dll.

- Josef

Re: Disabling a Group Box Control

Posted: Thu Nov 03, 2016 8:43 am
by Robert
Thanks for that.

I would have thought that disabling an irrelevant Group Box would "reduce visual clutter".

Re: Disabling a Group Box Control

Posted: Mon May 20, 2019 7:02 pm
by TheRaven
Technically, disabling the group box container would be the way to go, contrasting the whole manually disabling individual controls, more closely adhering to the concept of "context"; each child control fit within a context (identified by the group control) and if that "context" has yet to be instantiated or out of scope then inheritance dictates the entire group be identified and managed as such.

Some idioms are more true to form than others and in this case the idiosyncrasies identified at MSDN pertaining to deactivation of a group control is foolish and most likely carry over lunacy pre-win10. Definitely prefer the idea of accessibility controlled at the parent container level simplifying the process of group management (in this case child controls). I'm officially ignoring the MSDN recommendation governing the group control activation/deactivation thing.

Excellent discussion BTW --learned a lot with you all already; kind of liking it here right now.