[Drawkit] DKKnob color and layers

Brad Larson larson at sonoplot.com
Fri Aug 15 14:23:45 PDT 2008


I added layer support to our drawing program and was wondering the  
correct way to go about customizing the coloring of DKKnobs and  
objects within the layer.  What I want to do is have each layer  
represent a different solution that we'd print on a surface, so I'd  
like for the color of the objects within a layer to reflect the  
layer's color.  I can do this by setting a layer-wide DKStyle that is  
changed when the layer's color is changed.  Subclassing DKLayer is the  
best way I can think of doing this, unless DKLayers can store metadata  
like DKDrawings and DKDrawableObjects and I'm not seeing it.

The part that I'm not sure about is how to set all the control knobs  
and selection borders to a neutral color, like light blue or black, so  
that they don't become lost in the drawable objects that are now the  
same color as the layer.  I'm a little lost as to where to do this.

Also, for a more general case, I noticed that the controlOnPointColour  
property of DKKnob is never set, so line beginning and end knobs are  
always orange.  That can make it difficult to tell what layer a  
DKDrawablePath belongs to because the orange knobs are more prominent  
than the thin selection line running down the middle of the path.   
Again, I couldn't figure out where the best place would be to set the  
controlOnPointColour property so that it would match the layer's  
selection color.
______________________
Brad Larson
SonoPlot, Inc.
3030 Laura Lane, Suite 120
Middleton, WI 53562





More information about the Drawkit mailing list