diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-28 19:05:50 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-28 19:05:50 +0100 |
| commit | cb1d5e6ce6c9f61bef0e9b2c0db23cdc7d101920 (patch) | |
| tree | d41cc8f7c1326bb3174fe69b212f61b31e6fd7f1 | |
| parent | 1d5a24313cd20b97bf9a852e30bade904cb4b95c (diff) | |
combo minimum size
| -rwxr-xr-x | Templates/ComboBox.goml | 8 | ||||
| -rwxr-xr-x | Tests/Interfaces/testCombobox.goml | 2 | ||||
| -rw-r--r-- | src/GraphicObjects/ComboBox.cs | 18 |
3 files changed, 24 insertions, 4 deletions
diff --git a/Templates/ComboBox.goml b/Templates/ComboBox.goml index e512ef2c..94dbc26b 100755 --- a/Templates/ComboBox.goml +++ b/Templates/ComboBox.goml @@ -13,12 +13,14 @@ </HorizontalStack> </Border> </Template> - <Border Background="DimGray" BorderWidth="1" Margin="1" MinimumSize="100;100" MaximumSize="200;400" Height="-1" Width="-1"> + <Border Background="DimGray" BorderWidth="1" Margin="1" + MinimumSize="{../../MinimumPopupSize}" MaximumSize="0;400" + Height="400" Width="{../WidthPolicy}"> <Scroller Name="scroller1" Margin="1" VerticalScrolling="true" - Height="200" Width="-1" + Height="{../HeightPolicy}" Width="{../WidthPolicy}" ValueChanged="../../../_scroller_ValueChanged"> <VerticalStack LayoutChanged="../../../../_list_LayoutChanged" - Height="-1" Width="-1" Name="List" Margin="0" VerticalAlignment="Top"/> + Height="-1" Width="{../../WidthPolicy}" Name="List" Margin="0" VerticalAlignment="Top"/> </Scroller> </Border> </Popper> diff --git a/Tests/Interfaces/testCombobox.goml b/Tests/Interfaces/testCombobox.goml index 8e0b16ad..a4b74c82 100755 --- a/Tests/Interfaces/testCombobox.goml +++ b/Tests/Interfaces/testCombobox.goml @@ -1,5 +1,5 @@ <?xml version="1.0"?> <VerticalStack> - <ComboBox Width="120" Data="{TestList}" SelectedIndex="0" + <ComboBox Width="220" Data="{TestList}" SelectedIndex="0" ItemTemplate="#Tests.Interfaces.colorItem.crow"/> </VerticalStack>
\ No newline at end of file diff --git a/src/GraphicObjects/ComboBox.cs b/src/GraphicObjects/ComboBox.cs index 4f948e5b..019d8c9c 100644 --- a/src/GraphicObjects/ComboBox.cs +++ b/src/GraphicObjects/ComboBox.cs @@ -1,4 +1,5 @@ using System; +using System.Xml.Serialization; namespace Crow { @@ -9,5 +10,22 @@ namespace Crow #region CTOR public ComboBox() : base(){ } #endregion + + Size minimumPopupSize = "100;100"; + [XmlIgnore]public Size MinimumPopupSize{ + get { return minimumPopupSize; } + set { + minimumPopupSize = value; + NotifyValueChanged ("MinimumPopupSize", minimumPopupSize); + } + } + + public override void OnLayoutChanges (LayoutingType layoutType) + { + base.OnLayoutChanges (layoutType); + + if (layoutType == LayoutingType.Width) + MinimumPopupSize = new Size (this.Slot.Width, minimumPopupSize.Height); + } } } |