/obj/*
/GOLib.userprefs
/Tests/obj/*
+/OTKCrow/obj
/Tests/bin/*
/UnitTest/obj
/UnitTest/bin
</HorizontalStack>
</Border>
</Template>
- <Border Background="DimGray" BorderWidth="1" Margin="1"
- MinimumSize="{../../MinimumPopupSize}" MaximumSize="0;400"
- Height="400" Width="-1">
- <Scroller Name="scroller1" Margin="1" VerticalScrolling="true"
- Height="{../HeightPolicy}" Width="{../WidthPolicy}"
+ <Border Background="DimGray" BorderWidth="1" Margin="1"
+ Fit="true">
+ <Scroller Name="scroller1" Margin="2" VerticalScrolling="true"
+ MinimumSize="{../../../MinimumPopupSize}" MaximumSize="0;400"
+ Fit="true"
+ HorizontalAlignment="Left"
ValueChanged="../../../_scroller_ValueChanged">
<VerticalStack LayoutChanged="../../../../_list_LayoutChanged"
- Height="-1" Width="{../../WidthPolicy}" Name="List" Margin="0" VerticalAlignment="Top"/>
+ Height="-1" Width="{../WidthPolicy}" Name="List" Margin="0"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Top"/>
</Scroller>
</Border>
</Popper>
int frameCpt = 0;
int idx = 0;
string[] testFiles = {
- "0.crow",
"testColorList.crow",
+ "testCombobox.goml",
+ "0.crow",
"testCheckbox.goml",
"testWindow.goml",
"fps.goml",
<Border BorderWidth="2" Fit="true">
<VerticalStack Fit="true" Margin="5">
<ListBox Data="{TestList}" Background="0,5;0,5;0,5;0,7"
- HorizontalAlignment="Center" Width="300" Height="350" Margin="5"
+ HorizontalAlignment="Center" Width="200" Height="200" Margin="5"
ItemTemplate="#Tests.Interfaces.colorItem.crow">
<Template>
<Border BorderWidth="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
ValueChanged="../../../_scroller_ValueChanged">
<VerticalStack Width="{../../../../WidthPolicy}" Height="-1" MinimumSize="10;10"
- Name="List" Margin="0" VerticalAlignment="Top"
+ Name="List" Margin="0"
+ VerticalAlignment="Top"
+ HorizontalAlignment="Left"
LayoutChanged="../../../../_list_LayoutChanged"/>
</Scroller>
<ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
<?xml version="1.0"?>
-<VerticalStack>
- <ComboBox Width="250" Data="{TestList}" SelectedIndex="0"
+<VerticalStack Width="200">
+ <ComboBox Width="0" Data="{TestList}" SelectedIndex="0"
ItemTemplate="#Tests.Interfaces.colorItem.crow"/>
</VerticalStack>
\ No newline at end of file
Target = _source;
Expression = _expression;
}
+ public Binding(object _source, string _member, string _expression)
+ {
+ Target = new MemberReference (_source, _source.GetType().GetMember (_member) [0]);
+ Expression = _expression;
+ }
#endregion
public bool FindTarget(){
public ComboBox() : base(){ }
#endregion
- Size minimumPopupSize = "100;100";
+ Size minimumPopupSize = "10;10";
[XmlIgnore]public Size MinimumPopupSize{
get { return minimumPopupSize; }
set {
set { _parent = value; }
}
- public ILayoutable LogicalParent {
+ [XmlIgnore]public ILayoutable LogicalParent {
get { return logicalParent == null ? Parent : logicalParent; }
set { logicalParent = value; }
}
Slot.Width = Width;
else if (Width < 0) {
Slot.Width = measureRawSize (LayoutingType.Width);
- }else if (Parent.RegisteredLayoutings.HasFlag (LayoutingType.Width))
+ } else if (Parent.RegisteredLayoutings.HasFlag (LayoutingType.Width))
return false;
else
Slot.Width = Parent.ClientRectangle.Width;
//size constrain
- if (Slot.Width < MinimumSize.Width)
+ if (Slot.Width < MinimumSize.Width) {
Slot.Width = MinimumSize.Width;
- else if (Slot.Width > MaximumSize.Width && MaximumSize.Width > 0)
+ NotifyValueChanged ("WidthPolicy", 0);
+ } else if (Slot.Width > MaximumSize.Width && MaximumSize.Width > 0) {
Slot.Width = MaximumSize.Width;
+ NotifyValueChanged ("WidthPolicy", 0);
+ }
if (LastSlots.Width == Slot.Width)
break;
case LayoutingType.Height:
if (Height > 0)
Slot.Height = Height;
- else if (Height < 0){
+ else if (Height < 0) {
Slot.Height = measureRawSize (LayoutingType.Height);
- }else if (Parent.RegisteredLayoutings.HasFlag (LayoutingType.Height))
+ } else if (Parent.RegisteredLayoutings.HasFlag (LayoutingType.Height))
return false;
else
Slot.Height = Parent.ClientRectangle.Height;
//size constrain
- if (Slot.Height < MinimumSize.Height)
+ if (Slot.Height < MinimumSize.Height) {
Slot.Height = MinimumSize.Height;
- else if (Slot.Height > MaximumSize.Height && MaximumSize.Height > 0)
+ NotifyValueChanged ("HeightPolicy", 0);
+ } else if (Slot.Height > MaximumSize.Height && MaximumSize.Height > 0) {
Slot.Height = MaximumSize.Height;
+ NotifyValueChanged ("HeightPolicy", 0);
+ }
if (LastSlots.Height == Slot.Height)
break;
}
#region Binding
+ public void BindMember(string _member, string _expression){
+ Bindings.Add(new Binding (this, _member, _expression));
+ }
public virtual void ResolveBindings()
{
if (Bindings.Count == 0)
SelectedItemChanged.Raise (this, new SelectionChangeEventArgs (SelectedItem));
}
}
- int itemPerPage = 100;
+ int itemPerPage = 50;
MemoryStream templateStream = null;
Type templateBaseType = null;
templateBaseType = Interface.GetTopContainerOfGOMLStream (templateStream);
}
- Group page = _list.Clone () as Group;
- page.Name = "page" + pageNum;
+ lock (Interface.CurrentInterface.UpdateMutex) {
+
+ Group page = _list.Clone () as Group;
+ page.Name = "page" + pageNum;
+ page.Background = Color.Transparent;
- //reset size to fit in the dir of the stacking
- //because _list total size is forced to approx size
- if (_gsList.Orientation == Orientation.Horizontal) {
- page.Width = -1;
- page.Height = 0;
- } else {
- page.Height = -1;
- page.Width = 0;
- }
+ //reset size to fit in the dir of the stacking
+ //because _list total size is forced to approx size
+ if (_gsList.Orientation == Orientation.Horizontal) {
+ page.Width = -1;
+ } else {
+ page.Height = -1;
+// Bindings.Add(new Binding
+// (new MemberReference (page, typeof(GraphicObject).GetMember ("Width")[0]), "../../WidthPolicy"));
+ //page.Bindings.Add(new Binding (page, "Width", "../../WidthPolicy"));
+ page.BindMember("Width", "../../WidthPolicy");
+ }
+ for (int i = (pageNum - 1) * itemPerPage; i < pageNum * itemPerPage; i++) {
+ if (i >= data.Count)
+ break;
+ templateStream.Seek (0, SeekOrigin.Begin);
+ GraphicObject g = Interface.Load (templateStream, templateBaseType);
+ g.MouseClick += itemClick;
+ page.AddChild (g);
+ g.DataSource = data [i];
+ //g.LogicalParent = this;
+ }
- for (int i = (pageNum - 1) * itemPerPage; i < pageNum * itemPerPage; i++) {
- if (i >= data.Count)
- break;
- templateStream.Seek(0,SeekOrigin.Begin);
- GraphicObject g = Interface.Load (templateStream, templateBaseType);
- g.MouseClick += itemClick;
- page.AddChild (g);
- g.DataSource = data [i];
- //g.LogicalParent = this;
+ _list.AddChild (page);
}
-
- _list.AddChild (page);
-
#if DEBUG_LOAD
loadingTime.Stop ();
Debug.WriteLine("Listbox {2} Loading: {0} ticks \t, {1} ms",