Exemplo n.º 1
0
 static public void ResizeObject(ref ResizeInfo R, ProgressBar pb, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1)
 {
     pb.Location = getLocation(R, pb, sngRow, sngCol);
     pb.Size     = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
     pb.Font     = ChangeFontSize(pb.Font, R.FS * adjustFont);
     pb.TabIndex = ++R.tabIndex;
 }
Exemplo n.º 2
0
 static public void ResizeObject(ref ResizeInfo R, DateTimePicker dt, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1)
 {
     dt.Location = getLocation(R, dt, sngRow, sngCol);
     dt.Size     = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
     dt.Font     = ChangeFontSize(dt.Font, R.FS * adjustFont);
     dt.TabIndex = ++R.tabIndex;
 }
Exemplo n.º 3
0
 static public void ResizeObject(ref ResizeInfo R, Button b, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1)
 {
     b.Location = getLocation(R, b, sngRow, sngCol);
     b.Size     = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
     b.Font     = ChangeFontSize(b.Font, R.FS * adjustFont);
     if (R.setTabIndex)
     {
         b.TabIndex = ++R.tabIndex;
     }
 }
Exemplo n.º 4
0
 static public void ResizeObject(ref ResizeInfo R, ListBox l, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 0.8f)
 {
     l.Location   = getLocation(R, l, sngRow, sngCol);
     l.Size       = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
     l.Font       = ChangeFontSize(l.Font, R.FS * adjustFont);
     l.ItemHeight = l.Font.Height;
     if (R.setTabIndex)
     {
         l.TabIndex = ++R.tabIndex;
     }
 }
Exemplo n.º 5
0
        // Adjust for screen resolution
        public void ResizeControls(ref ResizeInfo R, float RowStart, float ColStart)
        {
            this.R = R;

            Utils.ResizeObject(ref R, SubControls, 1, 1, 19, 43);
            {
                for (int i = 0; i < resizeNeeded.Length; i++)
                {
                    resizeNeeded[i] = true;
                }
                resizeSubstitutions(ref R);
            }
        }
Exemplo n.º 6
0
        static Point getLocation(ResizeInfo R, Control c, float nRow, float nCol)
        {
            Point result;

            if (c.Parent.GetType().Equals(typeof(TabPage)))
            {
                result = new System.Drawing.Point((int)(nCol * R.W), (int)(nRow * R.H + R.offset));
            }
            else
            {
                result = new System.Drawing.Point((int)(nCol * R.W), (int)(nRow * R.H));
            }
            return(result);
        }
Exemplo n.º 7
0
 static public void ResizeObject(ref ResizeInfo R, TextBox t, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1)
 {
     t.Location = getLocation(R, t, sngRow, sngCol);
     t.Size     = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
     t.Font     = ChangeFontSize(t.Font, R.FS * adjustFont);
     if (R.setTabIndex)
     {
         if (t.ReadOnly)
         {
             t.TabStop = false;
         }
         else
         {
             t.TabIndex = ++R.tabIndex;
         }
     }
 }
Exemplo n.º 8
0
        // Called on resize or category change
        private void resizeSubstitutions(ref ResizeInfo R)
        {
            Utils.ResizeObject(ref R, lblAttribute, 1.5f, 1, 1.5f, 3.5f);
            Utils.ResizeObject(ref R, cbAttribute, 3, 1, 2, 3.5f);

            Utils.ResizeObject(ref R, lblSource, 1.5f, 5, 1.5f, 3.5f);
            Utils.ResizeObject(ref R, cbSource, 3, 5, 2, 3.5f);

            Utils.ResizeObject(ref R, lblDelimiter, 1.5f, 9, 1.5f, 2.5f);
            Utils.ResizeObject(ref R, txtDelimiter, 3, 9, 2, 2.5f);

            Utils.ResizeObject(ref R, lblBaseYear, 1.5f, 12, 1.5f, 2.5f);
            Utils.ResizeObject(ref R, txtBaseYear, 3, 12, 2, 2.5f);

            Utils.ResizeObject(ref R, lblRuleNumber, 1.5f, 15, 1.5f, 2.5f);
            Utils.ResizeObject(ref R, txtRuleNumber, 3, 15, 2, 2.5f);

            if (vCat >= 0 && resizeNeeded[vCat])
            {
                resizeNeeded[vCat] = false;
                for (int i = 0; i < subLabels[vCat].Length; i++)
                {
                    float r = 6.5f + 2.5f * (int)(i / 12);
                    float c = (i % 12) * 3.5f + 0.25f;
                    Utils.ResizeObject(ref R, subLabels[vCat][i], r, c, 2, 1);
                    Utils.ResizeObject(ref R, subTexts[vCat][i], r, c + 1, 2, 2.25f);
                }
            }
            Utils.ResizeObject(ref R, toGlobal, 1, 18, 2, 5.5f);
            Utils.ResizeObject(ref R, toGlobalAll, 3.5f, 18, 2, 5.5f);

            Utils.ResizeObject(ref R, subGet, 1, 24, 2, 3.5f);
            Utils.ResizeObject(ref R, subSet, 3.5f, 24, 2, 3.5f);

            Utils.ResizeObject(ref R, cmdOpen, 1, 28, 2, 3.5f);
            Utils.ResizeObject(ref R, cmdSaveAs, 3.5f, 28, 2, 3.5f);

            Utils.ResizeObject(ref R, lblGlobalFileName, 1, 32, 2, 2.5f);
            Utils.ResizeObject(ref R, lblMsgFileName, 3.5f, 32, 2, 2.5f);

            Utils.ResizeObject(ref R, txtGlobalFileName, 1, 35, 2, 7.5f);
            Utils.ResizeObject(ref R, txtMsgFileName, 3.5f, 35, 2, 7.5f);
        }
Exemplo n.º 9
0
 static public void ResizeObject(ref ResizeInfo R, Label l, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1)
 {
     l.Location = getLocation(R, l, sngRow, sngCol);
     l.Size     = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
     l.Font     = ChangeFontSize(l.Font, R.FS * adjustFont);
 }
Exemplo n.º 10
0
 static public void ResizeObject(ref ResizeInfo R, TabControl t, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1)
 {
     t.Location = getLocation(R, t, sngRow, sngCol);
     t.Size     = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
     t.Font     = ChangeFontSize(t.Font, R.FS * adjustFont);
 }
Exemplo n.º 11
0
 static public void ResizeObject(ref ResizeInfo R, TreeView tv, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1)
 {
     tv.Location = getLocation(R, tv, sngRow, sngCol);
     tv.Size     = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
 }
Exemplo n.º 12
0
 static public void ResizeObject(ref ResizeInfo R, DataGridView dg, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1)
 {
     dg.Location = getLocation(R, dg, sngRow, sngCol);
     dg.Size     = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
     dg.Font     = ChangeFontSize(dg.Font, R.FS * adjustFont);
 }
Exemplo n.º 13
0
 static public void ResizeObject(ref ResizeInfo R, HScrollBar h, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1)
 {
     h.Location = getLocation(R, h, sngRow, sngCol);
     h.Size     = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
 }
Exemplo n.º 14
0
 static public void ResizeObject(ref ResizeInfo R, PictureBox p, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1)
 {
     p.Location = getLocation(R, p, sngRow, sngCol);
     p.Size     = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H));
 }
Exemplo n.º 15
0
        private void UI161_Resize(object sender, EventArgs e)
        {
            //
            // Avoid resize before Program Load has run or on screen minimize
            if (initComplete && ClientRectangle.Height > 0)
            {
                //
                this.SuspendLayout();
                // Build local parameters
                R = Utils.InitializeResize(this, 49, 47, true);

                Utils.ResizeObject(ref R, lblMessageFolder, 1, 1, 2, 6);
                Utils.ResizeObject(ref R, txtMessageFolder, 1, 7, 2, 33);
                Utils.ResizeObject(ref R, cmdBrowse, 1, 41, 2.5f, 5);

                Utils.ResizeObject(ref R, lblIPAddress, 4, 1, 2, 5);
                Utils.ResizeObject(ref R, txtIPAddress, 4, 6, 2, 5);
                Utils.ResizeObject(ref R, lblIPPort, 7, 1, 2, 5);
                Utils.ResizeObject(ref R, txtIPPort, 7, 6, 2, 5);

                Utils.ResizeObject(ref R, cmdConnect, 4, 12, 2.5f, 6);
                Utils.ResizeObject(ref R, cmdDisconnect, 7, 12, 2.5f, 6);
                Utils.ResizeObject(ref R, cmdComOn, 4, 19, 2.5f, 6);
                Utils.ResizeObject(ref R, cmdComOff, 7, 19, 2.5f, 6);
                Utils.ResizeObject(ref R, cmdReady, 4, 26, 2.5f, 6);
                Utils.ResizeObject(ref R, cmdStandby, 7, 26, 2.5f, 6);
                Utils.ResizeObject(ref R, cmdStartUp, 4, 33, 2.5f, 6);
                Utils.ResizeObject(ref R, cmdShutDown, 7, 33, 2.5f, 6);
                Utils.ResizeObject(ref R, cmdGetStatus, 4, 40, 2.5f, 6);
                Utils.ResizeObject(ref R, cmdReset, 7, 40, 2.5f, 6);

                Utils.ResizeObject(ref R, chkLogIO, 9, 1, 2, 5);
                Utils.ResizeObject(ref R, chkTwinNozzle, 9, 6, 2, 6);
                Utils.ResizeObject(ref R, chkLogAsXML, 11, 1, 2, 5);
                Utils.ResizeObject(ref R, chkStopOnAllErrors, 11, 6, 2, 7);
                Utils.ResizeObject(ref R, lblPrinterStatus, 10, 14, 2, 6);
                Utils.ResizeObject(ref R, txtPrinterStatus, 10, 20, 2, 26);
                Utils.ResizeObject(ref R, lblAnalysis, 12, 14, 2, 6);
                Utils.ResizeObject(ref R, txtAnalysis, 12, 20, 2, 26);

                Utils.ResizeObject(ref R, tclViews, 14, 1, 23, 45);
                {
                    Utils.ResizeObject(ref R, dgMessages, 1, 1, 16, 43);
                    {
                        Utils.ResizeObject(ref R, lblMessageName, 17.5f, 1, 2, 5);
                        Utils.ResizeObject(ref R, txtMessageName, 17.5f, 6, 2, 10);
                        Utils.ResizeObject(ref R, lblMessageNumber, 19.5f, 1, 2, 5);
                        Utils.ResizeObject(ref R, cbMessageNumber, 19.5f, 6, 2, 5);

                        Utils.ResizeObject(ref R, cmdMessageAdd, 18, 21, 2.5f, 5);
                        Utils.ResizeObject(ref R, cmdMessageDelete, 18, 27, 2.5f, 5);
                        Utils.ResizeObject(ref R, cmdMessageRefresh, 18, 33, 2.5f, 5);
                        Utils.ResizeObject(ref R, cmdMessageLoad, 18, 39, 2.5f, 5);
                    }
                    Utils.ResizeObject(ref R, dgGroups, 1, 1, 17, 43);
                    {
                        Utils.ResizeObject(ref R, cmdGroupRefresh, 18, 38, 2.5f, 6);
                    }
                    Utils.ResizeObject(ref R, tvXML, 1, 1, 19, 43);
                    Utils.ResizeObject(ref R, txtIndentedView, 1, 1, 19, 43);
                    Utils.ResizeObject(ref R, lbErrors, 1, 1, 17, 43);
                    {
                        Utils.ResizeObject(ref R, cmdErrorRefresh, 18, 31, 2.5f, 6);
                        Utils.ResizeObject(ref R, cmdErrorClear, 18, 38, 2.5f, 6);
                    }
                    Utils.ResizeObject(ref R, lstMessages, 1, 1, 19, 41);
                    // Logo Tab
                    up.ResizeControls(ref R, 0, 20, 44);
                    // Log as XML
                    Utils.ResizeObject(ref R, tvLogAsXML, 1, 1, 19, 43);

                    Utils.ResizeObject(ref R, grpMain, 0, 0, 21, 45);
                    doSubs?.ResizeControls(ref R, 2, 1);
                }

                Utils.ResizeObject(ref R, lblClass, 38, 1, 2, 4);
                Utils.ResizeObject(ref R, cbClass, 38, 5, 2, 7);
                Utils.ResizeObject(ref R, lblAttribute, 40, 1, 2, 4);
                Utils.ResizeObject(ref R, cbAttribute, 40, 5, 2, 7);
                Utils.ResizeObject(ref R, lblInstance, 42, 1, 2, 4);
                Utils.ResizeObject(ref R, cbInstance, 42, 5, 2, 7);

                Utils.ResizeObject(ref R, lblDataAddress, 38, 13, 2, 5);
                Utils.ResizeObject(ref R, txtDataAddress, 38, 18, 2, 6);
                Utils.ResizeObject(ref R, lblNozzle, 40, 13, 2, 5);
                Utils.ResizeObject(ref R, cbNozzle, 40, 18, 2, 6);
                Utils.ResizeObject(ref R, lblDataLength, 42, 13, 2, 5);
                Utils.ResizeObject(ref R, txtDataLength, 42, 18, 2, 6);
                Utils.ResizeObject(ref R, lblData, 44, 13, 2, 5);
                Utils.ResizeObject(ref R, txtData, 44, 18, 2, 12);

                Utils.ResizeObject(ref R, optHoldingRegister, 38, 25, 2, 6);
                Utils.ResizeObject(ref R, optInputRegister, 40, 25, 2, 6);
                Utils.ResizeObject(ref R, chkHex, 42, 25, 2, 6);

                Utils.ResizeObject(ref R, cmdReadData, 38, 31, 2.5f, 6);
                Utils.ResizeObject(ref R, cmdWriteData, 42, 31, 2.5f, 6);

                Utils.ResizeObject(ref R, lblAcks, 38, 37, 2, 3);
                Utils.ResizeObject(ref R, txtAcks, 38, 41, 2, 4);
                Utils.ResizeObject(ref R, lblNaks, 40, 37, 2, 3);
                Utils.ResizeObject(ref R, txtNaks, 40, 41, 2, 4);

                Utils.ResizeObject(ref R, cmdRetrieve, 46, 1, 2.5f, 5);
                Utils.ResizeObject(ref R, cmdSaveAs, 46, 7, 2.5f, 5);
                Utils.ResizeObject(ref R, cmdOpen, 46, 13, 2.5f, 4);
                Utils.ResizeObject(ref R, cmdSend, 46, 18, 2.5f, 4);
                Utils.ResizeObject(ref R, cmdReformat, 46, 23, 2.5f, 5);
                Utils.ResizeObject(ref R, cmdExperiment, 46, 29, 2.5f, 5);
                Utils.ResizeObject(ref R, cmdResetIOs, 46, 35, 2.5f, 5);
                Utils.ResizeObject(ref R, cmdExit, 46, 41, 2.5f, 5);

                //this.Refresh();
                this.ResumeLayout();
            }
        }