本文整理汇总了C#中Server.Gumps.Gump.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Gump.Add方法的具体用法?C# Gump.Add怎么用?C# Gump.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Gumps.Gump
的用法示例。
在下文中一共展示了Gump.Add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToGump
public void AddToGump(Gump gump)
{
foreach (IGumpComponent g in _Entries)
{
gump.Add(g);
}
}
示例2: AppendTo
/// <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"];
//.........这里部分代码省略.........