Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Disabled controls not greyed out

716 views
Skip to first unread message

Cafetorium

unread,
Mar 30, 2010, 9:00:03 AM3/30/10
to
From Delphi 7, when support for Windows XP was added (and the
TXPManifest class).
This has continued through to D2009 (which is the latest version I
have).

If you disable a control directly, it greys out as normal.
If you disable a container object (such as a Panel or GroupBox), the
contained controls are disabled, but not greyed out.

In earlier versions of Delphi, (or maybe it was earlier versions of
Windows), when you disabled a container object, it greyed out all the
contained items. I often have controls on invisible Panels (with no
bevel) and enable or disable them by means of Checkboxes or
RadioButtons, but as the contained controls are no longer greyed out,
although the controls are enabled/disabled correctly, there's no
visual feedback to indicate it.

Since this change was introduced, I've just been disabling/enabling
all the controls individually or writing a method to disable/enable
all the child controls of the container.

To me, it seems like a step backwards.

Is there any way of restoring the original behaviour in XP so that
everything gets greyed out when I disable the containing Panel?

I suspect that it has all changed again in Vista and/or Windows 7, but
the place where I work is still using XP and delivering XP on a legacy
turnkey system, so I'm stuck with XP.

Phil

Rob Kennedy

unread,
Mar 31, 2010, 12:12:03 AM3/31/10
to
Cafetorium wrote:
> From Delphi 7, when support for Windows XP was added (and the
> TXPManifest class).
> This has continued through to D2009 (which is the latest version I
> have).

In the Delphi lineage, it began with Turbo Pascal for Windows 1.0.

> If you disable a control directly, it greys out as normal.
> If you disable a container object (such as a Panel or GroupBox), the
> contained controls are disabled, but not greyed out.

Well, no, they're not disabled. Check their Enabled properties to see
for yourself. Their *parent* is disabled, and if the parent changed its
appearance, it would appear grayed out.

> In earlier versions of Delphi, (or maybe it was earlier versions of
> Windows), when you disabled a container object, it greyed out all the
> contained items.

You're mistaken. Delphi has never behaved that way. If your programs did
that, then it's because *you* made them do that.

> I often have controls on invisible Panels (with no
> bevel) and enable or disable them by means of Checkboxes or
> RadioButtons, but as the contained controls are no longer greyed out,
> although the controls are enabled/disabled correctly, there's no
> visual feedback to indicate it.
>
> Since this change was introduced, I've just been disabling/enabling
> all the controls individually or writing a method to disable/enable
> all the child controls of the container.

Good. That's what everyone else does when they want that behavior, too.

> To me, it seems like a step backwards.

Nope. Your diagnosis of the problem is not correct. The problem lies
elsewhere.

> Is there any way of restoring the original behaviour in XP so that
> everything gets greyed out when I disable the containing Panel?

No.

> I suspect that it has all changed again in Vista and/or Windows 7, but
> the place where I work is still using XP and delivering XP on a legacy
> turnkey system, so I'm stuck with XP.

If disabling a window meant explicitly disabling all its children, then
any time you displayed a modal dialog box, the parent window's controls
would get grayed out. You have never witnessed that happen in any other
program, so it must not be the way the OS works.

--
Rob

Cafetorium

unread,
Mar 31, 2010, 8:05:14 AM3/31/10
to
On Mar 31, 5:12 am, Rob Kennedy <m...@privacy.net> wrote:
> Cafetorium wrote:

> > If you disable a control directly, it greys out as normal.
> > If you disable a container object (such as a Panel or GroupBox), the
> > contained controls are disabled, but not greyed out.
>
> Well, no, they're not disabled. Check their Enabled properties to see
> for yourself. Their *parent* is disabled, and if the parent changed its
> appearance, it would appear grayed out.
>
> > In earlier versions of Delphi, (or maybe it was earlier versions of
> > Windows), when you disabled a container object, it greyed out all the
> > contained items.
>
> You're mistaken. Delphi has never behaved that way. If your programs did
> that, then it's because *you* made them do that.
>

>--
>Rob

Ok, I must be mistaken. Perhaps it was some other development tool.
It was a long time ago.

I have written a method which when passed a container object enables
or disables all the controls contained therein, thus achieving what I
want. I have now put that method in a unit that I can easily add to
any project.

Thanks for your help, Rob.

Phil

0 new messages