예제 #1
0
 private void InsertElementActivated(object sender, InterfaceActivationEventArgs e)
 {
     ActivateDockElement(typeof(ElementInsertPanel), e);
 }
예제 #2
0
        private void ActivateDockElement(Type panelType, InterfaceActivationEventArgs e)
        {
            WidgetPanel dockElement = panels[panelType];
            if (dockElement == null)
                throw new InvalidOperationException("Failed to find panel for: " + panelType.ToString());

            if (dockElement.DockState != DockState.Hidden)
            {
                dockElement.Activate();
                e.Handled = true;
            }
        }
예제 #3
0
 private void ChangeElementActivated(object sender, InterfaceActivationEventArgs e)
 {
     ActivateDockElement(typeof(ElementChangePanel), e);
 }
예제 #4
0
 private void ChangeElementActivated(object sender, InterfaceActivationEventArgs e)
 {
     ActivateDockElement(dockElementChange, e);
 }
예제 #5
0
 private void InsertElementActivated(object sender, InterfaceActivationEventArgs e)
 {
     ActivateDockElement(dockElementInsert, e);
 }
예제 #6
0
        private void ActivateDockElement(DockableWindow dockElement, InterfaceActivationEventArgs e)
        {
            if (dockElement.DockSituation != DockSituation.None)
            {
                if (!dockElement.IsOpen)
                    dockElement.Open();

                dockElement.Activate();
                e.Handled = true;
            }
        }
예제 #7
0
 private void ChangeAttributesActivated(object sender, InterfaceActivationEventArgs e)
 {
     ActivateDockElement(dockAttributes, e);
 }
예제 #8
0
 //        private void InsertOrChangeElement(EventHandler handler, ICollection valid, ICollection all)
 //        {
 //            PopupElements ps=new PopupElements();
 //            ps.ElementList.ItemSelected+=handler;
 //
 //            ps.ElementList.ValidItems=valid;
 //            ps.ElementList.AllItems=all;
 //
 //            Point pt=caret.Location;
 //            pt.Offset(OffsetX, OffsetY);
 //            pt.Y+=caret.Height;
 //            pt.X=Math.Min(pt.X, VisibleRectangle.Width-ps.Width);
 //            pt.Y=Math.Min(pt.Y, VisibleRectangle.Height-ps.Height);
 //            ps.StartPosition=FormStartPosition.Manual;
 //            pt=PointToScreen(pt);
 //            ps.Location=pt;
 //
 //            ps.Show();
 //        }
 protected virtual void OnInsertElementActivated(InterfaceActivationEventArgs e)
 {
     if ( InsertElementActivated != null )
         InsertElementActivated(this, e);
 }
예제 #9
0
 protected virtual void OnChangeElementActivated(InterfaceActivationEventArgs e)
 {
     if ( ChangeElementActivated != null )
         ChangeElementActivated(this, e);
 }
예제 #10
0
        public virtual void EditModifyAttribute()
        {
            if ( doc == null || doc.DocumentElement == null )
                return;

            InterfaceActivationEventArgs ea=new InterfaceActivationEventArgs();
            OnChangeAttributesActivated(ea);
            if ( ea.Handled )
                return;

            AttributeChangePanel acp=new AttributeChangePanel();
            acp.EnableSelectionTracking=false;
            acp.Editor=this;

            ShowPopup(acp);
        }
예제 #11
0
        public void EditInsertElement()
        {
            if ( !licenceValid )
                return;

            InterfaceActivationEventArgs e=new InterfaceActivationEventArgs();
            OnInsertElementActivated(e);
            if ( e.Handled )
                return;

            if ( currentSelection.IsRange && !currentSelection.IsBalanced )
            {
                MessageBox.Show("The selection must be balanced in order to insert an element", "Insert Element", MessageBoxButtons.OK,  MessageBoxIcon.Information);
                return;
            }

            ElementInsertPanel eip=new ElementInsertPanel();
            eip.EnableSelectionTracking=false;
            eip.Editor=this;

            ShowPopup(eip);
        }
예제 #12
0
        public void EditChangeElement()
        {
            if ( doc == null )
                return;

            InterfaceActivationEventArgs e=new InterfaceActivationEventArgs();
            OnChangeElementActivated(e);
            if ( e.Handled )
                return;

            ElementChangePanel eip=new ElementChangePanel();
            eip.EnableSelectionTracking=false;
            eip.Editor=this;

            ShowPopup(eip);
        }