diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-05 07:05:13 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-05 07:05:13 +0200 |
| commit | e9963abca14fbad8ff6c215e5c9d6b45652b38dc (patch) | |
| tree | fa1b55a3bd76257c01849e48f97b3d955012cece /src/GraphicObjects | |
| parent | 47dad629d4ff744071f06a342f5f2eabaa879d71 (diff) | |
* ListBox.cs:
* TemplatedControl.cs: set ItemTemplate as public
* IMLStream.cs: copy ItemTemplates in tree hierarchy
* TreeView.crow: add scrolling
* treeList.crow: simple list template for tree children
* testTreeView.crow: update test
* Tests.csproj: update tests
Diffstat (limited to 'src/GraphicObjects')
| -rw-r--r-- | src/GraphicObjects/ListBox.cs | 14 | ||||
| -rw-r--r-- | src/GraphicObjects/TemplatedControl.cs | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/GraphicObjects/ListBox.cs b/src/GraphicObjects/ListBox.cs index c4f9e0e1..24ceb618 100644 --- a/src/GraphicObjects/ListBox.cs +++ b/src/GraphicObjects/ListBox.cs @@ -112,10 +112,10 @@ namespace Crow } #endregion void loading(){ - if (itemTemplates == null) - itemTemplates = new Dictionary<string, ItemTemplate> (); - if (!itemTemplates.ContainsKey ("default")) - itemTemplates["default"] = new ItemTemplate (ItemTemplate); + if (ItemTemplates == null) + ItemTemplates = new Dictionary<string, ItemTemplate> (); + if (!ItemTemplates.ContainsKey ("default")) + ItemTemplates["default"] = new ItemTemplate (ItemTemplate); for (int i = 1; i <= (data.Count / itemPerPage) + 1; i++) { if (cancelLoading) @@ -163,10 +163,10 @@ namespace Crow ItemTemplate itemStream = null; Type dataType = data [i].GetType (); - if (itemTemplates.ContainsKey (dataType.FullName)) - itemStream = itemTemplates [dataType.FullName]; + if (ItemTemplates.ContainsKey (dataType.FullName)) + itemStream = ItemTemplates [dataType.FullName]; else - itemStream = itemTemplates ["default"]; + itemStream = ItemTemplates ["default"]; lock (Interface.CurrentInterface.LayoutMutex) { g = Interface.Load (itemStream); diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs index b04fe204..744cd329 100644 --- a/src/GraphicObjects/TemplatedControl.cs +++ b/src/GraphicObjects/TemplatedControl.cs @@ -64,7 +64,7 @@ namespace Crow string _template; string _itemTemplate; - protected Dictionary<string, ItemTemplate> itemTemplates; + public Dictionary<string, ItemTemplate> ItemTemplates; [XmlAttributeAttribute][DefaultValue(null)] public string Template { @@ -150,12 +150,12 @@ namespace Crow xr.MoveToElement (); itemTmp = xr.ReadInnerXml (); - if (itemTemplates == null) - itemTemplates = new Dictionary<string, ItemTemplate> (); + if (ItemTemplates == null) + ItemTemplates = new Dictionary<string, ItemTemplate> (); //TODO:check encoding - itemTemplates[dataType] = new ItemTemplate (Encoding.UTF8.GetBytes(itemTmp)); + ItemTemplates[dataType] = new ItemTemplate (Encoding.UTF8.GetBytes(itemTmp)); if (!string.IsNullOrEmpty (datas)) - itemTemplates [dataType].CreateExpandDelegate(dataType, datas); + ItemTemplates [dataType].CreateExpandDelegate(this, dataType, datas); continue; } |