Exemple #1
0
 public ThreadsUI(PluginMain pluginMain, ImageList imageList)
 {
     this.AutoKeyHandling = true;
     this.pluginMain      = pluginMain;
     lv = new ListViewEx();
     lv.ShowItemToolTips          = true;
     this.imageColumnHeader       = new ColumnHeader();
     this.imageColumnHeader.Text  = string.Empty;
     this.imageColumnHeader.Width = 20;
     this.frameColumnHeader       = new ColumnHeader();
     this.frameColumnHeader.Text  = string.Empty;
     lv.Columns.AddRange(new ColumnHeader[] {
         this.imageColumnHeader,
         this.frameColumnHeader
     });
     lv.FullRowSelect     = true;
     lv.BorderStyle       = BorderStyle.None;
     lv.Dock              = System.Windows.Forms.DockStyle.Fill;
     lv.SmallImageList    = imageList;
     runningImageIndex    = imageList.Images.IndexOfKey("StartContinue");
     suspendedImageIndex  = imageList.Images.IndexOfKey("Pause");
     lv.View              = System.Windows.Forms.View.Details;
     lv.MouseDoubleClick += new MouseEventHandler(lv_MouseDoubleClick);
     lv.KeyDown          += new KeyEventHandler(lv_KeyDown);
     lv.SizeChanged      += new EventHandler(lv_SizeChanged);
     this.Controls.Add(lv);
     ScrollBarEx.Attach(lv);
 }
        public MenuControl(AutocompleteMenu menu)
        {
            this.menu = menu;

            Margin  = Padding.Empty;
            Padding = Padding.Empty;

            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
            ImeMode = ImeMode.Off;

            SuspendLayout();

            vScrollBar             = new ScrollBarEx(true, menu.scheme);
            vScrollBar.SmallChange = 1;
            vScrollBar.Cursor      = Cursors.Default;
            vScrollBar.Scroll     += OnVScroll;
            vScrollBar.Visible     = false;
            scrollBarWidth         = vScrollBar.Width;
            Controls.Add(vScrollBar);

            ResumeLayout(false);
        }
Exemple #3
0
 public CategoryGames(AppManager manager)
     : base(manager)
 {
     InitializeComponent();
     _previousGameID = -1;
     scroller        = null;
 }
Exemple #4
0
 public ImmediateUI()
 {
     this.AutoKeyHandling = true;
     this.InitializeComponent();
     this.contextMenuStrip.Renderer = new DockPanelStripRenderer(false);
     this.history = new List <string>();
     ScrollBarEx.Attach(textBox);
 }
Exemple #5
0
 public CategoryGames(AppManager manager, List <Game> games, Dictionary <String, Category> cats)
     : base(manager, games, cats)
 {
     InitializeComponent();
     _previousGameID = -1;
     scroller        = null;
     UpdateUI();
 }
Exemple #6
0
 /// <summary>
 /// Apply theming properties to the controls
 /// </summary>
 private void ApplyTheming()
 {
     PluginBase.MainForm.SetUseTheme(this, this.UseTheme);
     if (this.UseTheme)
     {
         ScrollBarEx.Attach(this, true);
         PluginBase.MainForm.ThemeControls(this);
     }
 }
        private void InitializeControls()
        {
            if (_games != null)
            {
                if (_gameCards == null)
                {
                    _gameCards = new List <FoundedGameCard>();
                }

                this.Clear();

                _countItems = 0;
                foreach (MyAbandonGameFound game in _games)
                {
                    FoundedGameCard card = new FoundedGameCard();
                    SetupCard(card);
                    card.GameData   = game;
                    card.Tag        = _countItems;
                    card.IsSelected = (_countItems == 0);
                    card.Visible    = true;

                    this.Controls.Add(card);
                    _gameCards.Add(card);

                    _countItems++;
                }

                //As I default the first element to be selected I need to raise the event
                _currentlySelected = 0;
                if (GameSelected != null)
                {
                    GameSelected(this, _gameCards[0].GameData);
                }

                //Now checking if it is necessary to add the scrollbar
                if ((_gameCards.Count * 150) > this.Height)
                {
                    scroller = new ScrollBarEx();
                    scroller.BringToFront();
                    scroller.Orientation = ScrollBarOrientation.Vertical;
                    scroller.BorderColor = Color.FromArgb(64, 64, 64);
                    scroller.Dock        = DockStyle.Right;
                    scroller.Visible     = true;
                    scroller.Maximum     = (_gameCards.Count - 1) * 85;
                    scroller.Scroll     += scroller_Scroll;
                    this.MouseWheel     += cards_MouseWheel;
                    this.Controls.Add(scroller);
                }
                else if (scroller != null)
                {
                    scroller.Scroll -= scroller_Scroll;
                    scroller.Dispose();
                    scroller = null;
                }
            }
        }
Exemple #8
0
 public StackframeUI(PluginMain pluginMain, ImageList imageList)
 {
     this.AutoKeyHandling = true;
     this.pluginMain      = pluginMain;
     wholeFrameStack      = new List <ListViewItem>();
     InitializeComponents(imageList);
     InitializeContextMenu();
     InitializeLocalization();
     ScrollBarEx.Attach(lv);
 }
Exemple #9
0
 public PluginUI(PluginMain pluginMain)
 {
     this.AutoKeyHandling = true;
     this.pluginMain      = pluginMain;
     this.InitializeComponent();
     this.InitializeContextMenu();
     this.InitializeGraphics();
     this.InitializeTexts();
     ScrollBarEx.Attach(layoutsListView);
 }
Exemple #10
0
        private void InitializeControls()
        {
            if (_imageURIs != null)
            {
                this.Controls.Clear();
                if (_screenshots == null)
                {
                    _screenshots = new List <Screenshot>();
                }
                _screenshots.Clear();

                _countItems = 0;
                foreach (string uri in _imageURIs)
                {
                    Screenshot screenshot = new Screenshot();
                    SetupScreenshot(screenshot);
                    screenshot.LoadScreenshot(uri);
                    screenshot.IsSelected = (_countItems == 0);
                    screenshot.Tag        = _countItems;

                    this.Controls.Add(screenshot);
                    _screenshots.Add(screenshot);

                    _countItems++;
                }

                //As defaulting to select the first element I also raise selection event after first init
                _currentlySelected = 0;
                if (ScreenshotSelected != null)
                {
                    ScreenshotSelected(this, _screenshots[0].ScreenshotImage);
                }

                //Now checking if it is necessary to add the scrollbar
                if ((_screenshots.Count * 150) > this.Height)
                {
                    scroller = new ScrollBarEx();
                    scroller.BringToFront();
                    scroller.Orientation = ScrollBarOrientation.Vertical;
                    scroller.BorderColor = Color.FromArgb(64, 64, 64);
                    scroller.Dock        = DockStyle.Right;
                    scroller.Visible     = true;
                    scroller.Maximum     = (_screenshots.Count - 1) * 150;
                    scroller.Scroll     += scroller_Scroll;
                    this.MouseWheel     += screenshot_MouseWheel;
                    this.Controls.Add(scroller);
                }
                else if (scroller != null)
                {
                    scroller.Scroll -= scroller_Scroll;
                    scroller.Dispose();
                    scroller = null;
                }
            }
        }
Exemple #11
0
 public PluginUI(PluginMain pluginMain)
 {
     this.AutoKeyHandling = true;
     this.InitializeComponent();
     this.pluginMain = pluginMain;
     this.InitializeTimers();
     this.InitializeGraphics();
     this.InitializeLayout();
     this.InitializeTexts();
     this.UpdateSettings();
     ScrollBarEx.Attach(listView);
 }
Exemple #12
0
 public PluginUI(PluginMain pluginMain)
 {
     this.AutoKeyHandling = true;
     this.Font            = PluginBase.Settings.DefaultFont;
     this.pluginMain      = pluginMain;
     this.InitializeSettings();
     this.InitializeComponent();
     this.InitializeContextMenu();
     this.InitializeGraphics();
     this.InitializeControls();
     this.UpdateMainRegexes();
     ScrollBarEx.Attach(logTextBox);
 }
Exemple #13
0
 private void OnFormLoad(Object sender, EventArgs e)
 {
     ScrollBarEx.Attach(this, true);
     ScrollBarEx.Attach(this.dataGridViewEx);
     PluginBase.MainForm.ThemeControls(this);
     this.BackColor = Globals.MainForm.GetThemeColor("Form.BackColor", SystemColors.Control);
     for (var i = 0; i < 30; i++)
     {
         var msg = "Hello from the other side of the moon " + i;
         this.dataGridViewEx.Rows.Add(msg);
         this.listBoxEx.Items.Add(msg);
     }
     this.treeViewEx.ExpandAll();
 }
Exemple #14
0
 public PluginUI(PluginMain pluginMain)
 {
     this.InitializeTimers();
     this.scrolling  = false;
     this.pluginMain = pluginMain;
     this.logCount   = TraceManager.TraceLog.Count;
     this.InitializeComponent();
     this.InitializeContextMenu();
     this.InitializeLayout();
     this.toggleButtonImagePause   = PluginBase.MainForm.FindImage("146");
     this.toggleButtonImagePlay    = PluginBase.MainForm.FindImage("147");
     this.toggleButtonImagePlayNew = PluginBase.MainForm.FindImage("147|17|5|4");
     this.ToggleButtonClick(this, new EventArgs());
     ScrollBarEx.Attach(textLog);
 }
Exemple #15
0
 public ModelsExplorer()
 {
     instance = this;
     InitializeComponent();
     InitializeLocalization();
     this.toolStrip.Font                   = PluginBase.Settings.DefaultFont;
     this.toolStrip.Renderer               = new DockPanelStripRenderer();
     this.outlineContextMenuStrip.Font     = PluginBase.Settings.DefaultFont;
     this.outlineContextMenuStrip.Renderer = new DockPanelStripRenderer();
     searchButton.Image         = PluginBase.MainForm.FindImage("251");
     refreshButton.Image        = PluginBase.MainForm.FindImage("24");
     rebuildButton.Image        = PluginBase.MainForm.FindImage("153");
     toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
     ScrollBarEx.Attach(outlineTreeView);
 }
Exemple #16
0
 public PluginUI(PluginMain pluginMain)
 {
     this.AutoKeyHandling   = true;
     this.pluginMain        = pluginMain;
     this.autoShow          = new Timer();
     this.autoShow.Interval = 300;
     this.autoShow.Tick    += this.AutoShowPanel;
     this.logCount          = TraceManager.TraceLog.Count;
     this.ignoredEntries    = new Dictionary <String, Boolean>();
     this.InitializeComponent();
     this.InitializeContextMenu();
     this.InitializeGraphics();
     this.InitializeTexts();
     this.InitializeLayout();
     this.ApplySettings();
     ScrollBarEx.Attach(entriesView);
 }
Exemple #17
0
        void DropDownList_Activated(object sender, EventArgs e)
        {
            this.Width = _linkedControl.Width;
            bool scrollVisible = ScrollBarEx.IsVerticalScrollBarVisible(this);//this.ucItemPanel.VerticalScroll.Maximum > this.ucItemPanel.Height;

            int height = 0;

            foreach (var item in this.ucItemPanel.Controls.OfType <DropDownListItem>())
            {
                if (!scrollVisible)
                {
                    item.Width = this.ucItemPanel.Width;// -1;
                }
                else
                {
                    item.Width = this.ucItemPanel.Width
                                 - item.Margin.Left - item.Margin.Right
                                 - item.Padding.Left - item.Padding.Right
                                 - ucItemPanel.Padding.Left - ucItemPanel.Padding.Right
                                 - 2; // border width
                }
                if (_linkedControl != null)
                {
                    item.Height = _linkedControl.ItemHeight;
                }

                height += item.Height;
            }

            if (!scrollVisible)
            {
                height = height + 2;
            }

            this.Height = height;
            //this.Shown += (a, b) =>
            //{
            //    this.Size = new Size(_linkedControl.Width, this.Height);
            //};

            //this.BeginInvoke((Action)delegate
            //{
            //    this.Size = new Size(_linkedControl.Width, this.Height);
            //});
        }
Exemple #18
0
        public PluginUI(PluginMain pluginMain)
        {
            this.InitializeComponent();
            this.InitializeContextMenu();
            this.InitializeLocalization();
            this.InitializeLayout();
            this.pluginMain   = pluginMain;
            this.groups       = new List <String>();
            this.columnSorter = new ListViewSorter();
            this.listView.ListViewItemSorter = this.columnSorter;
            Settings settings = (Settings)pluginMain.Settings;

            this.filesCache = new Dictionary <String, DateTime>();
            EventManager.AddEventHandler(this, EventType.Keys); // Listen Esc
            try
            {
                if (settings.GroupValues.Length > 0)
                {
                    this.groups.AddRange(settings.GroupValues);
                    this.todoParser = BuildRegex(String.Join("|", settings.GroupValues));
                    this.isEnabled  = true;
                    this.InitGraphics();
                }
                this.listView.ShowGroups = PluginBase.Settings.UseListViewGrouping;
                this.listView.GridLines  = !PluginBase.Settings.UseListViewGrouping;
            }
            catch (Exception ex)
            {
                ErrorManager.ShowError(ex);
                this.isEnabled = false;
            }
            this.parseTimer          = new System.Windows.Forms.Timer();
            this.parseTimer.Interval = 2000;
            this.parseTimer.Tick    += delegate { this.ParseNextFile(); };
            this.parseTimer.Enabled  = false;
            this.parseTimer.Tag      = null;
            ScrollBarEx.Attach(listView);
        }
Exemple #19
0
        public PluginUI(PluginMain plugin, FDMenus menus, FileActions fileActions, ProjectActions projectActions)
        {
            this.menus           = menus;
            this.AutoKeyHandling = true;
            this.Text            = TextHelper.GetString("Title.PluginPanel");

            #region Build TreeView and Toolbar

            menu = new ProjectContextMenu();
            menu.Rename.Click += RenameNode;

            treeBar = new TreeBar(menus, menu);

            tree                    = new ProjectTreeView();
            tree.BorderStyle        = BorderStyle.None;
            tree.Dock               = DockStyle.Fill;
            tree.ImageIndex         = 0;
            tree.ImageList          = Icons.ImageList;
            tree.LabelEdit          = true;
            tree.SelectedImageIndex = 0;
            tree.ShowRootLines      = false;
            tree.HideSelection      = false;
            tree.ContextMenuStrip   = menu;
            tree.AfterLabelEdit    += tree_AfterLabelEdit;
            tree.BeforeLabelEdit   += tree_BeforeLabelEdit;
            tree.BeforeSelect      += tree_BeforeSelect;
            tree.AfterSelect       += tree_AfterSelect;

            Panel panel = new Panel();
            panel.Dock = DockStyle.Fill;
            panel.Controls.Add(tree);
            panel.Controls.Add(treeBar);

            menu.ProjectTree = tree;
            ScrollBarEx.Attach(tree);

            #endregion

            #region Instructions

            help = new LinkLabel();
            string[] helpParts   = String.Format(TextHelper.GetString("Info.NoProjectsOpenLink"), "\n").Split('|');
            string[] helpActions = { "create", "open", "import" };
            string   helpText    = "";
            int[]    linkStart   = { 0, 0, 0 };
            int[]    linkLength  = { 0, 0, 0 };
            for (int i = 0; i < 3; i++)
            {
                if (helpParts.Length > i * 2)
                {
                    helpText     += helpParts[i * 2];
                    linkStart[i]  = helpText.Length;
                    helpText     += helpParts[i * 2 + 1];
                    linkLength[i] = helpParts[i * 2 + 1].Length;
                }
            }
            help.Text = helpText + helpParts[helpParts.Length - 1];
            for (int i = 0; i < 3; i++)
            {
                help.Links.Add(linkStart[i], linkLength[i], helpActions[i]);
            }
            help.LinkClicked += link_LinkClicked;
            help.Dock         = DockStyle.Fill;
            help.TextAlign    = ContentAlignment.MiddleCenter;
            help.ContextMenu  = new ContextMenu();

            #endregion

            this.Controls.Add(help);
            this.Controls.Add(panel);

            #region Events

            fileActions.FileCreated        += NewFileCreated;
            fileActions.ProjectModified    += ProjectModified;
            projectActions.ProjectModified += ProjectModified;

            #endregion
        }
Exemple #20
0
        public override void UpdateUI()
        {
            Controls.Clear();
            int maxRenderableColumns = (Width - 20) / 180;
            int maxRenderableRows    = Height / 160;
            int rowsCount            = 0;
            int columnsCount         = 0;

            if (_games == null || _games.Count <= 0)
            {
                return;
            }
            int currentLeft = 0;

            foreach (Game game in _games)
            {
                GameBox gameBox = new GameBox(_settings.BoxRendered);
                gameBox.BoxSelected     += new GameBox.BoxSelectedDelegate(Box_BoxSelected);
                gameBox.BoxDoubleClick  += new GameBox.BoxDoubleClickDelegate(Box_BoxDoubleClick);
                gameBox.ContextMenuStrip = CreateGameContextMenu(game.ID);
                gameBox.GameName         = game.Title;

                if (File.Exists(game.ImagePath))
                {
                    gameBox.GameImage = Image.FromFile(game.ImagePath);
                }
                else
                {
                    gameBox.GameImage = null;
                }

                gameBox.GameID = game.ID;
                gameBox.Top    = rowsCount * 160 + (rowsCount == 0 ? 0 : 5);
                gameBox.Left   = currentLeft;
                currentLeft   += gameBox.Width;
                this.Controls.Add(gameBox);
                ++columnsCount;
                if (columnsCount >= maxRenderableColumns)
                {
                    columnsCount = 0;
                    ++rowsCount;
                    currentLeft = 0;
                }
            }
            if (rowsCount + 1 > maxRenderableRows)
            {
                scroller             = new ScrollBarEx();
                scroller.Orientation = ScrollBarOrientation.Vertical;
                scroller.BorderColor = Color.FromArgb(64, 64, 64);
                scroller.Dock        = DockStyle.Right;
                scroller.Visible     = true;
                scroller.Maximum     = (rowsCount + 1) * 160;
                scroller.Scroll     += scroller_Scroll;
                this.MouseWheel     += CategoryGames_MouseWheel;
                this.Controls.Add(scroller);
            }
            else if (scroller != null)
            {
                scroller.Scroll -= scroller_Scroll;
                scroller.Dispose();
                scroller = null;
            }
            this.Focus();
        }
Exemple #21
0
        private void init()
        {
            this.AutoKeyHandling     = true;
            this.dgv                 = new DataGridViewEx();
            this.dgv.Dock            = DockStyle.Fill;
            this.dgv.BorderStyle     = BorderStyle.None;
            this.dgv.BackgroundColor = SystemColors.Window;
            this.dgv.Font            = PluginBase.Settings.DefaultFont;
            if (ScaleHelper.GetScale() > 1)
            {
                this.dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            }
            else
            {
                this.dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
            }
            this.dgv.ColumnHeadersBorderStyle  = DataGridViewHeaderBorderStyle.None;
            this.dgv.AutoSizeColumnsMode       = DataGridViewAutoSizeColumnsMode.Fill;
            this.dgv.CellBorderStyle           = DataGridViewCellBorderStyle.Single;
            this.dgv.EnableHeadersVisualStyles = true;
            this.dgv.RowHeadersVisible         = false;
            DataGridViewCellStyle viewStyle = new DataGridViewCellStyle();

            viewStyle.Padding = new Padding(1);
            this.dgv.ColumnHeadersDefaultCellStyle = viewStyle;
            this.ColumnBreakPointEnable            = new DataGridViewCheckBoxColumn();
            this.ColumnBreakPointFilePath          = new DataGridViewTextBoxColumn();
            this.ColumnBreakPointFileName          = new DataGridViewTextBoxColumn();
            this.ColumnBreakPointLine = new DataGridViewTextBoxColumn();
            this.ColumnBreakPointExp  = new DataGridViewTextBoxColumn();
            this.ColumnBreakPointEnable.HeaderText   = TextHelper.GetString("Label.Enable");
            this.ColumnBreakPointEnable.Name         = "Enable";
            this.ColumnBreakPointEnable.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
            this.ColumnBreakPointEnable.Width        = 70;
            this.ColumnBreakPointFilePath.HeaderText = TextHelper.GetString("Label.Path");
            this.ColumnBreakPointFilePath.Name       = "FilePath";
            this.ColumnBreakPointFilePath.ReadOnly   = true;
            this.ColumnBreakPointFileName.HeaderText = TextHelper.GetString("Label.File");
            this.ColumnBreakPointFileName.Name       = "FileName";
            this.ColumnBreakPointFileName.ReadOnly   = true;
            this.ColumnBreakPointLine.HeaderText     = TextHelper.GetString("Label.Line");
            this.ColumnBreakPointLine.Name           = "Line";
            this.ColumnBreakPointLine.ReadOnly       = true;
            this.ColumnBreakPointExp.HeaderText      = TextHelper.GetString("Label.Exp");
            this.ColumnBreakPointExp.Name            = "Exp";
            this.dgv.AllowUserToAddRows = false;
            this.dgv.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[]
            {
                this.ColumnBreakPointEnable,
                this.ColumnBreakPointFilePath,
                this.ColumnBreakPointFileName,
                this.ColumnBreakPointLine,
                this.ColumnBreakPointExp
            });
            foreach (DataGridViewColumn column in dgv.Columns)
            {
                column.Width = ScaleHelper.Scale(column.Width);
            }
            defaultColor = dgv.Rows[dgv.Rows.Add()].DefaultCellStyle.BackColor;
            dgv.Rows.Clear();
            this.dgv.CellEndEdit     += new DataGridViewCellEventHandler(dgv_CellEndEdit);
            this.dgv.CellMouseUp     += new DataGridViewCellMouseEventHandler(dgv_CellMouseUp);
            this.dgv.CellDoubleClick += new DataGridViewCellEventHandler(dgv_CellDoubleClick);
            this.Controls.Add(this.dgv);
            InitializeComponent();
            tsbRemoveSelected.Image          = PluginBase.MainForm.FindImage("548|27|5|5");
            tsbRemoveFiltered.Image          = PluginBase.MainForm.FindImage("549|27|5|5");
            tsbAlternateFiltered.Image       = PluginBase.MainForm.FindImage("136|23|5|5");
            tsbExportFiltered.Image          = PluginBase.MainForm.FindImage("549|22|4|4");
            tsbImport.Image                  = PluginBase.MainForm.FindImage("549|8|4|4");
            this.tscbFilterColumns.FlatStyle = PluginBase.Settings.ComboBoxFlatStyle;
            this.tsActions.Renderer          = new DockPanelStripRenderer(false);
            ScrollBarEx.Attach(dgv);
        }
Exemple #22
0
 public void ApplyParamsTo(ScrollBarEx scrollBar)
 {
     scrollBar.Maximum     = contentSize;
     scrollBar.LargeChange = Math.Max(0, areaSize);
     scrollBar.Visible     = visible;
 }