Changeset 4325

Show
Ignore:
Timestamp:
07/30/08 09:52:50 (4 months ago)
Author:
nate
Message:

I ran into a class designer error where I deleted the root node in a dTreeView, and then right clicked on the context menu. The CD didn't like there being no nodes in the tree, so I changed it to where the delete this node option isn't available in the context menu if root is selected. Are you supposed to be able to delete a root node? If so, we will just have to add some special case code to check for no nodes and offer an add root option.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ide/ClassDesignerControlMixin.py

    r4262 r4325  
    333333                pop.append(_("Change Node Caption"),  
    334334                        OnHit=self.onChangeCaption) 
    335             pop.append(_("Delete this node"), OnHit=self.onDelNode) 
     335            if not self.activeNode.IsRootNode: 
     336                pop.append(_("Delete this node"), OnHit=self.onDelNode) 
    336337        elif isinstance(self, (dabo.ui.dLabel, dabo.ui.dButton, dabo.ui.dCheckBox, 
    337338                dabo.ui.dBitmapButton, dabo.ui.dToggleButton, dabo.ui.dPage,