ID:160083
Nov 20 2008, 3:03 pm
|
|
My latest project involves creating/deleting a number of panes. I know how to create the panes, but how do I delete them when I am done with them?
|
Nov 20 2008, 4:06 pm
|
|
You can't, as far as I know.
|
Skins are all handled client-side, anyway. This shouldn't cause too much of a problem, unless you make, say, a couple hundred panes/windows.
|
According to the skin reference:
Controls in a window or pane can be added or deleted at runtime. (Only controls you add at runtime can be deleted.) To create a control, you need to supply a parent parameter with the ID of the window or pane that will hold the control, and type which is one of the available control types. Controls that were added this way can also be deleted again by setting their parent to a blank value. |
In response to Jeff8500
|
|
At the moment I have 67 skills, which will probably be about 2/3rds of the total number. The skills are to be displayed in a tree view with a button to show/hide the subskills of that skill, so it is possible that I would need 67 panes, 67 Child controls, each with a button and 2 labels, so we're talking 268 controls in total here.
|
In response to Hazman
|
|
Ick. Use grids.
|
In response to Xooxer
|
|
The problem with grids is that I can't specify the exact size that I want for each cell, so intenting the subskills of a skill becomes difficult. In the skill grid system I used for TitanNet I had to set the grid as about 10 cells wide to get the indentation I wanted, and that would mean 670 grid elements.
It's looking like I'll just allow the player to only open one skill at each level, and reuse panes/child controls. That way, the max number of controls I'll need will be much lower. But a way to delete windows would still be helpful, I'm sure there are uses for such a feature. |
In response to Hazman
|
|
Ah, right. I remember that from doing the help tree in Chatters. I ended up using an output element instead. I loaded the topics from an XML file, and the contents in an adjacent output panel. With the output, I could use a line of text for the topic title, as well as small book icon to show if the topic is open.
|
In response to Mega fart cannon
|
|
Oh, yeah, I remember reading that now...
|