Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] Custom Draw TreeItems


Hi Philipp,

(note that swt usage questions like this should be asked on the eclipse.platform.swt newsgroup, not on this mailing list)

TreeItem checkboxes cannot be disabled, and I wouldn't suggest trying to fake this.

Regarding the custom draw approach, you can override the native drawing of an item's selection by removing the SWT.SELECTED bit from its EraseItem event's detail.  So you can probably do this by listening for MouseDown in order to detect a click within an item's drawn checkbox, and when this happens, assuming that the item was not already selected, unselect the item and veto the drawing of its selection in subsequently received EraseItem event(s).

HTH,
Grant




"Huebner, Philipp" <Philipp.Huebner@xxxxxxxxxxx>
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx

08/25/08 11:57 AM

Please respond to
"Eclipse Platform SWT component developers list."        <platform-swt-dev@xxxxxxxxxxx>

To
"Eclipse Platform SWT component developers list." <platform-swt-dev@xxxxxxxxxxx>
cc
Subject
RE: [platform-swt-dev] Custom Draw TreeItems





or is there any other possibility to disable ther checkboxes for particular TreeNodes?
 
 

Philipp Hübner
Softwareentwickler


Teraport GmbH

Aschauer Straße 32
D-81549 München

Tel.:   +49 (0)89 651086-711
Fax:    +49 (0)89 651086-711

philipp.huebner@xxxxxxxxxxx
Web:
http://www.teraport.de/

-----Original Message-----
From:
platform-swt-dev-bounces@xxxxxxxxxxx [mailto:platform-swt-dev-bounces@xxxxxxxxxxx] On Behalf Of Huebner, Philipp
Sent:
Monday, August 25, 2008 5:32 PM
To:
Eclipse Platform SWT component developers list.
Subject:
[platform-swt-dev] Custom Draw TreeItems

Hello together,
 
I try to create some custom drawn fake checkboxes in a tree viewer. I can draw the new (unchecked) image in my tree. But i don't know how to catch events when the user presses the mouse button down and prevent selection for this item when the user clicks the checkboxArea, cause my mouseListener->mouseDown events are always after the selectioning in the viewer....
 
thx
 
 

Philipp Hübner
Softwareentwickler


Teraport GmbH

Aschauer Straße 32
D-81549 München

Tel.:   +49 (0)89 651086-711
Fax:    +49 (0)89 651086-711

philipp.huebner@xxxxxxxxxxx
Web:
http://www.teraport.de/ _______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top