Disabling a Group Box Control

All graphical and user interfaces problems

Disabling a Group Box Control

Postby Robert » Thu Oct 27, 2016 2:35 pm

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.)
User avatar
Robert
 
Posts: 137
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Disabling a Group Box Control

Postby manumart1 » Thu Oct 27, 2016 4:28 pm

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;
Attachments
GroupBox disabled.png
GroupBox disabled.png (1.54 KiB) Viewed 5948 times
manumart1
 
Posts: 67
Joined: Tue Sep 17, 2013 6:25 am

Re: Disabling a Group Box Control

Postby Robert » Thu Oct 27, 2016 6:24 pm

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?
User avatar
Robert
 
Posts: 137
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Disabling a Group Box Control

Postby manumart1 » Fri Oct 28, 2016 7:32 am

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
manumart1
 
Posts: 67
Joined: Tue Sep 17, 2013 6:25 am

Re: Disabling a Group Box Control

Postby Josef Templ » Fri Oct 28, 2016 12:02 pm

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
Josef Templ
 
Posts: 231
Joined: Tue Sep 17, 2013 6:50 am

Re: Disabling a Group Box Control

Postby Robert » Tue Nov 01, 2016 7:49 pm

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?
User avatar
Robert
 
Posts: 137
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Disabling a Group Box Control

Postby Josef Templ » Wed Nov 02, 2016 1:14 pm

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
Josef Templ
 
Posts: 231
Joined: Tue Sep 17, 2013 6:50 am

Re: Disabling a Group Box Control

Postby Josef Templ » Thu Nov 03, 2016 8:22 am

I have found the following page on msdn:
https://msdn.microsoft.com/en-us/library/windows/desktop/dn742405.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
Josef Templ
 
Posts: 231
Joined: Tue Sep 17, 2013 6:50 am

Re: Disabling a Group Box Control

Postby Robert » Thu Nov 03, 2016 8:43 am

Thanks for that.

I would have thought that disabling an irrelevant Group Box would "reduce visual clutter".
User avatar
Robert
 
Posts: 137
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Disabling a Group Box Control

Postby TheRaven » Mon May 20, 2019 7:02 pm

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.
TheRaven
 
Posts: 1
Joined: Mon May 20, 2019 6:47 pm


Return to GUI problems

Who is online

Users browsing this forum: No registered users and 1 guest

cron