Ejemplo n.º 1
0
 public NlmMenuItem(NlmTreeListView listView, String text, EventHandler <ClickEventArgs> clickEvents)
     : base(text)
 {
     ListView    = listView;
     NlmClick   += clickEvents;
     this.Click += new EventHandler(onClick);
 }
Ejemplo n.º 2
0
        public NlmButtonPanelRight(NlmTreeListView listView)
        {
            ListView = listView;
            listView.ButtonPanelRight = this;

            FlowDirection = FlowDirection.RightToLeft;
            Anchor        = AnchorStyles.Right;
            Margin        = new Padding(0);
            Dock          = DockStyle.Fill;

            InformationButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Information",
                "NestedLayerManager.Resources.Icons.Buttons.Information.png",
                ListView
                );
            InformationButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onInformation);
            this.Controls.Add(InformationButton);

            SettingsButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Settings",
                "NestedLayerManager.Resources.Icons.Buttons.Settings.png",
                ListView
                );
            SettingsButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onSettings);
            this.Controls.Add(SettingsButton);
        }
Ejemplo n.º 3
0
        public NlmCheckButton(Padding padding, Size size, String toolTipText, String iconDir, Boolean fadeOnChecked, NlmTreeListView listView)
        {
            ListView = listView;

            IconFull = new Bitmap(GetType().Module.Assembly.GetManifestResourceStream(iconDir));
            IconHalf = BitmapTools.ChangeOpacity((IconFull), (float)0.3);

            Appearance = Appearance.Button;
            FlatStyle  = FlatStyle.Flat;
            BackColor  = Color.FromArgb(0, 255, 255, 255);
            FlatAppearance.BorderSize         = 0;
            FlatAppearance.BorderColor        = Color.FromArgb(43, 120, 197);
            FlatAppearance.MouseDownBackColor = Color.FromArgb(154, 184, 225);
            FlatAppearance.MouseOverBackColor = Color.FromArgb(174, 204, 235);
            FlatAppearance.CheckedBackColor   = Color.FromArgb(174, 204, 235);
            Size                  = size;
            ImageAlign            = ContentAlignment.MiddleCenter;
            BackgroundImage       = IconFull;
            BackgroundImageLayout = ImageLayout.Center;
            Margin                = padding;
            Padding               = new Padding(0);
            ToolTipText           = toolTipText;
            FadeOnChecked         = fadeOnChecked;
            SetStyle(ControlStyles.Selectable, false);

            MouseEnter     += new EventHandler(ButtonMouseEnter);
            MouseLeave     += new EventHandler(ButtonMouseLeave);
            MouseDown      += new MouseEventHandler(ButtonMouseDown);
            MouseUp        += new MouseEventHandler(ButtonMouseUp);
            CheckedChanged += new EventHandler(CheckChanged);
        }
Ejemplo n.º 4
0
        public NlmMaxColorPicker(OlvListViewHitTestInfo hti, Boolean applyToSelection, NlmTreeListView listView)
        {
            ListView = listView;

            this.CurrentColor = (Color)ListView.NlmColumns.ColorColumn.GetValue(hti.RowObject);

            TreeNodes = new List <BaseTreeNode>();
            if (applyToSelection)
            {
                TreeNodes.AddRange(listView.NodeControl.Query.SelectedNodes);
            }
            else
            {
                TreeNodes.Add(hti.RowObject as BaseTreeNode);
            }

            this.ColorConfirmed += new ConfirmColorEventHandler(onColorChanged);
        }
Ejemplo n.º 5
0
 public NlmButton(Padding padding, Size size, String toolTipText, String iconDir, NlmTreeListView listView)
 {
     ListView  = listView;
     FlatStyle = FlatStyle.Flat;
     FlatAppearance.BorderSize = 0;
     BackColor = Color.FromArgb(0, 255, 255, 255);
     FlatAppearance.BorderColor        = Color.FromArgb(43, 120, 197);
     FlatAppearance.MouseDownBackColor = Color.FromArgb(154, 184, 225);
     FlatAppearance.MouseOverBackColor = Color.FromArgb(174, 204, 235);
     ImageAlign            = ContentAlignment.MiddleCenter;
     Size                  = size;
     Margin                = padding;
     Icon                  = new Bitmap(GetType().Module.Assembly.GetManifestResourceStream(iconDir));
     BackgroundImage       = this.Icon;
     BackgroundImageLayout = ImageLayout.Center;
     ToolTipText           = toolTipText;
     SetStyle(ControlStyles.Selectable, false);
     MouseEnter += new EventHandler(ButtonMouseEnter);
     MouseLeave += new EventHandler(ButtonMouseLeave);
     MouseDown  += new MouseEventHandler(ButtonMouseDown);
     MouseUp    += new MouseEventHandler(ButtonMouseUp);
     Click      += new EventHandler(ButtonClick);
 }
Ejemplo n.º 6
0
        public NlmContextMenu(NlmTreeListView listView)
        {
            ListView = listView;

            CreateLayer = new NlmMenuItem(
                ListView,
                "Create Layer",
                ClickEvents.onCreateLayer
                );
            CreateLayerAddSelection = new NlmMenuItem(
                ListView,
                "Create Layer (Add Selection)",
                ClickEvents.onCreateLayerAddSelection
                );

            CreateFolder = new NlmMenuItem(
                ListView,
                "Create Folder",
                ClickEvents.onCreateFolder
                );
            CreateFolderAddSelection = new NlmMenuItem(
                listView,
                "Create Folder (Add Selection)",
                ClickEvents.onCreateFolderAddSelection
                );

            MergeSelectedLayers = new NlmMenuItem(
                ListView,
                "Merge Selected Layers",
                ClickEvents.onMergeSelectedLayers
                );
            MergeSelectedFolders = new NlmMenuItem(
                ListView,
                "Merge Selected Folders",
                ClickEvents.onMergeSelectedFolders
                );

            DuplicateSelectionCopyCopy = new NlmMenuItem(
                ListView,
                "Duplicate Selection (Copy Layers, Copy Objects)",
                ClickEvents.onDuplicateSelectionCopyCopy
                );
            DuplicateSelectionCopyInstance = new NlmMenuItem(
                ListView,
                "Duplicate Selection (Copy Layers, Instance Objects)",
                ClickEvents.onDuplicateSelectionCopyInstance
                );
            DuplicateSelectionInstance = new NlmMenuItem(
                ListView,
                "Duplicate Selection (Instance Layers)",
                ClickEvents.onDuplicateSelectionInstance
                );

            DeleteSelection = new NlmMenuItem(
                ListView,
                "Delete Selection",
                ClickEvents.onDeleteSelection
                );
            DeleteObjectsInSelection = new NlmMenuItem(
                ListView,
                "Delete Objects in Selection",
                ClickEvents.onDeleteObjectsInSelection
                );
            DeleteEmptyLayers = new NlmMenuItem(
                ListView,
                "Delete Empty Layers",
                ClickEvents.onDeleteEmptyLayers
                );
            DeleteEmptyFolders = new NlmMenuItem(
                ListView,
                "Delete Empty Folders",
                ClickEvents.onDeleteEmptyFolders
                );

            IsolateSelection = new NlmMenuItem(
                ListView,
                "Isolate Selection",
                ClickEvents.onIsolateSelection
                );

            //Tempoarily disable unimplemented menuitems.
            MergeSelectedLayers.Enabled            = false;
            MergeSelectedFolders.Enabled           = false;
            DuplicateSelectionCopyCopy.Enabled     = false;
            DuplicateSelectionCopyInstance.Enabled = false;
            DuplicateSelectionInstance.Enabled     = false;
            DeleteObjectsInSelection.Enabled       = false;
            DeleteEmptyLayers.Enabled  = false;
            DeleteEmptyFolders.Enabled = false;

            // Add the MenuItem objects to the ContextMenu control.
            MenuItems.Add(CreateLayer);
            MenuItems.Add(CreateLayerAddSelection);
            MenuItems.Add(new MenuItem("-"));
            MenuItems.Add(CreateFolder);
            MenuItems.Add(CreateFolderAddSelection);
            MenuItems.Add(new MenuItem("-"));
            MenuItems.Add(MergeSelectedLayers);
            MenuItems.Add(MergeSelectedFolders);
            MenuItems.Add(new MenuItem("-"));
            MenuItems.Add(DuplicateSelectionCopyCopy);
            MenuItems.Add(DuplicateSelectionCopyInstance);
            MenuItems.Add(DuplicateSelectionInstance);
            MenuItems.Add(new MenuItem("-"));
            MenuItems.Add(DeleteSelection);
            MenuItems.Add(DeleteObjectsInSelection);
            MenuItems.Add(DeleteEmptyLayers);
            MenuItems.Add(DeleteEmptyFolders);
            MenuItems.Add(new MenuItem("-"));
            MenuItems.Add(IsolateSelection);
        }
Ejemplo n.º 7
0
        public NlmButtonPanelSide(NlmTreeListView listView)
        {
            ListView = listView;
            listView.ButtonPanelSide = this;

            FlowDirection = FlowDirection.TopDown;
            Margin        = new Padding(0);
            Dock          = DockStyle.Fill;

            FilterSelectAllButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Filter Select All",
                "NestedLayerManager.Resources.Icons.Buttons.FilterAll.png",
                ListView
                );
            FilterSelectAllButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onFilterSelectAll);
            this.Controls.Add(FilterSelectAllButton);

            FilterSelectNoneButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Filter Select None",
                "NestedLayerManager.Resources.Icons.Buttons.FilterNone.png",
                ListView
                );
            FilterSelectNoneButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onFilterSelectNone);
            this.Controls.Add(FilterSelectNoneButton);

            FilterInvertButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Filter Invert",
                "NestedLayerManager.Resources.Icons.Buttons.FilterInvert.png",
                ListView
                );
            FilterInvertButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onFilterInvert);
            this.Controls.Add(FilterInvertButton);

            BonesCheckButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "Bones",
                "NestedLayerManager.Resources.Icons.NodeClass.Bone.png",
                true,
                ListView
                );
            BonesCheckButton.Checked            = (listView.ModelFilter as NlmTreeNodeFilterEngine).IsFilterActive(TreeNodeFilter.Bone);
            BonesCheckButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onFilterBones);
            this.Controls.Add(BonesCheckButton);

            CameraCheckButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "Camera",
                "NestedLayerManager.Resources.Icons.NodeClass.Camera.png",
                true,
                ListView
                );
            CameraCheckButton.Checked            = (listView.ModelFilter as NlmTreeNodeFilterEngine).IsFilterActive(TreeNodeFilter.Camera);
            CameraCheckButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onFilterCamera);
            this.Controls.Add(CameraCheckButton);

            HelperCheckButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "Helper",
                "NestedLayerManager.Resources.Icons.NodeClass.Helper.png",
                true,
                ListView
                );
            HelperCheckButton.Checked            = (listView.ModelFilter as NlmTreeNodeFilterEngine).IsFilterActive(TreeNodeFilter.Helper);
            HelperCheckButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onFilterHelper);
            this.Controls.Add(HelperCheckButton);

            LightCheckButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "Light",
                "NestedLayerManager.Resources.Icons.NodeClass.Light.png",
                true,
                ListView
                );
            LightCheckButton.Checked            = (listView.ModelFilter as NlmTreeNodeFilterEngine).IsFilterActive(TreeNodeFilter.Light);
            LightCheckButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onFilterLight);
            this.Controls.Add(LightCheckButton);

            ObjectCheckButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "Object",
                "NestedLayerManager.Resources.Icons.NodeClass.Object.png",
                true,
                ListView
                );
            ObjectCheckButton.Checked            = (listView.ModelFilter as NlmTreeNodeFilterEngine).IsFilterActive(TreeNodeFilter.Object);
            ObjectCheckButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onFilterObject);
            this.Controls.Add(ObjectCheckButton);

            ShapeCheckButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "Spline",
                "NestedLayerManager.Resources.Icons.NodeClass.Shape.png",
                true,
                ListView
                );
            ShapeCheckButton.Checked            = (listView.ModelFilter as NlmTreeNodeFilterEngine).IsFilterActive(TreeNodeFilter.Shape);
            ShapeCheckButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onFilterShape);
            this.Controls.Add(ShapeCheckButton);

            SpaceWarpCheckButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "SpaceWarp",
                "NestedLayerManager.Resources.Icons.NodeClass.SpaceWarp.png",
                true,
                ListView
                );
            SpaceWarpCheckButton.Checked            = (listView.ModelFilter as NlmTreeNodeFilterEngine).IsFilterActive(TreeNodeFilter.SpaceWarp);
            SpaceWarpCheckButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onFilterSpaceWarp);
            this.Controls.Add(SpaceWarpCheckButton);

            LayerHiddenCheckButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "Hidden",
                "NestedLayerManager.Resources.Icons.Buttons.FilterHiddenLayers.png",
                true,
                ListView
                );
            LayerHiddenCheckButton.Checked            = (listView.ModelFilter as NlmTreeNodeFilterEngine).IsFilterActive(TreeNodeFilter.LayerHidden);
            LayerHiddenCheckButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onFilterLayerHidden);
            this.Controls.Add(LayerHiddenCheckButton);

            LayerFrozenCheckButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "Frozen",
                "NestedLayerManager.Resources.Icons.Buttons.FilterFrozenLayers.png",
                true,
                ListView
                );
            LayerFrozenCheckButton.Checked            = (listView.ModelFilter as NlmTreeNodeFilterEngine).IsFilterActive(TreeNodeFilter.LayerFrozen);
            LayerFrozenCheckButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onFilterLayerFrozen);
            this.Controls.Add(LayerFrozenCheckButton);
        }
Ejemplo n.º 8
0
        public NlmButtonPanelLeft(NlmTreeListView listView)
        {
            ListView = listView;
            listView.ButtonPanelLeft = this;

            Margin = new Padding(0);
            Dock   = DockStyle.Fill;

            CreateLayerButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Create Layer",
                "NestedLayerManager.Resources.Icons.Buttons.CreateLayer.png",
                listView
                );
            CreateLayerButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onCreateLayerAddSelection);
            this.Controls.Add(CreateLayerButton);

            InstanceLayersButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Instance Layer(s)",
                "NestedLayerManager.Resources.Icons.Buttons.InstanceLayer.png",
                listView
                );
            InstanceLayersButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onInstanceSelectedLayers);
            this.Controls.Add(InstanceLayersButton);

            CreateFolderButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Create Folder",
                "NestedLayerManager.Resources.Icons.Buttons.CreateFolder.png",
                listView
                );
            CreateFolderButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onCreateFolder);
            this.Controls.Add(CreateFolderButton);

            SmartFolderModeCheckButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "Smart Folder Mode",
                "NestedLayerManager.Resources.Icons.Buttons.SmartFolderMode.png",
                false,
                listView
                );
            SmartFolderModeCheckButton.Checked            = listView.SmartFolderMode;
            SmartFolderModeCheckButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onSmartFolderMode);
            this.Controls.Add(SmartFolderModeCheckButton);

            IsolateSelectedButton = new NlmCheckButton(
                new Padding(0),
                new Size(22, 22),
                "Isolate Selection",
                "NestedLayerManager.Resources.Icons.Buttons.IsolateSelection.png",
                false,
                listView
                );
            IsolateSelectedButton.NlmCheckedChanged += new EventHandler <ClickEventArgs>(ClickEvents.onIsolateSelection);
            this.Controls.Add(IsolateSelectedButton);

            DeleteSelectedButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Delete Selected",
                "NestedLayerManager.Resources.Icons.Buttons.DeleteSelected.png",
                listView
                );
            DeleteSelectedButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onDeleteSelection);
            this.Controls.Add(DeleteSelectedButton);

            AddSelectedObjectsToLayerButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Add Selected Objects To Layer",
                "NestedLayerManager.Resources.Icons.Buttons.AddSelectedObjectsToLayer.png",
                listView
                );
            AddSelectedObjectsToLayerButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onAddSelectedObjectsToLayer);
            this.Controls.Add(AddSelectedObjectsToLayerButton);

            SelectObjectsFromHighlightButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Select Objects Within Highlighted Selection",
                "NestedLayerManager.Resources.Icons.Buttons.SelectObjectsFromHighlight.png",
                listView
                );
            SelectObjectsFromHighlightButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onSelectObjectsFromHighlight);
            this.Controls.Add(SelectObjectsFromHighlightButton);

            SelectLayersFromSelectedObjectsButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Select Layers Of Selected Objects",
                "NestedLayerManager.Resources.Icons.Buttons.SelectLayersFromSelectedObjects.png",
                listView
                );
            SelectLayersFromSelectedObjectsButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onSelectLayersFromSelectedObjects);
            this.Controls.Add(SelectLayersFromSelectedObjectsButton);

            HideUnhideAllButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Hide / Unhide All",
                "NestedLayerManager.Resources.Icons.Buttons.HideUnhideAll.png",
                listView
                );
            HideUnhideAllButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onHideUnhideAll);
            this.Controls.Add(HideUnhideAllButton);

            FreezeUnfreezeAllButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Freeze / Unfreeze All",
                "NestedLayerManager.Resources.Icons.Buttons.FreezeUnfreezeAll.png",
                listView
                );
            FreezeUnfreezeAllButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onFreezeUnfreezeAll);
            this.Controls.Add(FreezeUnfreezeAllButton);

            CollapseExpandAllButton = new NlmButton(
                new Padding(0),
                new Size(22, 22),
                "Collapse / ExpandAll",
                "NestedLayerManager.Resources.Icons.Buttons.CollapseExpandAll.png",
                listView
                );
            CollapseExpandAllButton.NlmClick += new EventHandler <ClickEventArgs>(ClickEvents.onCollapseExpandAll);
            this.Controls.Add(CollapseExpandAllButton);
        }