private void refresh()
{
foreach(Control c in createdControls) {
this.Controls.Remove(c);
c.Dispose();
}
int base_y = this.listTitle.Location.Y + this.listTitle.Height + 10;
int newWidth = 352;
PageInfo pageInfo = new PageInfo(false, false);
int y;
if (displayType == DisplayType.Details) {
y = UIManager.DisplayCreatureAttributeList(this.Controls, objects, 10, base_y, out newWidth, null, createdControls, currentPage, 20, pageInfo, null, null, sortHeader, sortedHeader, desc, null, null, addConditionalAttributes);
} else {
y = UIManager.DisplayCreatureList(this.Controls, objects, 10, base_y, 344, 4, null, 1, createdControls, currentPage, 600, pageInfo, currentDisplay);
if (currentDisplay >= 0) {
currentDisplay = -1;
currentPage = pageInfo.currentPage;
}
}
startDisplay = pageInfo.startDisplay;
updateCommand();
newWidth = Math.Max(newWidth, 275);
if (pageInfo.prevPage) {
PictureBox prevpage = new PictureBox();
prevpage.Location = new Point(10, base_y + y);
prevpage.Size = new Size(97, 23);
prevpage.Image = StyleManager.GetImage("prevpage.png");
prevpage.BackColor = Color.Transparent;
prevpage.SizeMode = PictureBoxSizeMode.StretchImage;
prevpage.Click += Prevpage_Click;
this.Controls.Add(prevpage);
createdControls.Add(prevpage);
}
if (pageInfo.nextPage) {
PictureBox nextpage = new PictureBox();
nextpage.Location = new Point(10 + newWidth - 108, base_y + y);
nextpage.Size = new Size(98, 23);
nextpage.BackColor = Color.Transparent;
nextpage.Image = StyleManager.GetImage("nextpage.png");
nextpage.SizeMode = PictureBoxSizeMode.StretchImage;
nextpage.Click += Nextpage_Click;
this.Controls.Add(nextpage);
createdControls.Add(nextpage);
}
toggleButton.Location = new Point(newWidth - toggleButton.Size.Width, toggleButton.Location.Y);
if (pageInfo.prevPage || pageInfo.nextPage) {
y += 23;
}
this.Size = new Size(10 + newWidth, base_y + y + 10);
this.refreshTimer();
}