|
@@ -15,9 +15,10 @@ namespace UICatalog {
|
|
|
[ScenarioCategory ("Text")]
|
|
|
[ScenarioCategory ("Controls")]
|
|
|
class CharacterMap : Scenario {
|
|
|
+ CharMap _charMap;
|
|
|
public override void Setup ()
|
|
|
{
|
|
|
- var charMap = new CharMap () {
|
|
|
+ _charMap = new CharMap () {
|
|
|
X = 0,
|
|
|
Y = 0,
|
|
|
Width = CharMap.RowWidth + 2,
|
|
@@ -26,8 +27,8 @@ namespace UICatalog {
|
|
|
ColorScheme = Colors.Dialog
|
|
|
};
|
|
|
|
|
|
- Win.Add (charMap);
|
|
|
- var label = new Label ("Jump To Unicode Block:") { X = Pos.Right (charMap) + 1, Y = Pos.Y (charMap) };
|
|
|
+ Win.Add (_charMap);
|
|
|
+ var label = new Label ("Jump To Unicode Block:") { X = Pos.Right (_charMap) + 1, Y = Pos.Y (_charMap) };
|
|
|
Win.Add (label);
|
|
|
|
|
|
(ustring radioLabel, int start, int end) CreateRadio (ustring title, int start, int end)
|
|
@@ -57,11 +58,17 @@ namespace UICatalog {
|
|
|
jumpList.Y = Pos.Bottom (label);
|
|
|
jumpList.Width = Dim.Fill ();
|
|
|
jumpList.SelectedItemChanged = (args) => {
|
|
|
- charMap.Start = radioItems[args.SelectedItem].start;
|
|
|
+ _charMap.Start = radioItems[args.SelectedItem].start;
|
|
|
};
|
|
|
|
|
|
Win.Add (jumpList);
|
|
|
}
|
|
|
+
|
|
|
+ public override void Run ()
|
|
|
+ {
|
|
|
+ base.Run ();
|
|
|
+ _charMap.Dispose ();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class CharMap : ScrollView {
|
|
@@ -101,7 +108,6 @@ namespace UICatalog {
|
|
|
|
|
|
DrawContent += CharMap_DrawContent;
|
|
|
}
|
|
|
-
|
|
|
#if true
|
|
|
private void CharMap_DrawContent (Rect viewport)
|
|
|
{
|
|
@@ -122,6 +128,11 @@ namespace UICatalog {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ protected override void Dispose (bool disposing)
|
|
|
+ {
|
|
|
+ base.Dispose (disposing);
|
|
|
+ }
|
|
|
#else
|
|
|
public override void OnDrawContent (Rect viewport)
|
|
|
{
|