コード例 #1
0
        public actionDialogProject(list_project listProject, int IdProjeto)
        {
            Label label = new Label();

            label.Text     = "Oque você deseja fazer a seguir?";
            label.Font     = new Font("Arial", 10, FontStyle.Regular);
            label.Size     = new Size(230, 25);
            label.Location = new Point(35, 20);
            this.Controls.Add(label);

            MaterialFlatButton edit = new MaterialFlatButton();

            edit.Text = "Editar";
            // adiciona ação ao clique do button
            edit.Click   += delegate(object sender, EventArgs args) { this.Close(); listProject.retornaEdicao(IdProjeto); };
            edit.Location = new Point(10, 50);
            this.Controls.Add(edit);

            MaterialFlatButton taskList = new MaterialFlatButton();

            taskList.Text = "Tarefas";
            // adiciona ação ao clique do button
            taskList.Click   += delegate(object sender, EventArgs args) { this.Close(); listProject.retornaTarefa(IdProjeto); };
            taskList.Location = new Point(85, 50);
            this.Controls.Add(taskList);

            MaterialRaisedButton delete = new MaterialRaisedButton();

            delete.Text = "Remover";
            // adiciona ação ao clique do button
            delete.Click   += delegate(object sender, EventArgs args) { this.Close(); listProject.removerProjeto(IdProjeto); };
            delete.Location = new Point(190, 50);
            this.Controls.Add(delete);
        }
コード例 #2
0
        private void mQuanLyKho_Click(object sender, EventArgs e)
        {
            lblTieuDe.Text = "Quản lý kho";
            Cursor.Current = Cursors.WaitCursor;
            XuLyChuyenForm();
            FrmQuanLyKho m_FrmQuanLyKho = FrmQuanLyKho.Instance;

            f = m_FrmQuanLyKho;
            m_FrmQuanLyKho.MdiParent = this;
            m_FrmQuanLyKho.Dock      = DockStyle.Fill;
            m_FrmQuanLyKho.Show();

            Label lbl = new Label();

            lbl.Dock      = DockStyle.Left;
            lbl.Text      = "Lập báo cáo nhanh";
            lbl.ForeColor = Color.CadetBlue;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.Font      = new Font("SegoeUI", 11, FontStyle.Bold);
            panelBaoCao.Controls.Add(lbl);
            lbl.BringToFront();

            MaterialFlatButton btnTatCaNguyenLieu = new MaterialFlatButton();

            btnTatCaNguyenLieu.Dock   = DockStyle.Left;
            btnTatCaNguyenLieu.Text   = "Tất cả nguyên liệu";
            btnTatCaNguyenLieu.Name   = "TatCaNguyenLieu";
            btnTatCaNguyenLieu.Click += btn_Click;
            panelBaoCao.Controls.Add(btnTatCaNguyenLieu);
            btnTatCaNguyenLieu.BringToFront();
        }
コード例 #3
0
        private void AttachDoneButton(Type type, Action <Type, object[]> donebuttonClickLiestner)
        {
            var button = new MaterialFlatButton();

            button.Text     = "Done";
            button.Location = new Point(this.Size.Width - button.Size.Width - 10, this.Size.Height - button.Size.Height);
            button.Click   += delegate
            {
                var @params = new object[InputFields.Count];
                for (int i = 0; i < InputFields.Count; i++)
                {
                    var item = InputFields[i];
                    if (item is MaterialSingleLineTextField)
                    {
                        @params[i] = (( MaterialSingleLineTextField )item).Text;
                    }
                    else if (item is NumericUpDown)
                    {
                        @params[i] = ( int )((( NumericUpDown )item).Value);
                    }
                }
                if (donebuttonClickLiestner != null)
                {
                    donebuttonClickLiestner.Invoke(type, @params);
                }
            };
            button.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            this.Controls.Add(button);
        }
コード例 #4
0
        private void mThongKeHoaDon_Click(object sender, EventArgs e)
        {
            lblTieuDe.Text = "Thống kê hoá đơn";
            Cursor.Current = Cursors.WaitCursor;
            XuLyChuyenForm();
            FrmThongKeHoaDon m_FrmThongKeHoaDon = FrmThongKeHoaDon.Instance;

            f = m_FrmThongKeHoaDon;
            m_FrmThongKeHoaDon.MdiParent = this;
            m_FrmThongKeHoaDon.Dock      = DockStyle.Fill;
            m_FrmThongKeHoaDon.Show();

            Label lbl = new Label();

            lbl.Dock      = DockStyle.Left;
            lbl.Text      = "Lập báo cáo nhanh";
            lbl.ForeColor = Color.CadetBlue;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.Font      = new Font("SegoeUI", 11, FontStyle.Bold);
            panelBaoCao.Controls.Add(lbl);
            lbl.BringToFront();

            MaterialFlatButton btnTatCaHoaDon = new MaterialFlatButton();

            btnTatCaHoaDon.Dock   = DockStyle.Left;
            btnTatCaHoaDon.Text   = "Tất cả hoá đơn";
            btnTatCaHoaDon.Name   = "TatCaHoaDon";
            btnTatCaHoaDon.Click += btn_Click;
            panelBaoCao.Controls.Add(btnTatCaHoaDon);
            btnTatCaHoaDon.BringToFront();
        }
コード例 #5
0
        /// <summary>
        /// Constructor for MainForm
        /// </summary>
        /// <param name="mainForm"></param>
        /// <param name="progressFile"></param>
        /// <param name="progressAll"></param>
        /// <param name="progressText"></param>
        /// <param name="progressDetails"></param>
        /// <param name="launcherButton"></param>
        public Downloader(MainForm2 mainForm, Installer installerWorker, Windows7ProgressBar progressFile, Windows7ProgressBar progressAll, Label progressCurFile, Label progressText, Label progressDetails, DoubleBufferFlowPanel flowpanelAddonPacks, PictureBox cancelButton, MaterialFlatButton repoValidateBtn)
        {
            this.mainForm  = mainForm;
            this.installer = installerWorker;

            // define controls
            this.progressCurFile     = progressCurFile;
            this.progressFile        = progressFile;
            this.progressAll         = progressAll;
            this.progressText        = progressText;
            this.progressDetails     = progressDetails;
            this.cancelButton        = cancelButton;
            this.repoValidateBtn     = repoValidateBtn;
            this.flowpanelAddonPacks = flowpanelAddonPacks;

            // define calculate worker
            this.calculateFiles.DoWork                    += CalculateFiles_DoWork;
            this.calculateFiles.RunWorkerCompleted        += CalculateFiles_RunWorkerCompleted;
            this.calculateFiles.WorkerSupportsCancellation = true;

            // define download worker
            this.downloadFiles.DoWork                    += DownloadFiles_DoWork;
            this.downloadFiles.RunWorkerCompleted        += DownloadFiles_RunWorkerCompleted;
            this.downloadFiles.WorkerSupportsCancellation = true;
        }
コード例 #6
0
        private void LayDanhSachLoaiMon()
        {
            List <LoaiMonDTO> dsLoaiMon = LoaiMonBUS.LayDanhSachLoaiMon();

            foreach (LoaiMonDTO loaiMon in dsLoaiMon)
            {
                MaterialFlatButton btn = new MaterialFlatButton();
                btn.Text     = loaiMon.TenLoaiMon + " (" + MonBUS.LaySoLuongMonTheoLoai(loaiMon.MaLoaiMon) + ")";
                btn.Name     = loaiMon.MaLoaiMon.ToString();
                btn.AutoSize = false;
                btn.Size     = new Size(140, 60);
                btn.Dock     = DockStyle.Left;
                btn.Tag      = loaiMon;
                btn.Click   += new EventHandler(ChonLoai);
                panelLoai.Controls.Add(btn);
                btn.BringToFront();
            }

            MaterialFlatButton btnTatCa = new MaterialFlatButton();

            btnTatCa.Text     = "Tất cả" + " (" + MonBUS.LaySoLuongMonTheoLoai(0) + ")";;
            btnTatCa.Name     = "0";
            btnTatCa.AutoSize = false;
            btnTatCa.Size     = new Size(140, 60);
            btnTatCa.Dock     = DockStyle.Left;
            btnTatCa.Tag      = new LoaiMonDTO();
            btnTatCa.Click   += new EventHandler(ChonLoai);
            panelLoai.Controls.Add(btnTatCa);
        }
コード例 #7
0
        private void ShowSubMenu(MaterialFlatButton btnSender, MaterialContextMenuStrip submenu)
        {
            Point ptLowerLeft = new Point(10, (btnSender.Height + 10));

            ptLowerLeft = btnSender.PointToScreen(ptLowerLeft);
            submenu.Show(ptLowerLeft);
        }
コード例 #8
0
        void asientosButton_Click(object sender, EventArgs e)
        {
            this.aceptarMaterialFlatButton.Enabled = true;
            MaterialFlatButton b = (MaterialFlatButton)sender;

            this.id = Convert.ToInt32(b.Text) - 1;
        }
コード例 #9
0
        void createButton(String str, int x, int y)
        {
            // Creación del botón y sus respectivos TODO: RESPECTIVOS QUE??? LUJIIII!
            var btn = new MaterialFlatButton();

            btn.AutoSize     = true;
            btn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            btn.Depth        = 0;
            btn.Location     = new System.Drawing.Point(x, y);
            btn.Name         = (str == "+ Añadir Huesped") ? "btn" + count_btn1 : "btnP" + count_btn2;             // Terniario para definir el nombre del botón
            btn.Primary      = false;
            btn.Size         = new System.Drawing.Size(145, 36);
            btn.Text         = str;
            btn.Visible      = true;
            btn.Click       += (str == "+ Añadir Huesped") ? new System.EventHandler(this.Button_huespedClick) : new System.EventHandler(this.Button_pacienteClick); // ternario para definir a que función llamar

            this.Controls.Add(btn);                                                                                                                                  // se agrega el botón a los controles del formulario
            lista.Add(btn);

            if (str.Equals("+ Añadir Huesped")) // If para comprobar que el str sea igual al argumento
            {
                count_btn1++;                   // contador huésped
            }
            else
            {
                count_btn2++;                 // contador paciente
            }
        }
コード例 #10
0
 void loadROOMS()
 {
     switchsPlace.Controls.Clear();
     materialFlatButton2.Text = "rooms";
     switchsPlace.Controls.Add(materialFlatButton2);
     switchsPlace.Controls.Add(materialFlatButton8);
     foreach (var item in theRooms)
     {
         int buf = 0;
         foreach (var item2 in loads)
         {
             if (item2.roomName == item)
             {
                 buf += 1;
             }
         }
         if (buf != 0)
         {
             MaterialFlatButton x = new MaterialFlatButton();
             x.Text   = item;
             x.Click += x_Click;
             switchsPlace.Controls.Add(x);
         }
     }
 }
コード例 #11
0
        private void mThongKeNhapHang_Click(object sender, EventArgs e)
        {
            lblTieuDe.Text = "Thống kê nhập hàng";
            Cursor.Current = Cursors.WaitCursor;
            XuLyChuyenForm();
            FrmThongKeNhapHang m_FrmThongKeNhapHang = FrmThongKeNhapHang.Instance;

            f = m_FrmThongKeNhapHang;
            m_FrmThongKeNhapHang.MdiParent = this;
            m_FrmThongKeNhapHang.Dock      = DockStyle.Fill;
            m_FrmThongKeNhapHang.Show();

            Label lbl = new Label();

            lbl.Dock      = DockStyle.Left;
            lbl.Text      = "Lập báo cáo nhanh";
            lbl.ForeColor = Color.CadetBlue;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.Font      = new Font("SegoeUI", 11, FontStyle.Bold);
            panelBaoCao.Controls.Add(lbl);
            lbl.BringToFront();

            MaterialFlatButton btnTatCaPhieuNhap = new MaterialFlatButton();

            btnTatCaPhieuNhap.Dock   = DockStyle.Left;
            btnTatCaPhieuNhap.Text   = "Tất cả phiếu nhập";
            btnTatCaPhieuNhap.Name   = "TatCaPhieuNhap";
            btnTatCaPhieuNhap.Click += btn_Click;
            panelBaoCao.Controls.Add(btnTatCaPhieuNhap);
            btnTatCaPhieuNhap.BringToFront();
        }
コード例 #12
0
 public void btnRemoveDownload_Click(object sender, System.EventArgs e)
 {
     MaterialFlatButton removeDownload = (MaterialFlatButton)sender;
     Panel senderParent = (Panel)removeDownload.Parent;
     int senderIndex = flpDownloadQueue.Controls.IndexOf(removeDownload);
     //*code for stopping download goes here*
     RemoveFromQueuePanel(senderIndex);
 }
コード例 #13
0
        public static MaterialFlatButton creaBottone(Point point, string text, EventHandler action)
        {
            MaterialFlatButton button = new MaterialFlatButton();

            button.Text     = text;
            button.Location = point;
            button.Click   += action;
            return(button);
        }
コード例 #14
0
ファイル: SizePanel.cs プロジェクト: phamhongphuc1999/Caro
        private void DrawSizeButtonPanel()
        {
            containerPnl = new Panel
            {
                Location = new Point(5, 5),
                Size     = new Size(630, 330)
            };
            resizePanel = new ResizePanel(false, true)
            {
                Location    = new Point(5, 5),
                Size        = new Size(620, 320),
                BorderStyle = BorderStyle.FixedSingle,
                MaximumSize = new Size(620, 320),
                MinimumSize = new Size(115, 115)
            };
            resizePanel.SizeChanged += ResizePanel_SizeChanged;
            containerPnl.Controls.Add(resizePanel);
            int X = 20, Y = 20;

            for (int i = 0; i < Constants.MAX_ROW; i++)
            {
                for (int j = 0; j < Constants.MAX_COLUMN; j++)
                {
                    MaterialFlatButton but = new MaterialFlatButton
                    {
                        Location = new Point(X, Y),
                        Size     = new Size(20, 20),
                        Enabled  = false
                    };
                    containerPnl.Controls.Add(but);
                    X += 20;
                }
                X = 20; Y += 20;
            }
            X = 14; Y = 14;
            for (int i = 0; i < 15; i++)
            {
                for (int j = 0; j < 30; j++)
                {
                    BoardButton but = new BoardButton
                    {
                        Location = new Point(X, Y),
                        Size     = new Size(20, 20),
                        Rows     = i,
                        Columns  = j
                    };
                    but.Click += But_Click;
                    resizePanel.Controls.Add(but);
                    X          += 20;
                    board[i, j] = 3;
                    butList.Add(new BoardPosition(i, j), but);
                }
                X = 14; Y += 20;
            }
            this.Controls.Add(containerPnl);
        }
コード例 #15
0
        public static void Start(MaterialFlatButton button)
        {
            bool newVersion = UpdateCheck.IsNewVersionAvailable();

            if (newVersion == true)
            {
                button.Visible = true;
                UpdateCheck.StartUpdate();
            }
        }
コード例 #16
0
ファイル: MainForm.cs プロジェクト: HowToDoThis/NekoProject
        private void ButtonMap_Click(object sender, EventArgs e)
        {
            MaterialFlatButton btn = (MaterialFlatButton)sender;

            checkBoxLoadMap.Checked = true;

            launcherSettingsManager.lastMap = btn.Tag.ToString();
            lastMapLabel      = labelMapName.Text = btn.Text;
            labelMapName.Text = checkBoxLoadMap.Checked ? lastMapLabel : mapLoadDisable;
        }
コード例 #17
0
        private void AttachDoneButton( )
        {
            var button = new MaterialFlatButton();

            button.Text     = "Done";
            button.Location = new Point(tabpage_modules.Size.Width - button.Size.Width - 10, tabpage_modules.Size.Height - button.Size.Height);
            button.Click   += delegate
            {
                tabControl.SelectTab(1);
            };
            button.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            tabpage_modules.Controls.Add(button);
        }
コード例 #18
0
ファイル: MainForm.cs プロジェクト: zmxtcc/MaterialWinforms
        void materialTimeline1_onTimeLineEntryClicked(MaterialTimeLineEntry sender, EventArgs e)
        {
            HeadsUp objTest = new HeadsUp();

            objTest.Titel = sender.Title;
            objTest.Text  = sender.Text;
            MaterialFlatButton DismissHeadsUp = new MaterialFlatButton();

            DismissHeadsUp.Tag    = objTest;
            DismissHeadsUp.Text   = "Dismiss";
            DismissHeadsUp.Click += DismissHeadsUp_Click;
            objTest.Buttons.Add(DismissHeadsUp);
            objTest.Show();
        }
コード例 #19
0
ファイル: MainForm.cs プロジェクト: zmxtcc/MaterialWinforms
        private void materialFlatButton4_Click(object sender, EventArgs e)
        {
            HeadsUp objTest = new HeadsUp();

            objTest.Titel = "Title";
            objTest.Text  = "Description Text to show Something that happend";
            MaterialFlatButton DismissHeadsUp = new MaterialFlatButton();

            DismissHeadsUp.Tag    = objTest;
            DismissHeadsUp.Text   = "Dismiss";
            DismissHeadsUp.Click += DismissHeadsUp_Click;
            objTest.Buttons.Add(DismissHeadsUp);
            objTest.Show();
        }
コード例 #20
0
        private void mBanHang_Click(object sender, EventArgs e)
        {
            lblTieuDe.Text = "Bán hàng";
            Cursor.Current = Cursors.WaitCursor;
            XuLyChuyenForm();
            FrmBanHang m_frmBanHang = FrmBanHang.Instance;

            f = m_frmBanHang;
            m_frmBanHang.MdiParent = this;
            m_frmBanHang.Dock      = DockStyle.Fill;
            m_frmBanHang.Show();

            Label lbl = new Label();

            lbl.Dock      = DockStyle.Left;
            lbl.Text      = "Tùy chọn nhanh";
            lbl.ForeColor = Color.CadetBlue;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.Font      = new Font("SegoeUI", 11, FontStyle.Bold);
            panelBaoCao.Controls.Add(lbl);
            lbl.BringToFront();

            MaterialFlatButton btnLichSuHoaDon = new MaterialFlatButton();

            btnLichSuHoaDon.Dock   = DockStyle.Left;
            btnLichSuHoaDon.Text   = "Lịch sử hoá đơn";
            btnLichSuHoaDon.Name   = "LichSuHoaDon";
            btnLichSuHoaDon.Click += btn_Click;
            panelBaoCao.Controls.Add(btnLichSuHoaDon);
            btnLichSuHoaDon.BringToFront();

            MaterialFlatButton btnHoaDonMoiNhat = new MaterialFlatButton();

            btnHoaDonMoiNhat.Dock   = DockStyle.Left;
            btnHoaDonMoiNhat.Text   = "Hóa đơn mới nhất";
            btnHoaDonMoiNhat.Name   = "HoaDonMoiNhat";
            btnHoaDonMoiNhat.Click += btn_Click;
            panelBaoCao.Controls.Add(btnHoaDonMoiNhat);
            btnHoaDonMoiNhat.BringToFront();

            MaterialFlatButton btnHoaDonTrongNgay = new MaterialFlatButton();

            btnHoaDonTrongNgay.Dock   = DockStyle.Left;
            btnHoaDonTrongNgay.Text   = "Hóa đơn trong ngày";
            btnHoaDonTrongNgay.Name   = "HoaDonTrongNgay";
            btnHoaDonTrongNgay.Click += btn_Click;
            panelBaoCao.Controls.Add(btnHoaDonTrongNgay);
            btnHoaDonTrongNgay.BringToFront();
        }
コード例 #21
0
        void creaTutto()
        {
            Controls.Add(Program.creaLabel(new Point(dimSchermo.Width / 21 * 10, dimSchermo.Height / 20 * 2), "ESAMI ECDL", "Niente", "Niente"));
            Controls[0].BackColor = Color.White;
            Controls.Add(Program.creaPanel(new Size(dimSchermo.Width, dimSchermo.Height / 6 * 5), new Point(MaximumSize.Width / 12, 140), "Principale", "Principale", Color.White, true));
            MaterialFlatButton button = new MaterialFlatButton();

            button.Location = new Point(dimSchermo.Width / 21 * 18, dimSchermo.Height / 20 * 2);
            button.Text     = "visualizza skillcard";
            button.Name     = "visualizza";
            button.Click   += azioneBottone;
            button.Visible  = false;
            Controls.Add(button);
            creaContenitore(Program.tabelle[0], "", 0, null);
        }
コード例 #22
0
        public actionDialog(list_task listagem, int IdProjeto, string Status)
        {
            Label label = new Label();

            label.Text     = "Oque você deseja fazer a seguir?";
            label.Font     = new Font("Arial", 10, FontStyle.Regular);
            label.Size     = new Size(230, 25);
            label.Location = new Point(35, 20);
            this.Controls.Add(label);

            if (Status == "DONE")
            {
                MaterialFlatButton complete = new MaterialFlatButton();
                complete.Text = "Refazer";
                // adiciona ação ao clique do button
                complete.Click   += delegate(object sender, EventArgs args) { this.Close(); listagem.alteraStatusTarefa(IdProjeto, "TODO"); };
                complete.Location = new Point(85, 50);
                this.Controls.Add(complete);
            }
            else
            {
                MaterialFlatButton complete = new MaterialFlatButton();
                complete.Text = "Completar";
                // adiciona ação ao clique do button
                complete.Click   += delegate(object sender, EventArgs args) { this.Close(); listagem.alteraStatusTarefa(IdProjeto, "DONE"); };
                complete.Location = new Point(85, 50);
                this.Controls.Add(complete);
            }

            MaterialFlatButton edit = new MaterialFlatButton();

            edit.Text = "Editar";
            // adiciona ação ao clique do button
            edit.Click   += delegate(object sender, EventArgs args) { this.Close(); /* Chamar tela de edição passando o id */ };
            edit.Location = new Point(10, 50);
            this.Controls.Add(edit);

            MaterialRaisedButton delete = new MaterialRaisedButton();

            delete.Text = "Remover";
            // adiciona ação ao clique do button
            delete.Click   += delegate(object sender, EventArgs args) { this.Close(); listagem.removerTarefa(IdProjeto); };
            delete.Location = new Point(190, 50);
            this.Controls.Add(delete);
        }
コード例 #23
0
        private void LayDanhSachLoaiTopping(int maLoaiMon)
        {
            List <LoaiToppingDTO> dsLoaiTopping = LoaiToppingBUS.LayDanhSachCTLoaiMon_LoaiTopping(maLoaiMon);

            foreach (LoaiToppingDTO loaiTopping in dsLoaiTopping)
            {
                MaterialFlatButton btn = new MaterialFlatButton();
                btn.Text     = loaiTopping.TenLoaiTopping + " (" + ToppingBUS.LaySoLuongToppingTheoLoai(loaiTopping.MaLoaiTopping) + ")";
                btn.Name     = loaiTopping.MaLoaiTopping.ToString();
                btn.AutoSize = false;
                btn.Size     = new Size(140, 60);
                btn.Dock     = DockStyle.Left;
                btn.Tag      = loaiTopping;
                btn.Click   += new EventHandler(ChonLoai);
                panelLoai.Controls.Add(btn);
                btn.BringToFront();
            }
        }
コード例 #24
0
        private void SetActiveMenu(MaterialFlatButton btn)
        {
            if (btn != null)
            {
                //clear all at first
                foreach (MaterialFlatButton button in this.MenuControls())
                {
                    button.Selected    = false;
                    button.Capitalized = false;
                    button.ForeColor   = Color.Black;
                }

                // set active
                btn.ForeColor   = Color.Aqua;
                btn.Selected    = true;
                btn.Capitalized = true;
            }
        }
コード例 #25
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="mainForm"></param>
        /// <param name="progressFile"></param>
        /// <param name="progressAll"></param>
        /// <param name="progressText"></param>
        /// <param name="progressDetails"></param>
        /// <param name="progressCurFile"></param>
        /// <param name="launcherButton"></param>
        public Installer(MainForm2 mainForm, Windows7ProgressBar progressFile, Windows7ProgressBar progressAll, Label progressText, Label progressDetails, Label progressCurFile, DoubleBufferFlowPanel flowpanelAddonPacks, PictureBox cancelButton,
                         MaterialSingleLineTextField gamePathBox, MaterialSingleLineTextField ts3PathBox, MaterialSingleLineTextField addonsPathBox, PictureBox gamePathErase, PictureBox ts3PathErase, PictureBox addonsPathErase, PictureBox gamePathFind, PictureBox ts3PathFind, PictureBox addonsPathFind,
                         MaterialRaisedButton ts3Plugin, MaterialFlatButton repoValidateBtn)
        {
            this.activeForm = "mainForm";
            this.mainForm   = mainForm;

            // define controls
            this.progressFile        = progressFile;
            this.progressAll         = progressAll;
            this.progressText        = progressText;
            this.progressDetails     = progressDetails;
            this.progressCurFile     = progressCurFile;
            this.flowpanelAddonPacks = flowpanelAddonPacks;
            this.cancelButton        = cancelButton;
            this.repoValidateBtn     = repoValidateBtn;

            // define controls (directory fields)
            this.gamePathBox   = gamePathBox;
            this.gamePathErase = gamePathErase;
            this.gamePathFind  = gamePathFind;

            this.ts3PathBox   = ts3PathBox;
            this.ts3PathErase = ts3PathErase;
            this.ts3PathFind  = ts3PathFind;

            this.addonsPathBox   = addonsPathBox;
            this.addonsPathErase = addonsPathErase;
            this.addonsPathFind  = addonsPathFind;

            // define controls (toolstrip menu items)
            this.ts3Plugin = ts3Plugin;

            // define background worker
            this.installFiles.DoWork             += InstallFiles_DoWork;
            this.installFiles.RunWorkerCompleted += InstallFiles_RunWorkerCompleted;

            this.validateFiles.DoWork             += ValidateFiles_DoWork;
            this.validateFiles.RunWorkerCompleted += ValidateFiles_RunWorkerCompleted;

            // define timer
            this.delayLaunch.Interval = 2000;
            this.delayLaunch.Tick    += DelayLaunch_Tick;
        }
コード例 #26
0
        private void SetupRecentList()
        {
            RecentList.Controls.Clear();

            MaterialFlatButton       button;
            MaterialContextMenuStrip menu;

            foreach (string file in Config.GetRecentFiles())
            {
                Campaign campaign = Campaign.FromFile(file);

                if (!campaign)
                {
                    continue;
                }

                RecentList.Controls.Add(button = new MaterialFlatButton()
                {
                    Text        = campaign.name,
                    Dock        = DockStyle.Top,
                    MaximumSize = new Size(0, 28),
                    Tag         = file,
                });

                menu = new MaterialContextMenuStrip();
                menu.Items.Add("Remove", null, (sender, e) =>
                {
                    Config.RemoveRecentFile(file);
                    SetupRecentList();
                });

                button.Click += (sender, e) =>
                {
                    Globals.IsFileOpened = true;
                    Globals.MainWindow.GetPage <EditorMainPage>("pages:editormain").GoToFileTab();
                    Globals.MainWindow.GetPage <EditorMainPage>("pages:editormain").LoadCampaign(file);
                    Globals.MainWindow.SetPage("pages:editormain");
                };

                button.ContextMenuStrip = menu;

                button.BringToFront();
            }
        }
コード例 #27
0
        public void bindToView()
        {
            editor                   = new IDEBox();
            editor.Language          = Language.Custom;
            editor.AutoIndentNeeded += (Object sender, AutoIndentEventArgs e) =>
            {
                if (e.LineText.Trim().ToLower() == "begin")
                {
                    e.ShiftNextLines = e.TabLength;
                    return;
                }
                if (Regex.IsMatch(e.LineText.Trim().ToLower(), @"end(;|.)"))
                {
                    e.Shift          = -e.TabLength;
                    e.ShiftNextLines = -e.TabLength;
                    return;
                }
                if (Regex.IsMatch(e.PrevLineText.ToLower(), @"\b(do|then|else)\b") && !Regex.IsMatch(e.PrevLineText.ToLower(), @"\b(begin)\b"))
                {
                    e.Shift = e.TabLength;
                    return;
                }
            };
            switch (getExtension())
            {
            case ".pas":
                editor.DescriptionFile = "syntax\\" + Properties.Settings.Default.SyntaxHighlightColor;
                break;

            default:
                editor.DescriptionFile = null;
                break;
            }
            editor.Text         = File.ReadAllText(virtualPath);
            editor.KeyDown     += Editor_KeyDown;
            editor.TextChanged += Editor_TextChanged;
            MainForm.activeForm.idePanel.Controls.Add(editor);
            button          = new MaterialFlatButton();
            button.MouseUp += Button_MouseUp;
            MainForm.activeForm.leftPanel.Controls.Add(button);
            updateView();
        }
コード例 #28
0
ファイル: Main.cs プロジェクト: nekinci/quizapp-csharp
        public void FlowLayoutPanelCiz()
        {
            flowLayoutPanel1.Controls.Clear();
            bildirimler = Database.Select.BildirimleriCek();
            if (bildirimler.FindAll(x => x.GorulduMu == false).Count > 0)
            {
                btnBildirim.Image = Properties.Resources.bildirimvar;
            }
            else
            {
                btnBildirim.Image = Properties.Resources.bildirimyok;
            }

            bildirimler = bildirimler.OrderByDescending(x => x.Tarih).ToList();
            foreach (var i in bildirimler.FindAll(x => x.OkunduMu == false).Take(Sinir))
            {
                UCBildirim bildirim = new UCBildirim();
                bildirim.Main = this;
                bildirim.SetBildirim(i);
                flowLayoutPanel1.Controls.Add(bildirim);
            }

            if (bildirimler.FindAll(x => x.OkunduMu == false).Count <= 0)
            {
                Label label = new Label();
                label.Text      = "Okunmamış bildiriminiz yok.";
                label.TextAlign = ContentAlignment.MiddleCenter;
                label.AutoSize  = false;
                label.Size      = new Size(flowLayoutPanel1.Size.Width, 30);
                flowLayoutPanel1.Controls.Add(label);
            }

            MaterialFlatButton tumunugor = new MaterialFlatButton();

            tumunugor.Text = "Tümünü gör";
            tumunugor.Dock = DockStyle.Bottom;

            tumunugor.Click += Tumunugor_Click;
            flowLayoutPanel1.Controls.Add(tumunugor);
        }
コード例 #29
0
        private void mNhapHang_Click(object sender, EventArgs e)
        {
            lblTieuDe.Text = "Nhập hàng";
            Cursor.Current = Cursors.WaitCursor;
            XuLyChuyenForm();
            FrmNhapHang m_frmNhapHang = FrmNhapHang.Instance;

            f = m_frmNhapHang;
            m_frmNhapHang.MdiParent = this;
            m_frmNhapHang.Dock      = DockStyle.Fill;
            m_frmNhapHang.Show();

            Label lbl = new Label();

            lbl.Dock      = DockStyle.Left;
            lbl.Text      = "Lập báo cáo nhanh";
            lbl.ForeColor = Color.CadetBlue;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.Font      = new Font("SegoeUI", 11, FontStyle.Bold);
            panelBaoCao.Controls.Add(lbl);
            lbl.BringToFront();

            MaterialFlatButton btnPhieuNhapMoiNhat = new MaterialFlatButton();

            btnPhieuNhapMoiNhat.Dock   = DockStyle.Left;
            btnPhieuNhapMoiNhat.Text   = "Phiếu nhập mới nhất";
            btnPhieuNhapMoiNhat.Name   = "PhieuNhapMoiNhat";
            btnPhieuNhapMoiNhat.Click += btn_Click;
            panelBaoCao.Controls.Add(btnPhieuNhapMoiNhat);
            btnPhieuNhapMoiNhat.BringToFront();

            MaterialFlatButton btnPhieuNhapTrongNgay = new MaterialFlatButton();

            btnPhieuNhapTrongNgay.Dock   = DockStyle.Left;
            btnPhieuNhapTrongNgay.Text   = "Phiếu nhập trong ngày";
            btnPhieuNhapTrongNgay.Name   = "PhieuNhapTrongNgay";
            btnPhieuNhapTrongNgay.Click += btn_Click;
            panelBaoCao.Controls.Add(btnPhieuNhapTrongNgay);
            btnPhieuNhapTrongNgay.BringToFront();
        }
コード例 #30
0
ファイル: MainForm.cs プロジェクト: HowToDoThis/NekoProject
        // TODO 根据文本长度更改间隔

        private void AddMap(string name, int width)
        {
            var label = launcherIni["Maps"][name]; label = label == null ? name : label;

            MaterialFlatButton btnAdd = new MaterialFlatButton();

            btnAdd.Location   = new System.Drawing.Point(totalMaps / 7 * width + 28, totalMaps % 7 * 38 + 25);
            btnAdd.Name       = "btnAdd";
            btnAdd.TabIndex   = 0;
            btnAdd.Text       = label;
            btnAdd.Tag        = name;
            btnAdd.AutoSize   = true;
            btnAdd.Depth      = 0;
            btnAdd.MouseState = MaterialSkin.MouseState.HOVER;
            btnAdd.Primary    = false;

            btnAdd.Click += new System.EventHandler(this.ButtonMap_Click);

            panelMaps.Controls.Add(btnAdd);

            totalMaps++;
        }