Пример #1
0
        //		void x()
        //		{
        //			Us.MarginLeft;						// x - min 0 - max 20%
        //			Us.MarginTop;						// x - min 0 - max 20%
        //			Us.MarginRight;						// x - min 0 - max 20%
        //			Us.MarginBottom;					// x - min 0 - max 20%
        //
        //			Us.CascadeMinWidthPix;				// *
        //			Us.CascadeMinHeightPix;				// *

        //			Us.CascadeMinWidthPct;				// x - min .25 - max .75
        //			Us.CascadeMinHeightPct;				// x - min .25 - max .75
        //
        //			Us.CascadeColAdjHoriz;				// x - min .5 - max 1.5
        //			Us.CascadeColAdjVert;				// x - min .5 - max 1.5
        //
        //			Us.CascadeBadWidthPct;				// x - min .25 - max .75
        //			Us.CascadeBadHeightPct;				// x - min .25 - max .75
        //
        //			Us.TileSideViewWidthIncreasePct;	// x - min 0.0 - max 5.0
        //			Us.TileSideViewHeightIncreasePct;	// x - min 0.0 - max 5.0
        //
        //			Us.TileSideViewSizeAdjustAmt;		// *
        //
        //			Us.TileMainViewMinWidthPct;			// x - min .25 - max .75
        //			Us.TileMainViewMinHeightPct;		// x - min .25 - max .75
        //
        //		}

        internal bool AdjustNonActWidth(WindowLayoutStyle winLayoutStyle, bool increase)
        {
            // must be one of these layout styles
            // otherwise ignore
            if (winLayoutStyle != WindowLayoutStyle.ACTIVE_LEFT &&
                winLayoutStyle != WindowLayoutStyle.ACTIVE_LEFT_OVERLAP &&
                winLayoutStyle != WindowLayoutStyle.ACTIVE_RIGHT)
            {
                return(true);
            }

            double proposedWidthAdjust;

            if (!increase)
            {
                proposedWidthAdjust = _nonActiveWidthIncreasePct - Us.TileSideViewSizeAdjustAmtPct;
                if (proposedWidthAdjust >= 0)
                {
                    _nonActiveWidthIncreasePct = proposedWidthAdjust;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            proposedWidthAdjust = _nonActiveWidthIncreasePct
                                  + Us.TileSideViewSizeAdjustAmtPct;

            if (CalcTotalSize(proposedWidthAdjust,
                              MinWindowWidth, _selectedMinWidth) > _availableWidth)
            {
                return(false);
            }

            _nonActiveWidthIncreasePct = proposedWidthAdjust;

            return(true);
        }
Пример #2
0
        internal bool AdjustNonActHeight(WindowLayoutStyle winLayoutStyle, bool increase)
        {
            // must be one of these layout styles
            // otherwise ignore
            if (winLayoutStyle != WindowLayoutStyle.ACTIVE_TOP &&
                winLayoutStyle != WindowLayoutStyle.ACTIVE_BOTTOM)
            {
                return(true);
            }

            double proposedHeightIncrease;

            if (!increase)
            {
                proposedHeightIncrease = _nonActiveHeightIncreasePct - Us.TileSideViewSizeAdjustAmtPct;
                if (proposedHeightIncrease >= 0)
                {
                    _nonActiveHeightIncreasePct = proposedHeightIncrease;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            proposedHeightIncrease = _nonActiveHeightIncreasePct
                                     + Us.TileSideViewSizeAdjustAmtPct;

            if (CalcTotalSize(proposedHeightIncrease,
                              MinWindowWidth, _selectedMinWidth) > _availableWidth)
            {
                return(false);
            }

            _nonActiveHeightIncreasePct = proposedHeightIncrease;

            return(true);
        }