Beispiel #1
0
        public VwXls()
        {
            InitializeComponent();

            {
                FlowLayoutPanel flp = flperr = new FlowLayoutPanel();
                flp.Hide();
                flp.Dock = DockStyle.Fill;
                {
                    PictureBox pb = new PictureBox();
                    pb.Image    = Resources.eventlogError.ToBitmap();
                    pb.SizeMode = PictureBoxSizeMode.AutoSize;
                    flp.Controls.Add(pb);
                }
                {
                    Label la = laerr1 = new Label();
                    la.AutoSize = true;
                    flp.Controls.Add(la);
                    flp.SetFlowBreak(la, true);
                }
                {
                    Label la = laerr2 = new Label();
                    la.AutoSize = true;
                    flp.Controls.Add(la);
                }
                flp.Parent = this;
            }

            {
                TableLayoutPanel p = flpwip = new TableLayoutPanel();
                p.Hide();
                p.Dock = DockStyle.Fill;
                p.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
                p.RowStyles.Add(new RowStyle(SizeType.AutoSize));
                {
                    FlowLayoutPanel flp = new FlowLayoutPanel();
                    flp.Anchor       = AnchorStyles.None;
                    flp.AutoSize     = true;
                    flp.AutoSizeMode = AutoSizeMode.GrowAndShrink;
                    flp.BackColor    = Color.WhiteSmoke;
                    flp.ForeColor    = Color.Black;
                    {
                        Label la = lawip = new Label();
                        la.AutoSize = true;
                        flp.Controls.Add(la);
                        flp.SetFlowBreak(la, true);
                    }
                    {
                        ProgressBar pb = new ProgressBar();
                        pb.Style = ProgressBarStyle.Marquee;
                        flp.Controls.Add(pb);
                    }
                    p.Controls.Add(flp);
                    flp.Show();
                }
                p.Parent = this;
            }

            Sync = SynchronizationContext.Current;
        }
 private void Dismiss()
 {
     _panel.Hide();
     if (_panel.Parent != null)
     {
         _panel.Parent.Controls.Remove(_panel);
     }
 }
Beispiel #3
0
 private void EditLabelBtn_MouseClick(object sender, MouseEventArgs e)
 {
     projInfo.Hide();
     tasksPanel.Hide();
     editProj.Location = new Point(250, 200);
     ParentForm.Controls.Add(editProj);
     editProj.closeBtn.Visible = true;
     editProj.Show();
     editProj.BringToFront();
     editProj.ProjNameTextbox.Text = project.name;
     editProj.startTime.Text       = project.start_time.Day + " / " + project.start_time.Month + " / " + project.start_time.Year;
     editProj.EndTime.Text         = project.end_time.Day + " / " + project.end_time.Month + " / " + project.end_time.Year;
     //here
     editProj.comboBox1.Text       = project.manger_name;
     editProj.ProjDescription.Text = project.description;
     editProj.project_id           = project.id;
 }
Beispiel #4
0
        public HorizontalLayout(DiabloInterface di)
        {
            this.di = di;
            RegisterServiceEventHandlers();
            InitializeComponent();

            Load += (sender, e) => UpdateConfig(di.configService.CurrentConfig);

            // Clean up events when disposed because services outlive us.
            Disposed += (sender, e) => UnregisterServiceEventHandlers();

            Logger.Info("Creating horizontal layout.");

            panelRuneDisplayHorizontal.Hide();
            panelRuneDisplayVertical.Hide();
        }
Beispiel #5
0
        public HorizontalLayout(ISettingsService settingsService, IGameService gameService)
        {
            this.settingsService = settingsService;
            this.gameService     = gameService;

            RegisterServiceEventHandlers();
            InitializeComponent();

            Load += (sender, e) => UpdateSettings(settingsService.CurrentSettings);

            // Clean up events when disposed because services outlive us.
            Disposed += (sender, e) => UnregisterServiceEventHandlers();

            Logger.Info("Creating horizontal layout.");

            panelRuneDisplayHorizontal.Hide();
            panelRuneDisplayVertical.Hide();
        }
Beispiel #6
0
        protected override void ApplyRuneSettings(ApplicationSettings settings)
        {
            FlowLayoutPanel nextRuneLayoutPanel = null;

            if (settings.DisplayRunes && settings.DisplayRunesHorizontal)
            {
                nextRuneLayoutPanel = panelRuneDisplayHorizontal;
            }
            else if (settings.DisplayRunes && !settings.DisplayRunesHorizontal)
            {
                nextRuneLayoutPanel = panelRuneDisplayVertical;
            }

            // Only hide panels when the panels were changed.
            if (activeRuneLayoutPanel == nextRuneLayoutPanel)
            {
                return;
            }

            activeRuneLayoutPanel?.Hide();
            activeRuneLayoutPanel = nextRuneLayoutPanel;
        }
Beispiel #7
0
        public static void DeckFilter(Deck deck, FlowLayoutPanel target)
        {
            target.Controls.Clear();

            string      json     = File.ReadAllText(JsonPathLocal);
            RootObject  database = JsonConvert.DeserializeObject <RootObject>(json);
            List <Card> cards    = database.Data.Cards; //we only want a list of Card objects

            //Group duplicates
            var dup = deck.Cards
                      .GroupBy(x => new { x.CardId })
                      .Select(group => new { ID = group.Key, Count = group.Count() });

            //Show deck's contents
            target.Hide();
            foreach (var basex in dup)
            {
                Card       targetCard = cards.Find(x => x.CardId == basex.ID.CardId);
                CardBanner banner     = new CardBanner(targetCard.CardId, targetCard.CardName, targetCard.Cost, targetCard.RarityId, basex.Count, true);
                target.Controls.Add(banner);
            }
            target.Show();
        }
        protected override void UpdateConfig(ApplicationConfig config)
        {
            var padding = new Padding(0, 0, 0, config.VerticalLayoutPadding);

            realFrwIas = config.DisplayRealFrwIas;
            BackColor  = config.ColorBackground;

            int w_full  = 0;
            int w_left  = 0;
            int w_right = 0;

            void upd(Label[] ls, bool v, Font f, Color c, string mstr, Dictionary <Label, string> defaults)
            {
                int i = 0;

                foreach (var l in ls)
                {
                    l.Visible = v;
                    if (v)
                    {
                        l.Font      = f;
                        l.ForeColor = c;
                        var teststr = defaults[l].Replace("{}", mstr);
                        l.Size   = MeasureText(teststr, l);
                        l.Margin = padding;
                        if (ls.Length == 1)
                        {
                            w_full = Math.Max(l.Size.Width, w_full);
                        }
                        else if (i == 0)
                        {
                            w_left = Math.Max(l.Size.Width, w_left);
                        }
                        else
                        {
                            w_right = Math.Max(l.Size.Width, w_right);
                        }
                        i++;
                    }
                }
            }

            foreach (KeyValuePair <string, Def> pair in def)
            {
                Tuple <bool, Color, int> t = pair.Value.settings(config);
                upd(pair.Value.labels, t.Item1, new Font(config.FontName, t.Item3), t.Item2, pair.Value.maxString, pair.Value.defaults);
            }

            foreach (KeyValuePair <string, Def> pair in def)
            {
                int i = 0;
                foreach (var l in pair.Value.labels)
                {
                    if (pair.Value.labels.Length == 1)
                    {
                        l.Size = new Size(w_full, l.Size.Height);
                    }
                    else if (i == 0)
                    {
                        l.Size = new Size(w_left, l.Size.Height);
                    }
                    else
                    {
                        l.Size = new Size(w_right, l.Size.Height);
                    }
                    i++;
                }
            }

            if (!config.DisplayRunes)
            {
                panelRuneDisplay.Hide();
            }
        }
Beispiel #9
0
 private void PanelHide(FlowLayoutPanel p)
 {
     p.Hide();
 }
Beispiel #10
0
        protected override void UpdateConfig(ApplicationConfig config)
        {
            realFrwIas = config.DisplayRealFrwIas;
            BackColor  = config.ColorBackground;

            var margin = new Padding(2);

            foreach (KeyValuePair <string, Def> pair in def)
            {
                var x       = pair.Value.settings(config);
                var enabled = x.Item1;
                pair.Value.enabled = enabled;

                if (enabled)
                {
                    var color = x.Item2;
                    var font  = CreateFont(config.FontName, x.Item3);
                    foreach (Label l in pair.Value.labels)
                    {
                        l.Visible   = enabled;
                        l.Margin    = margin;
                        l.ForeColor = color;
                        l.Font      = font;
                        var teststr = pair.Value.defaults[l].Replace("{}", pair.Value.maxString);
                        l.Size = MeasureText(teststr, l);
                    }
                }
                else
                {
                    foreach (Label l in pair.Value.labels)
                    {
                        l.Visible = enabled;
                    }
                }
            }

            panelResistances.Visible   = config.DisplayResistances;
            panelBaseStats.Visible     = config.DisplayBaseStats;
            panelAdvancedStats.Visible = config.DisplayAdvancedStats;

            int count = 0;

            if (panelResistances.Visible)
            {
                count++;
            }
            if (panelBaseStats.Visible)
            {
                count++;
            }
            if (panelAdvancedStats.Visible)
            {
                count++;
            }

            panelDiffPercentages.Visible  = count < 3 && config.DisplayDifficultyPercentages;
            panelDiffPercentages2.Visible = count >= 3 && config.DisplayDifficultyPercentages;

            panelStats.Visible =
                config.DisplayResistances ||
                config.DisplayBaseStats ||
                config.DisplayAdvancedStats ||
                config.DisplayDifficultyPercentages;

            FlowLayoutPanel nextRuneLayoutPanel = null;

            if (config.DisplayRunes)
            {
                nextRuneLayoutPanel = config.DisplayRunesHorizontal
                    ? panelRuneDisplayHorizontal
                    : panelRuneDisplayVertical;
            }

            // Only hide panels when the panels were changed.
            if (activeRuneLayoutPanel != nextRuneLayoutPanel)
            {
                activeRuneLayoutPanel?.Hide();
                activeRuneLayoutPanel = nextRuneLayoutPanel;
            }

            // TODO: automatically size the rune panel...
            int statsWidth = (panelResistances.Visible ? panelResistances.Width : 0)
                             + (panelBaseStats.Visible ? panelBaseStats.Width : 0)
                             + (panelAdvancedStats.Visible ? panelAdvancedStats.Width : 0)
                             + ((count < 3 && panelDiffPercentages.Visible) ? panelDiffPercentages.Width : 0)
            ;

            panelRuneDisplayHorizontal.MaximumSize = new Size(Math.Max(def["name"].labels[0].Width, statsWidth), 0);
        }
Beispiel #11
0
 private void ShowAvailableProductsPanel()
 {
     productDetailsPanel.Hide();
     availableProductsPanel.Show();
 }
Beispiel #12
0
 private void ShowProductDetailsPanel(FlowLayoutPanel panel)
 {
     productDetailsPanel = panel;
     availableProductsPanel.Hide();
     mainPanel.Controls.Add(productDetailsPanel, 0, 2);
 }
Beispiel #13
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.mainPanel               = new System.Windows.Forms.FlowLayoutPanel();
            this.label1                  = new System.Windows.Forms.Label();
            this.panel2                  = new System.Windows.Forms.Panel();
            this.textBox3                = new System.Windows.Forms.TextBox();
            this.menuStrip1              = new System.Windows.Forms.MenuStrip();
            this.fileToolStripMenuItem   = new System.Windows.Forms.ToolStripMenuItem();
            this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.mainPanel.SuspendLayout();
            this.panel2.SuspendLayout();
            this.menuStrip1.SuspendLayout();
            this.SuspendLayout();
            //
            // mainPanel
            //
            this.mainPanel.AutoScroll = true;
            this.mainPanel.Controls.Add(this.label1);
            this.mainPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
            this.mainPanel.Location      = new System.Drawing.Point(12, 38);
            this.mainPanel.Name          = "mainPanel";
            this.mainPanel.Size          = new System.Drawing.Size(136, 400);
            this.mainPanel.TabIndex      = 0;
            //
            // label1
            //
            this.label1.Location  = new System.Drawing.Point(3, 0);
            this.label1.Name      = "label1";
            this.label1.Size      = new System.Drawing.Size(126, 78);
            this.label1.TabIndex  = 0;
            this.label1.Text      = "MACROS";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

            for (int i = 0; i < NUMBER_OF_MACROS; i++)
            {
                //
                // button0
                //
                var button0 = new Button();
                button0.Location = new System.Drawing.Point(3, 81);
                button0.Name     = "button" + i;
                button0.Size     = new System.Drawing.Size(125, 23);
                button0.TabIndex = i * 2;
                button0.Text     = "Macro" + i;
                button0.UseVisualStyleBackColor = true;
                button0.Click     += new System.EventHandler(ButtonMacro_Click);
                button0.KeyPress  += Space_key_event;
                button0.MouseDown += new MouseEventHandler(RightClick);
                this.mainPanel.Controls.Add(button0);
                buttons.Add(button0);
                //
                // panel0
                //
                var panel0 = new FlowLayoutPanel();
                panel0.SuspendLayout();
                panel0.Location = new System.Drawing.Point(3, 110);
                panel0.Name     = "panel" + i;
                panel0.Size     = new System.Drawing.Size(130, 135);
                panel0.TabIndex = i * 2 + 1;
                panel0.Hide();
                panels.Add(panel0);

                for (int j = 0; j < NUMBER_OF_COMMANDS_PER_MACRO; j++)
                {
                    //
                    // textBox1
                    //
                    var textBox1 = new TextBox();
                    textBox1.Location   = new System.Drawing.Point(3, 3);
                    textBox1.Name       = "textBox" + i + "Index" + j;
                    textBox1.Size       = new System.Drawing.Size(119, 20);
                    textBox1.TabIndex   = j;
                    textBox1.KeyPress  += Enter_key_event;
                    textBox1.LostFocus += CommandTextBoxFocusLost;

                    panel0.Controls.Add(textBox1);
                }

                //
                // execute0
                //
                var execute0 = new Button();
                execute0.Location = new System.Drawing.Point(3, 107);
                execute0.Name     = "execute" + i;
                execute0.Size     = new System.Drawing.Size(119, 23);
                execute0.TabIndex = NUMBER_OF_COMMANDS_PER_MACRO;
                execute0.Text     = "Execute" + i;
                execute0.UseVisualStyleBackColor = true;
                execute0.Click += Execute_click;

                panel0.Controls.Add(execute0);
                panel0.ResumeLayout(false);
                panel0.PerformLayout();

                this.mainPanel.Controls.Add(panel0);
            }
            //
            // panel2
            //
            this.panel2.BackColor = System.Drawing.SystemColors.Control;
            this.panel2.Controls.Add(this.textBox3);
            this.panel2.Location = new System.Drawing.Point(154, 38);
            this.panel2.Name     = "panel2";
            this.panel2.Size     = new System.Drawing.Size(634, 400);
            this.panel2.TabIndex = 1;
            //
            // textBox3
            //
            this.textBox3.BackColor  = System.Drawing.Color.Black;
            this.textBox3.ForeColor  = System.Drawing.Color.White;
            this.textBox3.Location   = new System.Drawing.Point(3, 3);
            this.textBox3.Multiline  = true;
            this.textBox3.Name       = "textBox3";
            this.textBox3.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.textBox3.Size       = new System.Drawing.Size(628, 394);
            this.textBox3.TabIndex   = 0;
            this.textBox3.KeyPress  += CheckConsolePressedKey;
            this.textBox3.KeyDown   += CheckConsoleDownKey;
            //
            // menuStrip1
            //
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.fileToolStripMenuItem
            });
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name     = "menuStrip1";
            this.menuStrip1.Size     = new System.Drawing.Size(800, 24);
            this.menuStrip1.TabIndex = 3;
            this.menuStrip1.Text     = "menuStrip1";
            //
            // fileToolStripMenuItem
            //
            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.importToolStripMenuItem,
                this.exportToolStripMenuItem
            });
            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
            this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
            this.fileToolStripMenuItem.Text = "File";
            //
            // importToolStripMenuItem
            //
            this.importToolStripMenuItem.Name   = "importToolStripMenuItem";
            this.importToolStripMenuItem.Size   = new System.Drawing.Size(119, 22);
            this.importToolStripMenuItem.Text   = "Import...";
            this.importToolStripMenuItem.Click += new System.EventHandler(this.ImportToolStripMenuItem_Click);
            //
            // exportToolStripMenuItem
            //
            this.exportToolStripMenuItem.Name   = "exportToolStripMenuItem";
            this.exportToolStripMenuItem.Size   = new System.Drawing.Size(119, 22);
            this.exportToolStripMenuItem.Text   = "Export...";
            this.exportToolStripMenuItem.Click += new System.EventHandler(this.ExportToolStripMenuItem_Click);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(800, 450);
            this.FormBorderStyle     = FormBorderStyle.FixedSingle;
            this.MaximizeBox         = false;
            this.MinimizeBox         = false;
            this.StartPosition       = FormStartPosition.CenterParent;

            this.Controls.Add(this.panel2);
            this.Controls.Add(this.mainPanel);
            this.Controls.Add(this.menuStrip1);
            this.MainMenuStrip = this.menuStrip1;
            this.Name          = "Form1";
            this.Text          = "JollyConsole";
            this.mainPanel.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }
        protected override void UpdateConfig(ApplicationConfig config)
        {
            var padding = new Padding(0, 0, 0, config.VerticalLayoutPadding);

            realFrwIas = config.DisplayRealFrwIas;
            BackColor  = config.ColorBackground;

            int w_full  = 0;
            int w_left  = 0;
            int w_right = 0;

            foreach (KeyValuePair <string, Def> pair in def)
            {
                Tuple <bool, Color, int> t = pair.Value.settings(config);
                var  enabled  = t.Item1;
                Font font     = CreateFont(config.FontName, t.Item3);
                var  labels   = pair.Value.labels;
                var  color    = t.Item2;
                var  mstr     = pair.Value.maxString;
                var  defaults = pair.Value.defaults;

                pair.Value.enabled = enabled;

                int i = 0;
                foreach (var l in labels)
                {
                    l.Visible = enabled;
                    if (enabled)
                    {
                        l.Font      = font;
                        l.ForeColor = color;
                        var teststr = defaults[l].Replace("{}", mstr);
                        l.Size   = MeasureText(teststr, l);
                        l.Margin = padding;
                        if (labels.Length == 1)
                        {
                            w_full = Math.Max(l.Size.Width, w_full);
                        }
                        else if (i == 0)
                        {
                            w_left = Math.Max(l.Size.Width, w_left);
                        }
                        else
                        {
                            w_right = Math.Max(l.Size.Width, w_right);
                        }
                        i++;
                    }
                }
            }

            foreach (KeyValuePair <string, Def> pair in def)
            {
                int i = 0;
                foreach (var l in pair.Value.labels)
                {
                    if (pair.Value.labels.Length == 1)
                    {
                        l.Size = new Size(w_full, l.Size.Height);
                    }
                    else if (i == 0)
                    {
                        l.Size = new Size(w_left, l.Size.Height);
                    }
                    else
                    {
                        l.Size = new Size(w_right, l.Size.Height);
                    }
                    i++;
                }
            }

            if (!config.DisplayRunes)
            {
                panelRuneDisplay.Hide();
            }
        }