void BattleListTab_Enter(object sender, EventArgs e) //lazy initialization
        {
            Paint -= BattleListTab_Enter; //using "Paint" instead of "Enter" event because "Enter" is too lazy in Mono (have to click control)
            SuspendLayout(); //pause
            InitializeComponent();

            if (DesignMode) return;
            DpiMeasurement.DpiXYMeasurement(this);
            var lookingGlass = new PictureBox
            {
                Width =  DpiMeasurement.ScaleValueY(20),
                Height = DpiMeasurement.ScaleValueY(20),
                Image = ZklResources.search,
                SizeMode = PictureBoxSizeMode.CenterImage,
                Dock = DockStyle.Left
            };
            Program.ToolTip.SetText(lookingGlass, "Search game, description, map or player");
            Program.ToolTip.SetText(searchBox, "Search game, description, map or player");
            
            hideEmptyBox.Checked = Program.Conf.HideEmptyBattles;
            hideFullBox.Checked = Program.Conf.HideNonJoinableBattles;
            showOfficialBox.Checked = Program.Conf.ShowOfficialBattles;
            hidePasswordedBox.Checked = Program.Conf.HidePasswordedBattles;

            // battle list
            battleListControl = new BattleListControl() { Dock = DockStyle.Fill };
            battlePanel.Controls.Add(battleListControl);
            ResumeLayout();
        }
        public BattleListTab() 
        {
            InitializeComponent();
            SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true);

            SuspendLayout(); //pause

            if (DesignMode) return;
            var lookingGlass = new PictureBox
            {
                Width = (int)20,
                Height = (int)20,
                Image = ZklResources.search,
                SizeMode = PictureBoxSizeMode.CenterImage,
                Dock = DockStyle.Left
            };
            Program.ToolTip.SetText(lookingGlass, "Search game, description, map or player");
            Program.ToolTip.SetText(searchBox, "Search game, description, map or player");

            hideEmptyBox.Checked = Program.Conf.HideEmptyBattles;
            hideFullBox.Checked = Program.Conf.HideNonJoinableBattles;
            showOfficialBox.Checked = Program.Conf.ShowOfficialBattles;
            hidePasswordedBox.Checked = Program.Conf.HidePasswordedBattles;

            // battle list
            battleListControl = new BattleListControl() { Dock = DockStyle.Fill };
            battlePanel.Controls.Add(battleListControl);
            ResumeLayout();
        }
Esempio n. 3
0
        void BattleListTab_Enter(object sender, EventArgs e)
        {
            Paint -= BattleListTab_Enter;
            SuspendLayout(); //pause
            InitializeComponent();

            if (DesignMode)
            {
                return;
            }
            DpiMeasurement.DpiXYMeasurement(this);
            var lookingGlass = new PictureBox
            {
                Width    = DpiMeasurement.ScaleValueY(20),
                Height   = DpiMeasurement.ScaleValueY(20),
                Image    = ZklResources.search,
                SizeMode = PictureBoxSizeMode.CenterImage,
                Dock     = DockStyle.Left
            };

            Program.ToolTip.SetText(lookingGlass, "Search game, description, map or player");
            Program.ToolTip.SetText(searchBox, "Search game, description, map or player");

            showEmptyBox.Checked    = Program.Conf.ShowEmptyBattles;
            showFullBox.Checked     = Program.Conf.ShowNonJoinableBattles;
            showOfficialBox.Checked = Program.Conf.ShowOfficialBattles;

            // battle list
            battleListControl = new BattleListControl()
            {
                Dock = DockStyle.Fill
            };
            battlePanel.Controls.Add(battleListControl);
            ResumeLayout();
        }
        public BattleListTab() {
            SuspendLayout();
            Size = new Size(731, 463);

            panel1 = new Panel { BackColor = Color.Transparent, Dock = DockStyle.Top, Location = new Point(0, 0), Size = new Size(731, 50) };
            searchLabel = new Label { AutoSize = true, Location = new Point(203, 17), Size = new Size(59, 18), Text = "Search:", ForeColor = Config.TextColor, Font = Config.GeneralFont};
            searchBox = new ZklTextBox { BackColor = Color.FromArgb(0, 30, 40), Location = new Point(268, 14), Size = new Size(178, 24), TabIndex = 1 };


            var btnMm = new BitmapButton()
            {
                Text = "Start MatchMaker",
                Width = 150,
                Height = 50,
                Image = Buttons.mp.GetResizedWithCache(32, 32),
                TextImageRelation = TextImageRelation.ImageBeforeText
            };
            btnMm.Click += (s, e) =>
            {
                var mm = new StartMatchMakerDialog();
                mm.StartPosition = FormStartPosition.CenterScreen;
                mm.Show(Program.MainWindow);
            };
            
            panel1.Controls.Add(btnMm);

            panel1.Controls.Add(searchLabel);
            panel1.Controls.Add(searchBox);

            battlePanel = new Panel
            {
                Location = new Point(0, 50),
                Size = new Size(731, 432),
                Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right
            };

            // battle list
            battleListControl = new BattleListControl { Dock = DockStyle.Fill };
            battlePanel.Controls.Add(battleListControl);

            Controls.Add(panel1);
            Controls.Add(battlePanel);

            Program.ToolTip.SetText(searchBox, "Search game, map or player");
            Program.ToolTip.SetText(searchBox.TextBox, "Search game, map or player");
            Program.ToolTip.SetText(searchLabel, "Search game, map or player");

            searchBox.TextChanged += searchBox_TextChanged;

            ResumeLayout();
        }
Esempio n. 5
0
        public BattleListTab()
        {
            SuspendLayout();
            Size = new Size(731, 463);

            panel1 = new Panel {
                BackColor = Color.Transparent, Dock = DockStyle.Top, Location = new Point(0, 0), Size = new Size(731, 50)
            };
            searchLabel = new Label {
                AutoSize = true, Location = new Point(203, 17), Size = new Size(59, 18), Text = "Search:", ForeColor = Config.TextColor, Font = Config.GeneralFont
            };
            searchBox = new ZklTextBox {
                BackColor = Color.FromArgb(0, 30, 40), Location = new Point(268, 14), Size = new Size(178, 24), TabIndex = 1
            };


            var btnMm = new BitmapButton()
            {
                Text              = "Start MatchMaker",
                Width             = 150,
                Height            = 50,
                Image             = Buttons.mp.GetResizedWithCache(32, 32),
                TextImageRelation = TextImageRelation.ImageBeforeText
            };

            btnMm.Click += (s, e) =>
            {
                var mm = new StartMatchMakerDialog();
                mm.StartPosition = FormStartPosition.CenterScreen;
                mm.Show(Program.MainWindow);
            };

            panel1.Controls.Add(btnMm);

            panel1.Controls.Add(searchLabel);
            panel1.Controls.Add(searchBox);

            battlePanel = new Panel
            {
                Location = new Point(0, 50),
                Size     = new Size(731, 432),
                Anchor   = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right
            };

            // battle list
            battleListControl = new BattleListControl {
                Dock = DockStyle.Fill
            };
            battlePanel.Controls.Add(battleListControl);

            Controls.Add(panel1);
            Controls.Add(battlePanel);

            Program.ToolTip.SetText(searchBox, "Search game, map or player");
            Program.ToolTip.SetText(searchBox.TextBox, "Search game, map or player");
            Program.ToolTip.SetText(searchLabel, "Search game, map or player");

            searchBox.TextChanged += searchBox_TextChanged;

            ResumeLayout();
        }