Ejemplo n.º 1
0
 /// <summary>
 /// init an empty form, this gives us a Form to hook onto if we want to do stuff on the UI thread
 /// from a back groundthread, use : BeginInvoke()
 /// </summary>
 public static void Init()
 {
     _anchorForm = new NppEmptyForm {
         Location = new Point(-10000, -10000)
     };
     _anchorForm.Show(Npp.Win32Handle);
     _anchorForm.Visible = false;
 }
Ejemplo n.º 2
0
        public CodeExplorerForm(NppEmptyForm formToCover) : base(formToCover)
        {
            InitializeComponent();

            // add the refresh button to the filter box
            filterbox.ExtraButtons = new List <YamuiFilterBox.YamuiFilterBoxButton> {
                new YamuiFilterBox.YamuiFilterBoxButton {
                    Image  = ImageResources.Refresh,
                    OnClic = buttonRefresh_Click
                },
                new YamuiFilterBox.YamuiFilterBoxButton {
                    Image   = ImageResources.Collapse,
                    OnClic  = buttonExpandRetract_Click,
                    ToolTip = "Toggle <b>Expand/Collapse</b>"
                },
                new YamuiFilterBox.YamuiFilterBoxButton {
                    Image   = ImageResources.Numerical_sorting,
                    OnClic  = buttonSort_Click,
                    ToolTip = "Choose the way the items are sorted :<br>- Natural order (code order)<br>-Alphabetical order"
                },
                new YamuiFilterBox.YamuiFilterBoxButton {
                    Image   = ImageResources.Persistent,
                    OnClic  = ButtonPersistentOnButtonPressed,
                    ToolTip = "Toggle on/off <b>to display</b>, in the explorer, the functions and procedures loaded in persistent in this file"
                },
                new YamuiFilterBox.YamuiFilterBoxButton {
                    Image   = ImageResources.FromInclude,
                    OnClic  = ButtonFromIncludeOnButtonPressed,
                    ToolTip = "Toggle on/off <b>to display</b>, in the explorer, all the items loaded from include files"
                }
            };
            filterbox.Initialize(yamuiList);
            filterbox.ExtraButtonsList[1].BackGrndImage = _isExpanded ? ImageResources.Collapse : ImageResources.Expand;
            filterbox.ExtraButtonsList[2].BackGrndImage = Config.Instance.CodeExplorerSortingType == SortingType.Alphabetical ? ImageResources.Alphabetical_sorting : ImageResources.Numerical_sorting;
            filterbox.ExtraButtonsList[3].UseGreyScale  = !Config.Instance.CodeExplorerDisplayPersistentItems;
            filterbox.ExtraButtonsList[4].UseGreyScale  = !Config.Instance.CodeExplorerDisplayItemsFromInclude;

            Refreshing = false;

            yamuiList.ShowTreeBranches = Config.Instance.ShowTreeBranches;
            yamuiList.EmptyListString  = @"Nothing to display";

            // list events
            yamuiList.RowClicked   += YamuiListOnRowClicked;
            yamuiList.EnterPressed += YamuiListOnEnterPressed;
        }
Ejemplo n.º 3
0
        public FileExplorerForm(NppEmptyForm formToCover) : base(formToCover)
        {
            InitializeComponent();

            #region Current env

            // register to env change event
            ProEnvironment.OnEnvironmentChange += UpdateCurrentEnvName;

            UpdateCurrentEnvName();

            btEnvList.BackGrndImage  = ImageResources.Env;
            btEnvList.ButtonPressed += BtEnvListOnButtonPressed;
            toolTipHtml.SetToolTip(btEnvList, "Click to <b>open a menu</b> that allows you to quickly select another environment");

            btEnvModify.BackGrndImage  = ImageResources.ZoomIn;
            btEnvModify.ButtonPressed += BtEnvModifyOnButtonPressed;
            toolTipHtml.SetToolTip(btEnvModify, "Click to go to see the details of the current environment");

            toolTipHtml.SetToolTip(lblEnv, "Name of the currently selected environment");

            #endregion

            #region Current file

            // register to Updated Operation events
            FilesInfo.OnUpdatedOperation += FilesInfoOnUpdatedOperation;
            FilesInfo.OnUpdatedErrors    += FilesInfoOnUpdatedErrors;

            btPrevError.ButtonPressed           += BtPrevErrorOnButtonPressed;
            btNextError.ButtonPressed           += BtNextErrorOnButtonPressed;
            btClearAllErrors.ButtonPressed      += BtClearAllErrorsOnButtonPressed;
            btGetHelp.ButtonPressed             += BtGetHelpOnButtonPressed;
            btStopExecution.ButtonPressed       += BtStopExecutionOnButtonPressed;
            btBringProcessToFront.ButtonPressed += BtBringProcessToFrontOnButtonPressed;

            btPrevError.BackGrndImage           = ImageResources.Previous;
            btNextError.BackGrndImage           = ImageResources.Next;
            btClearAllErrors.BackGrndImage      = ImageResources.ClearAll;
            btGetHelp.BackGrndImage             = ImageResources.GetHelp;
            btGetHelp.UseGreyScale              = !Config.Instance.GlobalShowDetailedHelpForErrors;
            btStopExecution.BackGrndImage       = ImageResources.Stop;
            btBringProcessToFront.BackGrndImage = ImageResources.BringToFront;
            btStopExecution.Hide();
            btBringProcessToFront.Hide();

            UpdateErrorButtons(false);

            toolTipHtml.SetToolTip(btGetHelp, "Toggle on/off the <b>detailed help</b> for compilation errors and warnings");
            toolTipHtml.SetToolTip(btPrevError, "<b>Move the caret</b> to the previous error");
            toolTipHtml.SetToolTip(btNextError, "<b>Move the caret</b> to the next error");
            toolTipHtml.SetToolTip(btClearAllErrors, "<b>Clear</b> all the displayed errors");
            toolTipHtml.SetToolTip(lbStatus, "Provides information on the current status of the file");
            toolTipHtml.SetToolTip(btStopExecution, "Click to <b>kill</b> the current processus");
            toolTipHtml.SetToolTip(btBringProcessToFront, "Click to <b>bring</b> the current process to foreground");

            lbStatus.BackColor = ThemeManager.Current.FormBack;

            #endregion

            #region File list

            // add the refresh button to the filter box
            filterbox.ExtraButtons = new List <YamuiFilterBox.YamuiFilterBoxButton> {
                new YamuiFilterBox.YamuiFilterBoxButton {
                    Image  = ImageResources.Refresh,
                    OnClic = OnRefreshClic
                },
                new YamuiFilterBox.YamuiFilterBoxButton {
                    Image   = ImageResources.Collapse,
                    OnClic  = buttonExpandRetract_Click,
                    ToolTip = "Toggle <b>Expand/Collapse</b>"
                }
            };
            filterbox.Initialize(yamuiList);

            yamuiList.EmptyListString  = @"No files!";
            yamuiList.ShowTreeBranches = Config.Instance.ShowTreeBranches;

            toolTipHtml.SetToolTip(btGotoDir, "<b>Open</b> the current path in the windows explorer");
            toolTipHtml.SetToolTip(btDirectory, "Click to <b>change</b> the directory to explore");
            toolTipHtml.SetToolTip(lbDirectory, "Current directory being explored");

            btGotoDir.BackGrndImage    = ImageResources.OpenInExplorer;
            btGotoDir.ButtonPressed   += BtGotoDirOnButtonPressed;
            _explorerDirStr            = new[] { "Local path ", "Compilation path", "Propath", "Everywhere" };
            btDirectory.ButtonPressed += BtDirectoryOnButtonPressed;

            RefreshGotoDirButton();

            Refreshing = false;

            yamuiList.RowClicked   += YamuiListOnRowClicked;
            yamuiList.EnterPressed += YamuiListOnEnterPressed;

            #endregion
        }