]> O.S.I.I.S - jp/crow.git/commitdiff
combo minimum size
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 28 Feb 2016 18:05:50 +0000 (19:05 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 28 Feb 2016 18:05:50 +0000 (19:05 +0100)
Templates/ComboBox.goml
Tests/Interfaces/testCombobox.goml
src/GraphicObjects/ComboBox.cs

index e512ef2c9ae83e028ea7beb720da59adf65eaa92..94dbc26b7ca93aa5e800a25607436c4af13459ad 100755 (executable)
                        </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>
index 8e0b16ad43738a7919a60cc920219b6609a23753..a4b74c826c831cb4b0a6b28de2832f7eb652aadf 100755 (executable)
@@ -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
index 4f948e5b91febf9534efa79a21780118722d1e5e..019d8c9c9369db3a70f2a673b0adc196411cbb19 100644 (file)
@@ -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);                 
+               }
        }
 }