コード例 #1
0
        public void proportionalValuechanged(Proportional source)
        {
            Object parent = source.directParent;

            if (parent is YFontParams)
            {
                object userData = ((YFontParams)parent).userData;
                if (userData != null)
                {
                    double newvalue = (Math.Round(source.value * 1000)) / 1000;
                    if (((FontDescription)userData).size != newvalue)
                    {
                        ((FontDescription)userData).size = newvalue;
                        mainForm.refreshPropertiesForm();
                    }
                }
            }
        }
コード例 #2
0
        public string getConfigData()
        {
            double newCoef = 0;

            if (WindowState == FormWindowState.Maximized)
            { // if the window is maximized, saved size will be regular size, and maximize
              //  flag will be stored separately , so we need to save font
              //  size relative to  regular size (i.e. RestoreBounds.Size);

                int deltaX = Size.Width - _display.usableUiWidth();
                int deltaY = Size.Height - _display.usableUiHeight();
                newCoef = Proportional.resizeCoef(Proportional.ResizeRule.RELATIVETOBOTH, _display.refWidth, _display.refHeight, RestoreBounds.Size.Width - deltaX, RestoreBounds.Size.Height - deltaX);
                _display.resetProportionalSizeObjectsCachePush(newCoef); // reset all size related cached objects
            }
            string dt = manager.getConfigData();

            if (newCoef != 0)
            {
                _display.resetProportionalSizeObjectsCachePop();
            }
            return("<digitalDisplayForm>\n"
                   + dt
                   + "</digitalDisplayForm>\n");
        }