Exemple #1
0
 protected override void OnExecute(EventArgs e)
 {
     if (ActiveTextBox != null)
     {
         // PropertyGrids handle copy/paste on their own - below check fixes issue #20
         if (!PropertyGridHelper.IsPropertyGridControl(ActiveTextBox.Parent))
         {
             ActiveTextBox.Paste();
         }
     }
     else if (SelectedNodes != null && UIController.Current.ClipboardObjects != null)
     {
         var pasteItems = UIController.Current.ClipboardObjects;
         var inserted   = UIController.Current.Handler.Actions.InsertObjects(pasteItems, SelectedNodes[0].Tag as ITabularNamedObject);
         foreach (var item in inserted.OfType <ITabularPerspectiveObject>())
         {
             item.Vis();
         }
         if (inserted.Count > 0)
         {
             UIController.Current.Goto(inserted[0] as ITabularNamedObject);
             UIController.Current.Elements.TreeView.BeginUpdate();
             foreach (var item in inserted)
             {
                 var node = UIController.Current.Elements.TreeView.FindNodeByTag(item);
                 if (node != null)
                 {
                     node.IsSelected = true;
                 }
             }
             UIController.Current.Elements.TreeView.EndUpdate();
         }
     }
     base.OnExecute(e);
 }
Exemple #2
0
        private void IntellisenseListBoxAutoComplete_DoubleClick(object sender, EventArgs e)
        {
            if (ActiveTextBox == null)
            {
                return;
            }

            IntellisenseListBox = (UIIntellisenseListBox)sender;
            // Item double clicked, select it
            if (IntellisenseListBox.SelectedItems.Count == 1)
            {
                WordMatched = true;
                SelectIntellisenseListBoxItem();
                IntellisenseListBox.Hide();

                if (ActiveGridView != null)
                {
                    ActiveGridView.ListBoxShown = false;
                }

                if (ActiveTextBox is UITextBox)
                {
                    ((UITextBox)ActiveTextBox).ListBoxShown = false;
                }
                else if (ActiveTextBox is UIScintilla)
                {
                    ((UIScintilla)ActiveTextBox).ListBoxShown = false;
                }

                ActiveTextBox.Focus();
                WordMatched = false;
            }
        }
 protected override void OnExecute(EventArgs e)
 {
     if (!DesignMode && ActiveTextBox != null)
     {
         ActiveTextBox.Copy();
     }
     base.OnExecute(e);
 }
 protected override void OnExecute(EventArgs e)
 {
     if (ActiveTextBox != null && ActiveTextBox.CanSelect)
     {
         ActiveTextBox.SelectAll();
     }
     base.OnExecute(e);
 }
Exemple #5
0
        private void IntellisenseListBoxAutoComplete_KeyDown(object sender, KeyEventArgs e)
        {
            // Ignore any keys being pressed on the listview
            if (ActiveTextBox == null)
            {
                return;
            }

            ActiveTextBox.Focus();
        }
Exemple #6
0
        private void IntellisenseListBoxAutoComplete_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Make sure when an item is selected, control is returned back to the richtext
            IntellisenseListBox = (UIIntellisenseListBox)sender;

            if (ActiveTextBox == null)
            {
                return;
            }

            ActiveTextBox.Focus();
        }
        protected override void OnExecute(EventArgs e)
        {
            if (ActiveTextBox != null)
            {
                ActiveTextBox.Cut();
            }
            else if (SelectedNodes != null)
            {
                // Copy objects represented by selected nodes to clipboard
                var json = Serializer.SerializeObjects(UIController.Current.Selection.OfType <TabularNamedObject>(),
                                                       Preferences.Current.Copy_IncludeTranslations, Preferences.Current.Copy_IncludePerspectives,
                                                       Preferences.Current.Copy_IncludeRLS, Preferences.Current.Copy_IncludeOLS, includeInstanceID: true
                                                       );
                Clipboard.SetText(json, TextDataFormat.UnicodeText);
                UIController.Current.Selection.Delete();
            }

            base.OnExecute(e);
        }
 protected override void OnExecute(EventArgs e)
 {
     if (ActiveTextBox != null)
     {
         // PropertyGrids handle copy/paste on their own - below check fixes issue #20
         if (!PropertyGridHelper.IsPropertyGridControl(ActiveTextBox.Parent))
         {
             ActiveTextBox.Copy();
         }
     }
     else if (SelectedNodes != null)
     {
         // Copy objects represented by selected nodes to clipboard
         var json = Serializer.SerializeObjects(UIController.Current.Selection.OfType <TabularNamedObject>(),
                                                Preferences.Current.Copy_IncludeTranslations, Preferences.Current.Copy_IncludePerspectives,
                                                Preferences.Current.Copy_IncludeRLS, Preferences.Current.Copy_IncludeOLS, includeInstanceID: true
                                                );
         Clipboard.SetText(json, TextDataFormat.UnicodeText);
     }
     base.OnExecute(e);
 }
        protected override void OnExecute(EventArgs e)
        {
            if (ActiveTextBox != null)
            {
                // PropertyGrids handle copy/paste on their own - below check fixes issue #20
                if (!PropertyGridHelper.IsPropertyGridControl(ActiveTextBox.Parent))
                {
                    ActiveTextBox.Paste();
                }
            }
            else if (SelectedNodes != null && UIController.Current.ClipboardObjects != null)
            {
                var pasteItems = UIController.Current.ClipboardObjects;
                var inserted   = UIController.Current.Handler.Actions.InsertObjects(pasteItems, SelectedNodes[0].Tag as ITabularNamedObject);

                if (inserted.Count > 0)
                {
                    UIController.Current.Goto(inserted[0] as ITabularNamedObject);
                }
            }
            base.OnExecute(e);
        }
Exemple #10
0
 private void rename()
 {
     if (this.Parent != null)
     {
         if (_editBox == null)
         {
             _editBox = new ActiveTextBox();
             this.Parent.Controls.Add(_editBox);
             _editBox.Initialize();
             _editBox.CancelEdit += new EventHandler(_editBox_CancelEdit);
             _editBox.FinishEdit += new EventHandler(_editBox_FinishEdit);
         }
         _editBox.Size = GetLabelSize();
         if (_editBox.Width < 80)
         {
             _editBox.Width = 80;
         }
         _editBox.Height      = _editBox.Height + 4;
         _editBox.TextBoxText = _name;
         _editBox.Location    = GetLabelLocation();
         _editBox.Visible     = true;
         ShowLabel(false);
     }
 }