Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to detect ActiveItem in derived Table class (Read 1067 times)
MUDO
Junior Member
**
Offline



Posts: 90
Joined: Nov 29th, 2008
How to detect ActiveItem in derived Table class
Jun 10th, 2009 at 8:39pm
Print Post  
Hi!

I have my own class ClsMMTableNode derived from TableNode.
Im overriding DrawHandles sub because of drawing my own selection rectangle. I would like to create this behavior: selection rectangle of selected tables is gray and selection rectangle of ActiveItem is blue. How I know in DrawHandles sub if table (me) is ActiveItem in diagram? Now I perform this code:

Code
Select All
 Public Overrides Sub DrawHandles(ByVal graphics As MindFusion.Drawing.IGraphics, ByVal color As System.Drawing.Color)
        Dim LoColor As Color

        If Me.Parent.ActiveItem IsNot Nothing Then
            If Me.Parent.ActiveItem.Equals(Me) Then
                'me is active selected
                LoColor = Drawing.Color.Blue
            Else
                'me is not active selected
                 LoColor = Drawing.Color.Gray
            End If
        Else
            'nothing is selected
            LoColor = Drawing.Color.Gray
        End If
...
 



Thx.

...MUDO...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to detect ActiveItem in derived Table clas
Reply #1 - Jun 10th, 2009 at 8:55pm
Print Post  
Hi,

If you only need to change the selection rectangle color, set the ActiveItemHandlesColor and SelectedItemHandlesColor propertie. One of these values is passed as the "color" argument of DrawHandles, depending on whether the table is the ActiveItem.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint