private void initSpecial(String name, Color cor, String ordspecialid) { Panel pnCri1 = new Panel(); C1PictureBox picSelect = new C1PictureBox(); C1Label lbFoot1 = new C1Label(); C1Label lbFoot2 = new C1Label(); C1Label lbID = new C1Label(); pnCri1.BackColor = Color.FromArgb(255, 209, 81); pnCri1.Dock = System.Windows.Forms.DockStyle.Top; //pnCri1.Location = new System.Drawing.Point(0, 85); pnCri1.Size = new System.Drawing.Size(390, 47); pnCri1.Name = "pnCri" + cnt; pnCri1.BorderStyle = BorderStyle.FixedSingle; pnCri1.BackColor = cor; if (mposC.iniC.ucOrderTakeOutpnToppingBorderStyle.Equals("0")) { pnCri1.BorderStyle = BorderStyle.None; } else if (mposC.iniC.ucOrderTakeOutpnToppingBorderStyle.Equals("1")) { pnCri1.BorderStyle = BorderStyle.FixedSingle; } else if (mposC.iniC.ucOrderTakeOutpnToppingBorderStyle.Equals("1")) { pnCri1.BorderStyle = BorderStyle.Fixed3D; } pnCri1.Click += PicSpecSelect_Click; picSelect.Image = global::modernpos_pos.Properties.Resources.circle_png_circle_icon_1600; picSelect.Location = new System.Drawing.Point(4, 8); picSelect.Name = "picSelect" + cnt; picSelect.Size = new System.Drawing.Size(32, 32); picSelect.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; picSelect.TabStop = false; picSelect.Click += PicSpecSelect_Click; lbFoot1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(209)))), ((int)(((byte)(81))))); lbFoot1.BorderStyle = System.Windows.Forms.BorderStyle.None; lbFoot1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lbFoot1.Location = new System.Drawing.Point(40, 8); lbFoot1.Name = "lbFoot1" + cnt; lbFoot1.Size = new System.Drawing.Size(232, 31); lbFoot1.TabIndex = 6; lbFoot1.Tag = null; lbFoot1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; lbFoot1.Value = name; lbFoot1.BackColor = cor; lbFoot1.Click += PicSpecSelect_Click; lbFoot2.Name = "lbFoot12" + cnt; lbFoot2.Visible = false; lbID.Visible = false; lbID.Value = ordspecialid; lbID.Name = "lbOrdSpecID" + cnt; pnCri1.Controls.Add(picSelect); pnCri1.Controls.Add(lbFoot1); pnCri1.Controls.Add(lbFoot2); pnCri1.Controls.Add(lbID); tpl.Controls.Add(pnCri1, 0, tpl.RowCount++); }
private void Grf_DoubleClick(object sender, EventArgs e) { //throw new NotImplementedException(); MessageBox.Show("Row " + ((C1FlexGrid)sender).Row + "\n grf name " + ((C1FlexGrid)sender).Name, "Col " + ((C1FlexGrid)sender).Col + " id " + ((C1FlexGrid)sender)[((C1FlexGrid)sender).Row, colPic2].ToString()); String id = ""; id = ((C1FlexGrid)sender)[((C1FlexGrid)sender).Row, colPic2].ToString(); MemoryStream strm = null; foreach (listStream lstrmm in lStream) { if (lstrmm.id.Equals(id)) { strm = lstrmm.stream; break; } } if (strm != null) { img = Image.FromStream(strm); frmImg = new Form(); FlowLayoutPanel pn = new FlowLayoutPanel(); //vScroller = new VScrollBar(); //vScroller.Height = frmImg.Height; //vScroller.Width = 15; //vScroller.Dock = DockStyle.Right; frmImg.WindowState = FormWindowState.Normal; frmImg.StartPosition = FormStartPosition.CenterScreen; frmImg.Size = new Size(1024, 764); frmImg.AutoScroll = true; pn.Dock = DockStyle.Fill; pn.AutoScroll = true; pic = new C1PictureBox(); pic.Dock = DockStyle.Fill; pic.SizeMode = PictureBoxSizeMode.AutoSize; //int newWidth = 440; int originalWidth = 0; originalHeight = 0; originalWidth = img.Width; originalHeight = img.Height; //resizedImage = img.GetThumbnailImage(newWidth, (newWidth * img.Height) / originalWidth, null, IntPtr.Zero); resizedImage = img.GetThumbnailImage((newHeight * img.Width) / originalHeight, newHeight, null, IntPtr.Zero); pic.Image = resizedImage; frmImg.Controls.Add(pn); pn.Controls.Add(pic); //pn.Controls.Add(vScroller); mouseWheel = 0; pic.MouseWheel += Pic_MouseWheel; //vScroller.Scroll += VScroller_Scroll; //pic.Paint += Pic_Paint; //vScroller.Hide(); frmImg.ShowDialog(this); } }
private void PicTrahTopping_Click(object sender, EventArgs e) { //throw new NotImplementedException(); String name = "", cnt = ""; Panel pn = new Panel(); C1PictureBox pic = (C1PictureBox)sender; cnt = pic.Name.Replace("picTrahTopping", ""); pn = (Panel)tpl.Controls["pnCri" + cnt]; pn.Dispose(); setPrice(); }
private void initConfig() { fEdit = new Font(bc.iniC.grdViewFontName, bc.grdViewFontSize, FontStyle.Regular); fEditB = new Font(bc.iniC.grdViewFontName, bc.grdViewFontSize, FontStyle.Bold); pnMain = new Panel(); picTop = new C1PictureBox(); picLeft = new C1PictureBox(); picRight = new C1PictureBox(); screenWidth = Screen.PrimaryScreen.Bounds.Width; screenHeight = Screen.PrimaryScreen.Bounds.Height; lFile = new List <string>(); lFilePrint = new List <string>(); picScr = new C1PictureBox(); picScr.Location = new System.Drawing.Point(0, 0); picScr.Dock = DockStyle.Fill; picScr.Name = "picScr"; //picScr.Size = new System.Drawing.Size(screenWidth / 2, screenHeight); //picScr.Image = Resources.screen_first_l; picScr.SizeMode = PictureBoxSizeMode.StretchImage; pnPic.Controls.Add(picScr); this.Activated += FrmScreenCapture_Activated; this.FormClosed += FrmScreenCapture_FormClosed; txtHn.KeyUp += TxtHn_KeyUp; chkView.Click += ChkView_Click; chkUpload.Click += ChkUpload_Click; btnSearch.Click += BtnSearch_Click; chkUpload.Checked = true; initGrfView(); //FrmScreenCapturePrintMulti frm = new FrmScreenCapturePrintMulti(); //frm.Show(this); initPrintMulti(); if (File.Exists(bc.hn)) { getListFile(); } //MessageBox.Show("args "+bc.hn, ""); //pnMain.Hide(); //this.Width = this.Width - int.Parse(bc.iniC.imggridscanwidth); //this.Width = formwidth + int.Parse(bc.iniC.imggridscanwidth); }
private void showFormWaiting() { frmFlash = new Form(); frmFlash.Size = new Size(300, 300); frmFlash.StartPosition = FormStartPosition.CenterScreen; C1PictureBox picFlash = new C1PictureBox(); //Image img = new Image(); picFlash.SuspendLayout(); picFlash.Image = Resources.loading_transparent; picFlash.Width = 230; picFlash.Height = 230; picFlash.Location = new Point(30, 10); picFlash.SizeMode = PictureBoxSizeMode.StretchImage; frmFlash.Controls.Add(picFlash); picFlash.ResumeLayout(); frmFlash.Show(); Application.DoEvents(); }
private void PicMinusTopping_Click1(object sender, EventArgs e) { //throw new NotImplementedException(); String name = "", cnt = ""; Panel pn = new Panel(); C1Label lbQtyTopping = new C1Label(); C1Label lbID = new C1Label(); C1PictureBox pic = (C1PictureBox)sender; cnt = pic.Name.Replace("picMinusTopping", ""); pn = (Panel)tpl.Controls["pnCri" + cnt]; lbQtyTopping = (C1Label)pn.Controls["lbQtyTopping" + cnt]; lbID = (C1Label)pn.Controls["lbOrdTopping" + cnt]; if (lbQtyTopping.Text.Equals("")) { return; } int chk = 0; if (int.TryParse(lbQtyTopping.Text, out chk)) { if (chk <= 0) { return; } chk--; lbQtyTopping.Value = chk.ToString(); //qty = chk.ToString(); } foreach (OrderTopping ordt in lordt) { if (ordt.foods_topping_id.Equals(lbID.Text)) { ordt.status_ok = "1"; ordt.qty = lbQtyTopping.Text; //ordt.price = ""; break; } } setPrice(); }
private void setPicStaffNote() { //pnL = new Panel(); //pnL.Dock = DockStyle.Left; //pnL.Width = tabScan.Width / 2; //tabScan.Controls.Add(pnL); //pnR = new Panel(); //pnR.Dock = DockStyle.Fill; //pnR.Width = tabScan.Width / 2; //tabScan.Controls.Add(pnR); sct = new SplitContainer(); sct.Dock = DockStyle.Fill; tabScan.Controls.Add(sct); fpL = new FlowLayoutPanel(); fpL.Dock = DockStyle.Fill; fpL.AutoScroll = true; sct.Panel1.Controls.Add(fpL); //tabScan.Controls.Add(fpL); fpR = new FlowLayoutPanel(); fpR.Dock = DockStyle.Fill; fpR.AutoScroll = true; //tabScan.Controls.Add(fpR); sct.Panel2.Controls.Add(fpR); picL = new C1PictureBox(); picL = new C1PictureBox(); picL.Dock = DockStyle.Fill; picL.SizeMode = PictureBoxSizeMode.AutoSize; fpL.Controls.Add(picL); picR = new C1PictureBox(); picR = new C1PictureBox(); picR.Dock = DockStyle.Fill; picR.SizeMode = PictureBoxSizeMode.AutoSize; fpR.Controls.Add(picR); }
private void BtnCap1_Click(object sender, EventArgs e) { //throw new NotImplementedException(); if (!Directory.Exists(bc.iniC.pathScreenCaptureSend)) { Directory.CreateDirectory(bc.iniC.pathScreenCaptureSend); } this.Hide(); Thread.Sleep(200); Application.DoEvents(); ScreenCapture sc = new ScreenCapture(); sc.CaptureScreenToFile(bc.iniC.pathScreenCaptureSend + "\\cap1.jpg", ImageFormat.Jpeg); Thread.Sleep(200); Application.DoEvents(); C1DockingTabPage tabCap = new C1DockingTabPage(); Panel pnCap = new Panel(); pnCap.Dock = DockStyle.Fill; C1PictureBox pic = new C1PictureBox(); pic.Dock = DockStyle.Fill; pic.SizeMode = PictureBoxSizeMode.StretchImage; if (File.Exists(bc.iniC.pathScreenCaptureSend + "\\cap1.jpg")) { pic.Image = Image.FromFile(bc.iniC.pathScreenCaptureSend + "\\cap1.jpg"); } tabCap.Name = "tabCap"; tabCap.TabIndex = 0; tabCap.Text = "Capture 1"; tabCap.Font = fEditB; tC1.Controls.Add(tabCap); tabCap.Controls.Add(pnCap); pnCap.Controls.Add(pic); this.Show(); }
private void initConfig() { //Set up the form. this.MaximizeBox = false; this.MinimizeBox = false; this.BackColor = Color.White; this.ForeColor = Color.Black; pttOld = new PatientOld(); pttImg = new PatientImage(); pttOld = ic.ivfDB.pttOldDB.selectByPk1(pttOldId); pttImg = ic.ivfDB.pttImgDB.selectByPk1(pttImgId); this.Size = new System.Drawing.Size(1224, 768); fEdit = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Regular); //this.Location = pp; this.Text = "Run-time Controls"; this.FormBorderStyle = FormBorderStyle.FixedDialog; this.StartPosition = FormStartPosition.CenterParent; //this.StartPosition = FormStartPosition.CenterParent; panel1 = new Panel(); panel1.Dock = DockStyle.Fill; pnR = new Panel(); pnR.Dock = DockStyle.Right; pnR.Width = newWidth; pnL = new Panel(); pnL.Dock = DockStyle.Fill; lb2 = new Label(); lb2.Font = fEdit; lb2.Text = "Description"; lb2.AutoSize = true; pnR.Controls.Add(lb2); lb2.Location = new System.Drawing.Point(grd1, gapLine); txtId = new TextBox(); txtDesc = new TextBox(); txtDesc.Font = fEdit; txtDesc.Text = ""; txtDesc.Size = new System.Drawing.Size(200, ControlHeight); pnR.Controls.Add(txtDesc); txtDesc.Location = new System.Drawing.Point(grd1, lb2.Height + gapLine + gapLine); btnSend = new Button(); btnSend.Font = fEdit; btnSend.Text = "Save"; btnSend.Size = new System.Drawing.Size(120, ControlHeight); pnR.Controls.Add(btnSend); btnSend.Location = new System.Drawing.Point(grd1, line3); btnSend.Click += BtnSend_Click; btnPrn = new Button(); btnPrn.Font = fEdit; btnPrn.Text = "Print"; btnPrn.Size = new System.Drawing.Size(120, ControlHeight); pnR.Controls.Add(btnPrn); btnPrn.Location = new System.Drawing.Point(grd1, line4); btnPrn.Click += BtnPrn_Click; pic = new C1PictureBox(); pic.Dock = DockStyle.Fill; panel1.Controls.Add(pnR); panel1.Controls.Add(pnL); pnL.Controls.Add(pic); pnR.Controls.Add(btnSend); Controls.Add(panel1); String ext = Path.GetExtension(filename); //String[] sur = filename.Split('.'); //String ex = ""; //if (sur.Length == 2) //{ // ex = sur[1]; //} stream = new MemoryStream(); if (ext.IndexOf("pdf") < 0) { try { //loadedImage = Image.FromFile(filename); stream = ic.ftpC.download(filename); Bitmap bitmap = new Bitmap(stream); loadedImage = bitmap; int originalWidth = loadedImage.Width; int newWidth = 1000; if (originalWidth > newWidth) { resizedImage = loadedImage.GetThumbnailImage(newWidth, (newWidth * loadedImage.Height) / originalWidth, null, IntPtr.Zero); } else { resizedImage = loadedImage; } } catch (Exception ex1) { } } else { resizedImage = Resources.pdf_symbol_300; } //loadedImage = Image.FromFile(filename); //int originalWidth = loadedImage.Width; //resizedImage = loadedImage.GetThumbnailImage(newWidth, (newWidth * loadedImage.Height) / originalWidth, null, IntPtr.Zero); //pic.Image = resizedImage; if (stream.Length > 0) { pic.Image = Image.FromStream(stream); pic.SizeMode = PictureBoxSizeMode.StretchImage; } }
private void initTopping(String name, String price, Color cor, String footoppingid) { Panel pnCri1 = new Panel(); C1PictureBox picTrah = new C1PictureBox(); C1PictureBox picMinus = new C1PictureBox(); C1Label lbQty = new C1Label(); C1PictureBox picPlus = new C1PictureBox(); C1Label lbFoot1 = new C1Label(); C1Label lbPrice = new C1Label(); C1Label lbID = new C1Label(); //pnCri1.BackColor = ColorTranslator.FromHtml(mposC.iniC.TileFoodsBackColor); //pnCri1.BackColor = ColorTranslator.FromHtml(mposC.iniC.ucOrderTakeOutpnHeadBackColor); pnCri1.Dock = System.Windows.Forms.DockStyle.Top; //pnCri1.Location = new System.Drawing.Point(0, 85); pnCri1.Size = new System.Drawing.Size(390, 47); pnCri1.Name = "pnCri" + cnt; if (mposC.iniC.ucOrderTakeOutpnToppingBorderStyle.Equals("0")) { pnCri1.BorderStyle = BorderStyle.None; } else if (mposC.iniC.ucOrderTakeOutpnToppingBorderStyle.Equals("1")) { pnCri1.BorderStyle = BorderStyle.FixedSingle; } else if (mposC.iniC.ucOrderTakeOutpnToppingBorderStyle.Equals("1")) { pnCri1.BorderStyle = BorderStyle.Fixed3D; } pnCri1.BackColor = cor; picTrah.Image = global::modernpos_pos.Properties.Resources.exit; picTrah.Location = new System.Drawing.Point(360, 8); picTrah.Name = "picTrahTopping" + cnt; picTrah.Size = new System.Drawing.Size(32, 32); picTrah.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; picTrah.TabStop = false; //picMinus.Image = global::modernpos_pos.Properties.Resources.minus_red; picMinus.Image = global::modernpos_pos.Properties.Resources.minus; picMinus.Location = new System.Drawing.Point(241, 8); picMinus.Name = "picMinusTopping" + cnt; picMinus.Size = new System.Drawing.Size(32, 32); picMinus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; picMinus.TabIndex = 10; picMinus.TabStop = false; lbQty.BackColor = System.Drawing.SystemColors.MenuHighlight; lbQty.BorderStyle = System.Windows.Forms.BorderStyle.None; lbQty.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lbQty.Location = new System.Drawing.Point(276, 8); lbQty.Name = "lbQtyTopping" + cnt; lbQty.Size = new System.Drawing.Size(49, 32); lbQty.TabIndex = 12; lbQty.Tag = null; lbQty.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; //picPlus.Image = global::modernpos_pos.Properties.Resources.plus_green_100; picPlus.Image = global::modernpos_pos.Properties.Resources.plus; picPlus.Location = new System.Drawing.Point(327, 8); picPlus.Name = "picPlusTopping" + cnt; picPlus.Size = new System.Drawing.Size(32, 32); picPlus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; picPlus.TabIndex = 11; picPlus.TabStop = false; //lbFoot1.BackColor = ColorTranslator.FromHtml(mposC.iniC.ucOrderTakeOutpnHeadBackColor); lbFoot1.BorderStyle = System.Windows.Forms.BorderStyle.None; lbFoot1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lbFoot1.Location = new System.Drawing.Point(4, 8); lbFoot1.Name = "lbFootTopping" + cnt; lbFoot1.Size = new System.Drawing.Size(232, 31); lbFoot1.TabIndex = 6; lbFoot1.Tag = null; lbFoot1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; lbFoot1.Value = name; lbFoot1.BackColor = cor; picMinus.Click += PicMinusTopping_Click1; picPlus.Click += PicPlusTopping_Click1; picTrah.Click += PicTrahTopping_Click; lbPrice.Name = "lbPriceTopping" + cnt; lbPrice.Visible = false; lbPrice.Value = price; lbID.Value = footoppingid; lbID.Visible = false; lbID.Name = "lbOrdTopping" + cnt; pnCri1.Controls.Add(picTrah); pnCri1.Controls.Add(picMinus); pnCri1.Controls.Add(lbQty); pnCri1.Controls.Add(picPlus); pnCri1.Controls.Add(lbFoot1); pnCri1.Controls.Add(lbPrice); pnCri1.Controls.Add(lbID); //Padding padding = pnCri1.Padding; picTrah.Visible = false; tpl.Controls.Add(pnCri1, 0, tpl.RowCount++); }
private void PicSpecSelect_Click(object sender, EventArgs e) { //throw new NotImplementedException(); String name = "", cnt = ""; C1Label lbFoot1 = new C1Label(); C1Label lbFoot12 = new C1Label(); C1Label lbID = new C1Label(); C1PictureBox picSelect = new C1PictureBox(); if (sender is C1Label) { lbFoot1 = (C1Label)sender; cnt = lbFoot1.Name.Replace("lbFoot1", ""); Panel pn = new Panel(); pn = (Panel)tpl.Controls["pnCri" + cnt]; picSelect = (C1PictureBox)pn.Controls["picSelect" + cnt]; lbFoot12 = (C1Label)pn.Controls["lbFoot12" + cnt]; lbID = (C1Label)pn.Controls["lbOrdSpecID" + cnt]; } else if (sender is C1PictureBox) { picSelect = (C1PictureBox)sender; cnt = picSelect.Name.Replace("picSelect", ""); lbFoot1 = new C1Label(); Panel pn = new Panel(); pn = (Panel)tpl.Controls["pnCri" + cnt]; lbFoot12 = (C1Label)pn.Controls["lbFoot12" + cnt]; lbID = (C1Label)pn.Controls["lbOrdSpecID" + cnt]; } else if (sender is Panel) { Panel pn = (Panel)sender; cnt = pn.Name.Replace("pnCri", ""); lbFoot1 = new C1Label(); lbFoot1 = (C1Label)pn.Controls["lbFoot1" + cnt]; lbFoot12 = (C1Label)pn.Controls["lbFoot12" + cnt]; picSelect = (C1PictureBox)pn.Controls["picSelect" + cnt]; lbID = (C1Label)pn.Controls["lbOrdSpecID" + cnt]; } if (lbFoot12.Text.Equals("NO")) { picSelect.Image = global::modernpos_pos.Properties.Resources.images; //ord.foods_name = ord.foods_name + " 11111111"; lbFoot12.Value = "YES"; foreach (OrderSpecial ords in lords) { if (ords.foods_spec_id.Equals(lbID.Text)) { ords.status_ok = "1"; break; } } } else if (lbFoot12.Text.Equals("YES")) { picSelect.Image = global::modernpos_pos.Properties.Resources.circle_png_circle_icon_1600; //ord.foods_name = ""; lbFoot12.Value = "NO"; foreach (OrderSpecial ords in lords) { if (ords.foods_spec_id.Equals(lbID.Text)) { ords.status_ok = "0"; break; } } } else { picSelect.Image = global::modernpos_pos.Properties.Resources.images; lbFoot12.Value = "YES"; foreach (OrderSpecial ords in lords) { if (ords.foods_spec_id.Equals(lbID.Text)) { ords.status_ok = "1"; break; } } } }