Return-Path: X-Original-To: apmail-pivot-user-archive@www.apache.org Delivered-To: apmail-pivot-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A7BBD902C for ; Fri, 7 Oct 2011 09:01:04 +0000 (UTC) Received: (qmail 83353 invoked by uid 500); 7 Oct 2011 09:01:04 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 83334 invoked by uid 500); 7 Oct 2011 09:01:04 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 83326 invoked by uid 99); 7 Oct 2011 09:01:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Oct 2011 09:01:04 +0000 X-ASF-Spam-Status: No, hits=4.0 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of noelgrandin@gmail.com designates 74.125.82.182 as permitted sender) Received: from [74.125.82.182] (HELO mail-wy0-f182.google.com) (74.125.82.182) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Oct 2011 09:00:56 +0000 Received: by wyj26 with SMTP id 26so5026320wyj.13 for ; Fri, 07 Oct 2011 02:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=UuKV8AzlWsR9z3bBU2V+4WdCrOzsMCNZkb/DG7JlHRc=; b=p3eduhR251Ud72qsmxVcq/1ol51yZwFzDzOm69DfgMryqy9pq/wH9h74piSWyHf2cB 7Hn4V/lFhHbqylECfpq/KWYOJeZ9dgvZoknSq10C6ZguzkibB9aa4hJhi/DhxvChH4YK /exkfFS0AgvcnFFwj0x5ht45l0xUe8N/cqBkU= Received: by 10.216.229.196 with SMTP id h46mr488070weq.1.1317978035049; Fri, 07 Oct 2011 02:00:35 -0700 (PDT) Received: from [192.168.1.66] ([41.164.8.42]) by mx.google.com with ESMTPS id ei16sm14820117wbb.21.2011.10.07.02.00.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Oct 2011 02:00:33 -0700 (PDT) Message-ID: <4E8EBFBF.3000607@gmail.com> Date: Fri, 07 Oct 2011 11:00:47 +0200 From: Noel Grandin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5 Mnenhy/0.7.3.0 MIME-Version: 1.0 To: user@pivot.apache.org CC: Bill van Melle , Greg Brown Subject: Re: Component#isEnabled does not affect appearance recursively References: <0LSO00J0HDS8NUZ4@vms173001.mailsrvcs.net> In-Reply-To: Content-Type: multipart/alternative; boundary="------------090605050400030404070602" This is a multi-part message in MIME format. --------------090605050400030404070602 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Yes, Swing does it this way. It's tricky because sometimes you want setEnabled() to be recursive, and sometimes you don't. For example, sometimes you want to disable tabbing, so you call TabbedPane#setEnabled(false), but you don't want the children disabled. Personally, I think we should add a utility method setEnabledRecursive(boolean) to the container classes. -- Noel Grandin Bill van Melle wrote: > But I don't get why a component would ever want to paint itself to look like the user could interact with it if, in > fact, they can't. Wouldn't that be a violation of UI design principles? > > Are there other toolkits that do it the Pivot way? > > > On Thu, Oct 6, 2011 at 8:02 PM, Greg Brown > wrote: > > This is actually by design. The skins could paint their state based on isBlocked(), but that didn't seem like the > right thing to do (at least, not all the time). But maybe it is something that could be configured by a style. > > > ----- Reply message ----- > From: "Bill van Melle" > > Date: Thu, Oct 6, 2011 6:57 pm > Subject: Component#isEnabled does not affect appearance recursively > To: > > > For a long time, I've been thinking that Pivot does a particularly poor job of making disabled controls visually > different, but I finally realized what's going on. > If you have a simple component with enabled=false, it is rendered in a visually distinct "grayed-out" way, like > other toolkits do. However, if you have a container with enabled=false, its children render normally. If you > want a whole container to be disabled, and you want it to look like it's disabled, you have to disable the > children one by one (and keep track of which ones should remain disabled for when you want to re-enable the > container)! That's not true in other toolkits I've used. Am I missing something? > > I see there is a method Component#isBlocked, which provides the needed functionality, but it looks like it's only > being used by the event propagation code. Seems to me there is a whole lot of paint code in the system for which > something.isEnabled() ought to be replaced by !something.isBlocked(). Yes? > > --------------090605050400030404070602 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Yes, Swing does it this way.

It's tricky because sometimes you want setEnabled() to be recursive, and sometimes you don't.
For example, sometimes you want to disable tabbing, so you call TabbedPane#setEnabled(false), but you don't want the children disabled.

Personally, I think we should add a utility method setEnabledRecursive(boolean) to the container classes.

-- Noel Grandin


Bill van Melle wrote:
But I don't get why a component would ever want to paint itself to look like the user could interact with it if, in fact, they can't.  Wouldn't that be a violation of UI design principles?

Are there other toolkits that do it the Pivot way?


On Thu, Oct 6, 2011 at 8:02 PM, Greg Brown <gk_brown@verizon.net> wrote:
This is actually by design. The skins could paint their state based on isBlocked(), but that didn't seem like the right thing to do (at least, not all the time). But maybe it is something that could be configured by a style.


----- Reply message -----
From: "Bill van Melle" <bill.van.melle@gmail.com>
Date: Thu, Oct 6, 2011 6:57 pm
Subject: Component#isEnabled does not affect appearance recursively
To: <user@pivot.apache.org>

For a long time, I've been thinking that Pivot does a particularly poor job of making disabled controls visually different, but I finally realized what's going on.
If you have a simple component with enabled=false, it is rendered in a visually distinct "grayed-out" way, like other toolkits do.  However, if you have a container with  enabled=false, its children render normally.  If you want a whole container to be disabled, and you want it to look like it's disabled, you have to disable the children one by one (and keep track of which ones should remain disabled for when you want to re-enable the container)!  That's not true in other toolkits I've used. Am I missing something?

I see there is a method Component#isBlocked, which provides the needed functionality, but it looks like it's only being used by the event propagation code.  Seems to me there is a whole lot of paint code in the system for which something.isEnabled() ought to be replaced by !something.isBlocked().  Yes?


--------------090605050400030404070602--