예제 #1
0
        public ListDialogItem(EODialogBase parent, ListItemStyle style, int listIndex = -1)
        {
            DrawLocation = new Vector2(17, DrawLocation.Y); //the base X coordinate is 17 - this can be adjusted with OffsetX property

            Style = style;
            if (listIndex >= 0)
            {
                Index = listIndex;
            }

            _setSize(232, Style == ListItemStyle.Large ? 36 : 13);

            int colorFactor = Style == ListItemStyle.Large ? 0xc8 : 0xb4;

            m_primaryText = new XNALabel(new Rectangle(Style == ListItemStyle.Large ? 56 : 2, Style == ListItemStyle.Large ? 5 : 0, 1, 1), Constants.FontSize08pt5)
            {
                AutoSize  = false,
                BackColor = Color.Transparent,
                ForeColor = Color.FromNonPremultiplied(colorFactor, colorFactor, colorFactor, 0xff),
                TextAlign = LabelAlignment.TopLeft,
                Text      = " "
            };
            m_primaryText.ResizeBasedOnText();

            if (Style == ListItemStyle.Large)
            {
                m_secondaryText = new XNALabel(new Rectangle(56, 20, 1, 1), Constants.FontSize08pt5)
                {
                    AutoSize  = true,
                    BackColor = m_primaryText.BackColor,
                    ForeColor = m_primaryText.ForeColor,
                    Text      = " "
                };
                m_secondaryText.ResizeBasedOnText();

                m_gfxPadThing      = ((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.MapTiles, 0, true);
                ShowItemBackGround = true;
            }
            m_backgroundColor = new Texture2D(Game.GraphicsDevice, 1, 1);
            m_backgroundColor.SetData(new[] { Color.FromNonPremultiplied(0xff, 0xff, 0xff, 64) });

            SetParent(parent);
            m_primaryText.SetParent(this);
            if (Style == ListItemStyle.Large)
            {
                m_secondaryText.SetParent(this);
            }
            OffsetY = Style == ListItemStyle.Large ? 25 : 45;
        }
        /// <summary>
        /// Wrapper for getOwnerDocument().getComputedStyle().getListStyle().getListItemType()
        /// See:
        /// </summary>
        /// <param name="kmlFeature">The feature to find the list item type of</param>
        /// <returns>The corresponding ListItem type <see cref="ListItemStyle"/></returns>
        /// <remarks>This method is used by <see cref="KmlTreeView"/> to build the nodes</remarks>
        /// <example>Example: KmlHelpers.GetListItemType(kmlFeature)</example>
        public static ListItemStyle GetListItemType(dynamic kmlFeature)
        {
            ListItemStyle listItem = ListItemStyle.Check;

            try
            {
                listItem = (ListItemStyle)kmlFeature.getComputedStyle().getListStyle().getListItemType();
            }
            catch (COMException cex)
            {
                Debug.WriteLine("GetListItemType: " + cex.Message, "KmlHelpers");
            }
            catch (RuntimeBinderException rbex)
            {
                Debug.WriteLine("GetListItemType: " + rbex.Message, "KmlHelpers");
            }

            return(listItem);
        }
예제 #3
0
		public ListDialogItem(EODialogBase parent, ListItemStyle style, int listIndex = -1)
		{
			DrawLocation = new Vector2(17, DrawLocation.Y); //the base X coordinate is 17 - this can be adjusted with OffsetX property

			Style = style;
			if (listIndex >= 0)
				Index = listIndex;

			_setSize(232, Style == ListItemStyle.Large ? 36 : 13);

			int colorFactor = Style == ListItemStyle.Large ? 0xc8 : 0xb4;

			m_primaryText = new XNALabel(new Rectangle(Style == ListItemStyle.Large ? 56 : 2, Style == ListItemStyle.Large ? 5 : 0, 1, 1), Constants.FontSize08pt5)
			{
				AutoSize = false,
				BackColor = Color.Transparent,
				ForeColor = Color.FromNonPremultiplied(colorFactor, colorFactor, colorFactor, 0xff),
				TextAlign = LabelAlignment.TopLeft,
				Text = " "
			};
			m_primaryText.ResizeBasedOnText();

			if (Style == ListItemStyle.Large)
			{
				m_secondaryText = new XNALabel(new Rectangle(56, 20, 1, 1), Constants.FontSize08pt5)
				{
					AutoSize = true,
					BackColor = m_primaryText.BackColor,
					ForeColor = m_primaryText.ForeColor,
					Text = " "
				};
				m_secondaryText.ResizeBasedOnText();

				m_gfxPadThing = ((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.MapTiles, 0, true);
				ShowItemBackGround = true;
			}
			m_backgroundColor = new Texture2D(Game.GraphicsDevice, 1, 1);
			m_backgroundColor.SetData(new[] { Color.FromNonPremultiplied(0xff, 0xff, 0xff, 64) });

			SetParent(parent);
			m_primaryText.SetParent(this);
			if (Style == ListItemStyle.Large)
			{
				m_secondaryText.SetParent(this);
			}
			OffsetY = Style == ListItemStyle.Large ? 25 : 45;
		}