Example #1
0
        /// <summary>
        /// Constructeur
        /// </summary>
        /// <param name="leJeu">jeu</param>
        /// <param name="position">position de l'overlay</param>
        /// <param name="height"> hauteur</param>
        /// <param name="width">largeur</param>
        /// <param name="xsouris">x souris (nécessaire si position = souris)</param>
        /// <param name="ysouris">y souris (nécessaire si position = souris)</param>
        public Overlay(Jeu leJeu, Position position, int width, int height, int?xsouris, int?ysouris)
        {
            _position = position;
            _jeu      = leJeu;
            _width    = width;
            _height   = height;
            // Calcule la position
            switch (position)
            {
            case Position.BAS_DROITE:
                _xoverlay = _jeu.resX - _width - MARGE;
                _yoverlay = _jeu.resY - _height - MARGE;
                break;

            case Position.BAS_GAUCHE:
                _xoverlay = MARGE;
                _yoverlay = _jeu.resY - _height - MARGE;
                break;

            case Position.HAUT_DROITE:
                _xoverlay = _jeu.resX - _width - MARGE;
                _yoverlay = MARGE;
                break;

            case Position.HAUT_GAUCHE:
                _xoverlay = MARGE;
                _yoverlay = _jeu.resY - _height - MARGE;
                break;

            case Position.CENTRE:
                _xoverlay = (_jeu.resX - _width) / 2;
                _yoverlay = (_jeu.resY - _height) / 2;
                break;

            case Position.SOURIS:
                _xoverlay = (int)xsouris;
                _yoverlay = (int)ysouris;
                // Décale si sort de l'écran
                if (_xoverlay + _width > _jeu.resX)
                {
                    _xoverlay = _jeu.resX - _width;
                }
                if (_yoverlay + _height > _jeu.resY)
                {
                    _yoverlay = _jeu.resY - _height;
                }

                break;
            }
            // Couleur du fond
            _colorFond    = Color.FromNonPremultiplied(128, 128, 128, 200);
            _drawCallBack = null;
            _modalOverlay = ModalOverlay.AUCUN;
            _controles    = new List <Controle>();
            _focusedCtrl  = null;
        }
Example #2
0
		internal override void restoreProperties(ItemProperties props)
		{
			TableProperties tprops = (TableProperties)props;

			caption = tprops.caption;
			captionColor = tprops.captionColor;
			captionFormat = tprops.captionFormat;
			captionHeight = tprops.captionHeight;
			cellBorders = tprops.cellBorders;
			columnWidth = tprops.columnWidth;
			currScrollRow = tprops.currScrollRow;
			linkStyle = tprops.linkStyle;
			picture = tprops.picture;
			picturePos = tprops.picturePos;
			rowHeight = tprops.rowHeight;
			scrollable = tprops.scrollable;
			selStyle = tprops.selStyle;
			style = tprops.style;
			textColor = tprops.textColor;
			EnableStyledText = tprops.enableStyledText;
			customDraw = tprops.customDraw;
			cellCustomDraw = tprops.cellCustomDraw;

			if (captionBackBrush != tprops.captionBackBrush)
			{
				if (captionBackBrush != null)
					captionBackBrush.Release();
				captionBackBrush = tprops.captionBackBrush;
				if (captionBackBrush != null)
					captionBackBrush.AddRef();
			}

			base.restoreProperties(props);
		}
Example #3
0
		internal override void restoreProperties(ItemProperties props)
		{
			BoxProperties bprops = (BoxProperties)props;

			customDraw = bprops.customDraw;
			image = bprops.image;
			picturePos = bprops.picturePos;
			selStyle = bprops.selStyle;
			text = bprops.text;
			textColor = bprops.textColor;
			textFormat = bprops.textFormat;
			transparent = bprops.transparent;

			Style = bprops.style;
			ShapeOrientation = bprops.shapeRotation;
			Shape = bprops.shapeTemplate;
			PolyTextLayout = bprops.usePolyTextLt;
			EnableStyledText = bprops.useStyledText;

			base.restoreProperties(props);
		}