/// <summary>
 /// 填充控件信息
 /// </summary>
 private void FillPreviewLabel()
 {
     Text     = PanelForm.GetShowStringValue();
     AutoSize = true;
     BringToFront();
     Tag = new TagInfo("text", PanelForm.GetShowStringValue());
 }
 /// <summary>
 /// 图片填充PictureBox
 /// </summary>
 /// <param name="exinfo"></param>
 public override void GeneratePictureBoxFillImage(ExportInfo exinfo = null)
 {
     if (String.IsNullOrEmpty(PanelForm.GetShowStringValue()))
     {
         MessageBox.Show(this, "条码内容不能为空!");
         return;
     }
     PicImage = GetBarCodeByZXingNet(PanelForm.GetShowStringValue(), PanelForm.GetWidthValue(), PanelForm.GetHeightValue());
     AddPictureBox(PicImage, new TagInfo("barcode", PanelForm.GetShowStringValue()));
 }
 private void            pictureBox_State_MouseClick(object aSender, MouseEventArgs aEventArgs)
 {
     if (aEventArgs.Button == MouseButtons.Left)
     {
         using (var lPanelForm = new PanelForm(mPump, "Control", LabelText))
         {
             lPanelForm.ShowDialog();
         }
     }
 }
Exemple #4
0
 /// <summary>
 /// 填充控件信息
 /// </summary>
 /// <param name="img"></param>
 /// <param name="tag"></param>
 private void PicBoxFillImage(Image img, TagInfo tag)
 {
     if (tag.Type == "background")
     {
         SendToBack();
     }
     else
     {
         SizeMode = PictureBoxSizeMode.StretchImage;
         Image    = img;
         BringToFront();
     }
     Size = new Size(PanelForm.GetWidthValue(), PanelForm.GetHeightValue());
     Tag  = tag;
 }
Exemple #5
0
        /// <summary>
        /// 图片填充PictureBox
        /// </summary>
        /// <param name="exinfo"></param>
        public override void GeneratePictureBoxFillImage(ExportInfo exinfo = null)
        {
            OpenFileDialog openFileDialog = null;

            if (exinfo != null)
            {
                PicImage = Image.FromFile(exinfo.taginfo.Info);
                PicImage = ZoomPicture(PicImage, PanelForm.GetWidthValue(), PanelForm.GetHeightValue());
            }
            else
            {
                openFileDialog = OpenFileDialogSelectImage();
            }
            AddPictureBox(PicImage, new TagInfo("image", openFileDialog.FileName));
        }
Exemple #6
0
 /// <summary>
 /// 添加PictureBox到Panel
 /// </summary>
 /// <param name="img"></param>
 /// <param name="tag"></param>
 protected void AddPictureBox(Image img, TagInfo tag)
 {
     this.SetPanelControlsEnabled(true);
     if (ResetMode)
     {
         PicBoxFillImage(img, tag);
         ResetMode = false;
     }
     else
     {
         PicBoxFillImage(img, tag);
         AddControlEvent();
     }
     PanelForm.SetShowStringText(string.Empty);
     this.SetButtonEnabled(true, null);
 }
 /// <summary>
 /// 添加Label到Panel
 /// </summary>
 public void AddLabel()
 {
     this.SetPanelControlsEnabled(true);
     if (ResetMode)
     {
         FillPreviewLabel();
         ResetMode = false;
     }
     else
     {
         FillPreviewLabel();
         AddControlEvent();
     }
     PanelForm.SetShowStringText(string.Empty);
     this.SetButtonEnabled(true, null);
 }
Exemple #8
0
 public void OnLogin(bool _success, string _message)
 {
     if (_success)
     {
         Debug.Log("YOU JUST LOGED ING SUCCESFULLY WOOOOO, HELLO " + _message);
         PanelLogin.SetActive(false);
         PanelForm.SetActive(false);
         PanelLogedIn.SetActive(true);
         welcome.text = "Welcome " + PlayerPrefs.GetString("username") + "!";
     }
     else
     {
         Debug.Log("WTF ERROR: " + _message);
         error.text = _message;
     }
 }
Exemple #9
0
        /// <summary>
        /// 选择要添加的图片
        /// </summary>
        /// <returns></returns>
        private OpenFileDialog OpenFileDialogSelectImage()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            try
            {
                openFileDialog.InitialDirectory = System.Environment.CurrentDirectory;
                openFileDialog.Title            = "选择要使用的图片";
                openFileDialog.Filter           = "图片文件|*.jpg;*.bmp;*.png;*.jpeg;*.gif";
                if (DialogResult.OK == openFileDialog.ShowDialog())
                {
                    PicImage = Image.FromStream(openFileDialog.OpenFile());
                    PicImage = ZoomPicture(PicImage, PanelForm.GetWidthValue(), PanelForm.GetHeightValue());
                }
                return(openFileDialog);
            }
            catch (Exception)
            {
                openFileDialog.Dispose();
                return(null);
            }
        }
Exemple #10
0
        private void GotoScreen(ScreenType targetScreenType)
        {
            currentScreenType = targetScreenType;
            ReleaseCheckedMenu();
            switch (targetScreenType)
            {
            case ScreenType.Welcome:
                _ = new WelcomeForm {
                    panel1 = { Parent = panel1 }
                };
                break;

            case ScreenType.Panel:
                _ = new PanelForm(propMenuItem)
                {
                    panel1 = { Parent = panel1 }
                };
                panelMenuItem.Checked = true;
                break;

            case ScreenType.GroupBox:
                _ = new GroupBoxForm(propMenuItem)
                {
                    panel1 = { Parent = panel1 }
                };
                gruopMenuItem.Checked = true;
                break;

            case ScreenType.StackPanel:
                _ = new StackPanelForm(propMenuItem)
                {
                    panel1 = { Parent = panel1 }
                };
                stackMenuItem.Checked = true;
                break;

            case ScreenType.DockPanel:
                _ = new DockPanelForm(propMenuItem)
                {
                    panel1 = { Parent = panel1 }
                };
                dockMenuItem.Checked = true;
                break;

            case ScreenType.TilePanel:
                _ = new TilePanelForm(propMenuItem)
                {
                    panel1 = { Parent = panel1 }
                };
                tileMenuItem.Checked = true;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(targetScreenType), targetScreenType, null);
            }

            if (currentScreenType != ScreenType.Welcome && MainMenu == null)
            {
                MainMenu = mainMenu1;
            }
        }
Exemple #11
0
        private void AccessLogin()
        {
            LoginPresenter presenter = new LoginPresenter(this);

            presenter.Acces();
            Response = response;
            presenter.Claves();
            Clave = clave;
            presenter.Nombre();
            NombreAuditor = nombreAuditor;

            switch (Response)
            {
            case 1:
                MessageBox.Show("Ingrese Usuario", "Auditoria SEMP", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtUser.Focus();
                break;

            case 2:
                MessageBox.Show("Ingrese Password", "Auditoria SEMP", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtPassword.Focus();
                break;

            case 3:
                MessageBox.Show("Complete los Campos Por favor", "Auditoria SEMP", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtUser.Focus();
                break;

            case 4:
                MessageBox.Show("Usuario y/o Contraseña Incorrectos", "Auditoria SEMP", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtUser.Focus();
                break;

            case 5:
                MessageBox.Show("No Tienes Nivel Suficiente para esta Aplicacion", "Auditoria SEMP", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtUser.Focus();
                break;

            case 6:
                MessageBox.Show("Tu usuario esta en USO / Bloqueado", "Auditoria SEMP", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtUser.Focus();
                break;

            case 404:
                MessageBox.Show("Error de Sistema", "Auditoria SEMP", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Application.Exit();
                break;

            case 9000:
                //Acces

                PanelForm form = new PanelForm();
                form.codigo        = Clave;
                form.NombreAuditor = NombreAuditor;
                this.Hide();
                form.Show();


                break;

            default:
                break;
            }


            //1 Empty User
            //2 Empty password
            //3 Empty all field
            //4 user or password incorrect
            //5 Incompatible level user
            //6 bloqued user
            // 9000 Acces ok!
            // 404 Failed Connection
        }