コード例 #1
0
        public void AddNewPage()
        {
            FinishPage();

            m_CurrentX = BorderSize + OffsetSize;
            m_CurrentY = BorderSize + OffsetSize;

            AddPage(++m_CurrentPage);

            m_Background = new GumpBackground(0, 0, 100, 100, BackGumpID);
            Add(m_Background);

            m_Offset = new GumpImageTiled(BorderSize, BorderSize, 100, 100, OffsetGumpID);
            Add(m_Offset);
        }
コード例 #2
0
        public void AddNewPage()
        {
            this.FinishPage();

            this.m_CurrentX = this.BorderSize + this.OffsetSize;
            this.m_CurrentY = this.BorderSize + this.OffsetSize;

            this.AddPage(++m_CurrentPage);

            this.m_Background = new GumpBackground(0, 0, 100, 100, this.BackGumpID);
            this.Add(m_Background);

            this.m_Offset = new GumpImageTiled(this.BorderSize, this.BorderSize, 100, 100, this.OffsetGumpID);
            this.Add(m_Offset);
        }
コード例 #3
0
ファイル: BaseGridGump.cs プロジェクト: Crome696/ServUO
        public void AddNewPage()
        {
            this.FinishPage();

            this.m_CurrentX = this.BorderSize + this.OffsetSize;
            this.m_CurrentY = this.BorderSize + this.OffsetSize;

            this.AddPage(++this.m_CurrentPage);

            this.m_Background = new GumpBackground(0, 0, 100, 100, this.BackGumpID);
            this.Add(this.m_Background);

            this.m_Offset = new GumpImageTiled(this.BorderSize, this.BorderSize, 100, 100, this.OffsetGumpID);
            this.Add(this.m_Offset);
        }
コード例 #4
0
ファイル: GmlWriter.cs プロジェクト: greeduomacro/RuneUO
		public virtual void Write(string name, GumpImageTiled e)
		{
			CreateElement(e);
			SetAttribute("name", name);
			SetAttribute("x", e.X);
			SetAttribute("y", e.Y);
			SetAttribute("width", e.Width);
			SetAttribute("height", e.Height);
			SetAttribute("gumpid", e.GumpID);
			Append();
		}
コード例 #5
0
ファイル: BaseGridGump.cs プロジェクト: Godkong/RunUO
		public void AddNewPage()
		{
			FinishPage();

			m_CurrentX = BorderSize + OffsetSize;
			m_CurrentY = BorderSize + OffsetSize;

			AddPage( ++m_CurrentPage );

			m_Background = new GumpBackground( 0, 0, 100, 100, BackGumpID );
			Add( m_Background );

			m_Offset = new GumpImageTiled( BorderSize, BorderSize, 100, 100, OffsetGumpID );
			Add( m_Offset );
		}
コード例 #6
0
        /// <summary>
        /// The main method for putting the entry on the page. This method is accessed from the GumpList class when CommitList() is called.
        /// </summary>
        /// <param name="page">The gump to which the entry should be appended.</param>
        public void AppendTo(Gump page)
        {
            m_ColCount = columnValues.Count < m_ParentList.columns? columnValues.Count: m_ParentList.columns;
            if (m_ColCount == 0)
            {
                return;
            }
            if (m_Background)
            {
                GumpImageTiled b = new GumpImageTiled(m_X, m_Y, m_Width, m_Height, m_BackgroundID);
                page.Add(b);
            }
            if (m_Style == "details")
            {
                m_ParentList.DebugWrite("Details mode.");
                int i = 0;
                //int columnval = -1;

                int colWidth = Width / m_ColCount;
                int xbase    = m_X;
                while (i < columnValues.Count && i < m_ParentList.columns)
                {
                    colWidth = getWidthOfColumn(i);
                    xbase    = m_X + getCurrentXLocation(i + 1);
                    m_ParentList.DebugWrite("Appending Columns.");
                    try
                    {
                        object o = columnValues[i];
                        if (o is GumpButton)
                        {
                            GumpButton btn = (GumpButton)o;
                            btn.X = xbase + skin.ListColumnIndent;
                            btn.Y = m_Y;
                            page.Add(btn);
                        }
                        else if (o is GumpCheck)
                        {
                            GumpCheck c = (GumpCheck)o;
                            c.X = xbase + skin.ListColumnIndent;
                            c.Y = m_Y;
                            page.Add(c);
                        }
                        else if (o is GumpTextEntry)
                        {
                            GumpTextEntry t = (GumpTextEntry)o;
                            t.X      = xbase + skin.ListColumnIndent;
                            t.Y      = m_Y;
                            t.Width  = colWidth;
                            t.Height = m_Height;
                            page.Add(t);
                        }
                        else if (o is string)
                        {
                            string s = (string)o;
                            m_ParentList.DebugWrite("stringy! " + s);
                            if (s.Contains("</"))
                            {
                                GumpHtml h = new GumpHtml(xbase + skin.ListColumnIndent, m_Y, colWidth, m_Height, s, false, false);
                                h.Parent = page;
                                page.Add(h);
                            }
                            else
                            {
                                m_ParentList.DebugWrite("text");
                                GumpLabel g = new GumpLabel(xbase + skin.ListColumnIndent, m_Y, skin.NormalText, s);
                                g.Parent = page;
                                page.Add(g);
                            }
                        }
                        i++;
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Problem in AppendTo - " + e);
                        i = columnValues.Count;
                    }
                    if (m_Dividers)
                    {
                        GumpImageTiled t = new GumpImageTiled(xbase + colWidth, m_Y, skin.EntryDividerWidth, skin.EntryDividerHeight, skin.EntryDividerID);
                        page.Add(t);
                    }
                }
                m_ParentList.DebugWrite("Done, details.");
            }
            else if (m_Style == "icons")
            {
                m_ParentList.DebugWrite("Icons mode.");
                Hashtable table = (Hashtable)columnValues[0];
                string    s     = (string)table["caption"];
                if (m_Background)
                {
                    GumpImageTiled t = new GumpImageTiled(m_X, m_Y, m_Width, m_Height, m_BackgroundID);
                    page.Add(t);
                }
                GumpButton button;
                if (arguments.ContainsKey("button"))
                {
                    button = (GumpButton)arguments["button"];
                    page.Add(button);
                }
                else
                {
                    return;
                }

                int       icon = arguments["icon"] != null ? (int)arguments["icon"] : skin.EntryDefaultIcon;
                GumpImage im   = new GumpImage((skin.EntryCaptionWidth - m_X) - skin.EntryIconWidth / 2, m_Y + skin.EntryIconY, icon);
                page.Add(im);
                if (s.Contains("</"))
                {
                    GumpHtml h = new GumpHtml(m_X, m_Y, m_Width, m_Height, s, false, false);
                    h.Parent = page;
                    page.Add(h);
                }
                else
                {
                    GumpLabel g = new GumpLabel(m_X, m_Y + skin.EntryCaptionPositionY, skin.NormalText, s);
                    g.Parent = page;
                    page.Add(g);
                }
            }
            else
            {
                Console.WriteLine("Unknown style: " + m_Style);
            }
        }
コード例 #7
0
		/// <summary>
		/// The main method for putting the entry on the page. This method is accessed from the GumpList class when CommitList() is called.
		/// </summary>
		/// <param name="page">The gump to which the entry should be appended.</param>
		public void AppendTo(Gump page)
		{	
			m_ColCount = columnValues.Count < m_ParentList.columns? columnValues.Count: m_ParentList.columns;
			if( m_ColCount == 0 )
				return;
			if (m_Background)
			{
				GumpImageTiled b = new GumpImageTiled( m_X, m_Y, m_Width, m_Height, m_BackgroundID );
				page.Add(b);
			}			
			if (m_Style == "details")
			{
				m_ParentList.DebugWrite("Details mode.");
				int i = 0;
				//int columnval = -1;
				
				int colWidth = Width / m_ColCount;
				int xbase = m_X;
				while (i < columnValues.Count && i < m_ParentList.columns)
				{				
					colWidth = getWidthOfColumn(i);
					xbase = m_X + getCurrentXLocation(i+1);
					m_ParentList.DebugWrite("Appending Columns.");
					try
					{
						object o = columnValues[i];
						if (o is GumpButton)
						{
							GumpButton btn = (GumpButton)o;
							btn.X = xbase+skin.ListColumnIndent;
							btn.Y = m_Y;
							page.Add(btn);
						}
						else if (o is GumpCheck)
						{
							GumpCheck c = (GumpCheck)o;
							c.X = xbase + skin.ListColumnIndent;
							c.Y = m_Y;
							page.Add(c);
						}
						else if (o is GumpTextEntry)
						{
							GumpTextEntry t = (GumpTextEntry)o;
							t.X = xbase + skin.ListColumnIndent;
							t.Y = m_Y;
							t.Width = colWidth;
							t.Height = m_Height;
							page.Add(t);
						}
						else if (o is string)
						{
							string s = (string)o;
							m_ParentList.DebugWrite("stringy! " + s);
							if (s.Contains("</"))
							{
								GumpHtml h = new GumpHtml(xbase + skin.ListColumnIndent, m_Y, colWidth, m_Height, s, false, false);
								h.Parent = page;
								page.Add(h);
						}
							else
							{
								m_ParentList.DebugWrite("text");
								GumpLabel g = new GumpLabel(xbase + skin.ListColumnIndent, m_Y, skin.NormalText, s);
								g.Parent = page;
								page.Add(g);
							}
						}
						i++;
					}
					catch (Exception e)
					{
						Console.WriteLine("Problem in AppendTo - " + e);
						i = columnValues.Count;
					}
					if (m_Dividers)
					{
						GumpImageTiled t = new GumpImageTiled(xbase + colWidth, m_Y, skin.EntryDividerWidth, skin.EntryDividerHeight, skin.EntryDividerID);
						page.Add(t);
					}
				}
				m_ParentList.DebugWrite("Done, details.");
			}
			else if (m_Style == "icons")
			{
				m_ParentList.DebugWrite("Icons mode.");
				Hashtable table = (Hashtable)columnValues[0];
				string s = (string)table["caption"];
				if (m_Background)
				{
					GumpImageTiled t = new GumpImageTiled( m_X, m_Y, m_Width, m_Height, m_BackgroundID );
					page.Add(t);
				}
				GumpButton button;
				if ( arguments.ContainsKey("button") )
				{
					button = (GumpButton)arguments["button"];
					page.Add(button);
				}
				else
				{ 
					return; 
				}
				
				int icon = arguments["icon"] != null ? (int)arguments["icon"] : skin.EntryDefaultIcon;
				GumpImage im = new GumpImage( (skin.EntryCaptionWidth-m_X)-skin.EntryIconWidth/2, m_Y+skin.EntryIconY, icon );
				page.Add(im);
				if (s.Contains("</"))
				{
					GumpHtml h = new GumpHtml(m_X, m_Y, m_Width, m_Height, s, false, false);
					h.Parent = page;
					page.Add(h);
				}
				else
				{
					GumpLabel g = new GumpLabel(m_X, m_Y+skin.EntryCaptionPositionY, skin.NormalText, s);
					g.Parent = page;
					page.Add(g);
				}
			}
			else
				Console.WriteLine("Unknown style: "+m_Style);
			 
		}