Exemple #1
0
        public ResourceTreePaneBase()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            _resourceTree                 = new ResourceListView2();
            _resourceTree.Dock            = DockStyle.Fill;
            _resourceTree.BorderStyle     = BorderStyle.None;
            _resourceTree.ContextProvider = this;

            TreeStructureColumn treeStructureColumn = new TreeStructureColumn();

            treeStructureColumn.Width = 20;
            _resourceTree.Columns.Add(treeStructureColumn);
            _resourceTree.Columns.Add(new ResourceIconColumn());

            _resourceTree.JetListView.KeyDown           += HandleResourceTreeKeyDown;
            _resourceTree.JetListView.ActiveNodeChanged += HandleActiveNodeChanged;
            _resourceTree.KeyNavigationCompleted        += HandleKeyNavigationCompleted;

            _textColumn = new RichTextColumn();
            _textColumn.SizeToContent       = true;
            _textColumn.ItemToolTipCallback = HandleToolTipCallback;
            _resourceTree.Columns.Add(_textColumn);

            Controls.Add(_resourceTree);
            Controls.SetChildIndex(_resourceTree, 0);

            _toolbarManager = new ToolbarActionManager(_toolBar);
            _toolbarManager.ContextProvider = this;

            _dataProvider = new ResourceTreeDataProvider();

            SetStyle(ControlStyles.Selectable, false);

            UnreadManager unreadManager = (UnreadManager)Core.UnreadManager;

            if (unreadManager.Enabled)
            {
                _unreadDecorator = new UnreadNodeDecorator();
                _textColumn.AddNodeDecorator(_unreadDecorator);
            }
        }
Exemple #2
0
        /// <summary>
        /// Populates toolbar with the controls and registers actions for them.
        /// </summary>
        protected void IntroduceActions()
        {
            // Re-create the toolbar action manager
            _actionmanager = new ToolbarActionManager(this);
            _actionmanager.ContextProvider = this;
            string sGroup;

            // General Edit actions
            sGroup = "Edit";
            _actionmanager.RegisterActionGroup(sGroup, ListAnchor.Last);
            _actionmanager.RegisterAction(new CommandProcessorAction("Undo"), sGroup, ListAnchor.Last, LoadImage("Undo"), "", "Undo", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("Redo"), sGroup, ListAnchor.Last, LoadImage("Redo"), "", "Redo", null, null);

            // Formatting actions
            sGroup = "Font";
            _actionmanager.RegisterActionGroup(sGroup, ListAnchor.Last);
            _actionmanager.RegisterAction(new CommandProcessorAction("Bold"), sGroup, ListAnchor.Last, LoadImage("RichEdit.Bold"), "", "Bold", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("Italic"), sGroup, ListAnchor.Last, LoadImage("RichEdit.Italic"), "", "Italic", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("Underline"), sGroup, ListAnchor.Last, LoadImage("RichEdit.Underline"), "", "Underline", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("StrikeThrough"), sGroup, ListAnchor.Last, LoadImage("RichEdit.StrikeThrough"), "", "Strike-out", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("Subscript"), sGroup, ListAnchor.Last, LoadImage("RichEdit.Subscript"), "", "Subscript", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("Superscript"), sGroup, ListAnchor.Last, LoadImage("RichEdit.Superscript"), "", "Superscript", null, null);

            // Alignment
            sGroup = "Paragraph";
            _actionmanager.RegisterActionGroup(sGroup, ListAnchor.Last);
            _actionmanager.RegisterAction(new CommandProcessorAction("JustifyLeft"), sGroup, ListAnchor.Last, LoadImage("RichEdit.JustifyLeft"), "", "Align Left", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("JustifyCenter"), sGroup, ListAnchor.Last, LoadImage("RichEdit.JustifyCenter"), "", "Center", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("JustifyRight"), sGroup, ListAnchor.Last, LoadImage("RichEdit.JustifyRight"), "", "Align Right", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("JustifyFull"), sGroup, ListAnchor.Last, LoadImage("RichEdit.JustifyFull"), "", "Justify", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("InsertOrderedList"), sGroup, ListAnchor.Last, LoadImage("RichEdit.InsertOrderedList"), "", "Numbering", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("InsertUnorderedList"), sGroup, ListAnchor.Last, LoadImage("RichEdit.InsertUnorderedList"), "", " Bullets", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("Outdent"), sGroup, ListAnchor.Last, LoadImage("RichEdit.Outdent"), "", "Decrease Indent", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("Indent"), sGroup, ListAnchor.Last, LoadImage("RichEdit.Indent"), "", "Increase Indent", null, null);

            // Insertions
            sGroup = "Insert";
            _actionmanager.RegisterActionGroup(sGroup, ListAnchor.Last);
            _actionmanager.RegisterAction(new CommandProcessorAction("CreateLink"), sGroup, ListAnchor.Last, LoadImage("RichEdit.CreateLink"), "", "Create Hyperlink", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("InsertHorizontalRule"), sGroup, ListAnchor.Last, LoadImage("RichEdit.InsertHorizontalRule"), "", "Insert Horizontal Line", null, null);
            _actionmanager.RegisterAction(new CommandProcessorAction("InsertImage"), sGroup, ListAnchor.Last, LoadImage("RichEdit.InsertImage"), "", "Insert Picture", null, null);
        }