Example #1
0
            private void ProcessMouse(MouseEventArgs e)
            {
                if (!IsDestination && e.Button == MouseButtons.Left)
                {
                    FormParent.sourceTextureMap.End = Quantize2(FromVisualCoord(e.Location, true), true);
                    FormParent.UpdateScaling();

                    Invalidate();
                    FormParent.destinationTextureMap.Invalidate();
                }
                else if (IsDestination && e.Button == MouseButtons.Left)
                {
                    var newStart = Quantize2(FromVisualCoord(e.Location, false), false);
                    var size     = (FormParent.sourceTextureMap.End - FormParent.sourceTextureMap.Start) * FormParent.destinationTextureMap.Scaling;

                    var finalStart = FormParent.destinationTextureMap.Start;

                    if (newStart.X >= 0 && newStart.X + size.X <= VisibleTexture.Image.Size.X)
                    {
                        finalStart.X = newStart.X;
                    }

                    if (newStart.Y >= 0 && newStart.Y + size.Y <= VisibleTexture.Image.Size.Y)
                    {
                        finalStart.Y = newStart.Y;
                    }

                    FormParent.destinationTextureMap.Start = finalStart;

                    Invalidate();
                }
            }
Example #2
0
        protected virtual ResultData ExecuteForm(PokeBall args)
        {
            ResultData resultData    = new ResultData();
            var        dllIndividual = Assembly.LoadFile(Application.ExecutablePath);
            string     typeFormat    = "{0}.FormUI.Prefix{1}.W{2}";
            string     txnId         = args.TXF_TID.Substring(2, 5);
            Type       myType        = dllIndividual.GetType(string.Format(typeFormat, Path.GetFileNameWithoutExtension(Application.ExecutablePath), txnId.Substring(0, 1), txnId));

            if (myType == null)
            {
                MessageDisplay.Error("無此程式");
            }

            object myObj = Activator.CreateInstance(myType, txnId, args.TXF_TID_NAME);

            FormParent formInstance = (FormParent)myObj;


            if (formInstance.BeforeOpen() == ResultStatus.Success)
            {
                formInstance.MdiParent     = this.MdiParent;
                formInstance.StartPosition = FormStartPosition.Manual;
                formInstance.WindowState   = FormWindowState.Maximized;
                formInstance.Show();
            }
            formInstance.IsPreventFlowExportAfter = true;
            ExecuteFormBefore(formInstance, args);
            resultData.Status = formInstance.ProcessExport();
            formInstance.Close();

            return(resultData);
        }
Example #3
0
        protected override void ExecuteFormBefore(FormParent formInstance, PokeBall args)
        {
            ((CheckBox)formInstance.Controls.Find("cbxNews", true)[0]).Checked            = true;
            ((TextDateEdit)formInstance.Controls.Find("txtSDate", true)[0]).DateTimeValue = txtOcfDate.DateTimeValue;

            if (args.TXF_TID == "w_30055")
            {
                ((CheckBox)formInstance.Controls.Find("cbxTJF", true)[0]).Checked = true;
            }
        }
 private void _btnLoadPictures_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (RasterImageListItem i in _browser.SelectedItems)
         {
             RasterImage image = MainForm._codecs.Load(i.FileName);
             FormParent.CreateChildForm(image, i.FileName);
         }
     }
     catch (Exception ex)
     {
         Messager.ShowError(this, ex);
     }
 }
Example #5
0
 private void UnidadmedidaMntFrm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (FormParent != null)
     {
         if (SeEliminoObjeto)
         {
             FormParent.CargarDatosConsulta();
         }
         if (SeGuardoObjeto)
         {
             FormParent.IdEntidadMnt = IdEntidadMnt;
             FormParent.CargarDatosConsulta();
             FormParent.SetFocusIdEntity();
         }
     }
     e.Cancel = false;
 }
Example #6
0
 protected virtual void ExecuteFormBefore(FormParent formInstance, PokeBall args)
 {
 }