diff --git a/TestApps/Samples/Samples/ButtonSample.cs b/TestApps/Samples/Samples/ButtonSample.cs index 843ea76e..a2e4e72e 100644 --- a/TestApps/Samples/Samples/ButtonSample.cs +++ b/TestApps/Samples/Samples/ButtonSample.cs @@ -48,7 +48,7 @@ namespace Samples b1.Clicked += delegate { b1.Label = "Clicked!"; }; - PackStart (b1); + PackStart (b1, false, false); Button b2 = new Button ("Click me"); b2.Style = ButtonStyle.Flat; @@ -56,8 +56,18 @@ namespace Samples b2.Label = "Clicked!"; }; PackStart (b2); - + PackStart (new Button (StockIcons.ZoomIn.WithSize (22))); + PackStart (new Button (StockIcons.ZoomIn.WithSize (32), "Custom Size") { WidthRequest = 110, MinHeight = 50 }); + + var hbox = new HBox(); + hbox.PackStart (new Button (StockIcons.ZoomIn.WithSize (22), "Zoom In") { ImagePosition = ContentPosition.Top }); + hbox.PackStart (new Button (StockIcons.ZoomOut.WithSize (22), "Zoom Out") { ImagePosition = ContentPosition.Bottom }); + hbox.PackStart (new Button (StockIcons.Information.WithSize (48), "Info") { ImagePosition = ContentPosition.Top }, true); + hbox.PackEnd (new Button ("Custom" + Environment.NewLine + "Width") { MinWidth = 110 }); + PackStart (hbox); + + PackStart (new Button (new CustomImage ().WithSize (22), "with red background") { BackgroundColor = Colors.Red }); MenuButton mb = new MenuButton ("This is a Menu Button"); diff --git a/TestApps/Samples/Samples/Checkboxes.cs b/TestApps/Samples/Samples/Checkboxes.cs index 31981e00..244de5b4 100644 --- a/TestApps/Samples/Samples/Checkboxes.cs +++ b/TestApps/Samples/Samples/Checkboxes.cs @@ -32,25 +32,31 @@ namespace Samples { public Checkboxes () { - PackStart (new CheckBox ("Normal checkbox")); - PackStart (new CheckBox ("Mixed to start") { State = CheckBoxState.Mixed }); + var a = new CheckBox ("Normal checkbox"); + var b = new CheckBox ("Disabled") { Sensitive = false }; + var c = new CheckBox ("Allows mixed (with red background)") { AllowMixed = true }; + c.BackgroundColor = Xwt.Drawing.Colors.Red; - var b = new CheckBox ("Allows mixed (with red background)") { AllowMixed = true }; - b.BackgroundColor = Xwt.Drawing.Colors.Red; + a.Toggled += (sender, e) => b.Sensitive = a.Active; + + PackStart (a); PackStart (b); + + PackStart (new CheckBox ("Mixed to start") { AllowMixed = true, State = CheckBoxState.Mixed }); + PackStart (c); int clicks = 0, toggles = 0; Label la = new Label (); PackStart (la); - b.Clicked += delegate { + c.Clicked += delegate { clicks++; - la.Text = string.Format ("state:{0}, clicks:{1}, toggles:{2}", b.State, clicks, toggles); + la.Text = string.Format ("state:{0}, clicks:{1}, toggles:{2}", c.State, clicks, toggles); }; - b.Toggled += delegate { + c.Toggled += delegate { toggles++; - la.Text = string.Format ("state:{0}, clicks:{1}, toggles:{2}", b.State, clicks, toggles); + la.Text = string.Format ("state:{0}, clicks:{1}, toggles:{2}", c.State, clicks, toggles); }; } } diff --git a/TestApps/Samples/Samples/ComboBoxes.cs b/TestApps/Samples/Samples/ComboBoxes.cs index c70c8308..718e89e4 100644 --- a/TestApps/Samples/Samples/ComboBoxes.cs +++ b/TestApps/Samples/Samples/ComboBoxes.cs @@ -78,12 +78,11 @@ namespace Samples c3.SelectedText); }; PackStart (box); - - box = new HBox (); + var c4 = new ComboBoxEntry (); - var la4 = new Label (); - box.PackStart (c4); - box.PackStart (la4); + var la4 = new Label ("Selected text: "); + PackStart (c4); + PackStart (la4); c4.Items.Add (1, "One"); c4.Items.Add (2, "Two"); @@ -92,7 +91,6 @@ namespace Samples c4.TextEntry.Changed += delegate { la4.Text = "Selected text: " + c4.TextEntry.Text; }; - PackStart (box); HBox selBox = new HBox (); Label las = new Label ("Selection:"); diff --git a/TestApps/Samples/Samples/ProgressBarSample.cs b/TestApps/Samples/Samples/ProgressBarSample.cs index c6594d37..2b0041fc 100644 --- a/TestApps/Samples/Samples/ProgressBarSample.cs +++ b/TestApps/Samples/Samples/ProgressBarSample.cs @@ -39,6 +39,9 @@ namespace Samples public ProgressBarSample () { + PackStart (new ProgressBar { Fraction = 0 }); + PackStart (new ProgressBar { Fraction = 0.5d, MinHeight = 20 }); + PackStart (new ProgressBar { Fraction = 1 }); indeterminateProgressBar = new ProgressBar (); PackStart (indeterminateProgressBar, true); indeterminateProgressBar.Indeterminate = true; diff --git a/TestApps/Samples/Samples/RadioButtonSample.cs b/TestApps/Samples/Samples/RadioButtonSample.cs index a5b8c9d5..1217d75b 100644 --- a/TestApps/Samples/Samples/RadioButtonSample.cs +++ b/TestApps/Samples/Samples/RadioButtonSample.cs @@ -57,9 +57,11 @@ namespace Samples var b4 = new RadioButton (box); var b5 = new RadioButton ("Second Option"); + var b6 = new RadioButton ("Disabled Option") { Sensitive = false }; PackStart (b4); PackStart (b5); - b4.Group = b5.Group; + PackStart (b6); + b4.Group = b5.Group = b6.Group; } } } diff --git a/TestApps/Samples/Samples/Spinners.cs b/TestApps/Samples/Samples/Spinners.cs index cebed7f9..233f36d2 100644 --- a/TestApps/Samples/Samples/Spinners.cs +++ b/TestApps/Samples/Samples/Spinners.cs @@ -23,7 +23,6 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using System; using Xwt; namespace Samples @@ -37,6 +36,13 @@ namespace Samples PackStart (button); PackStart (new Spinner ()); + + PackStart (new Spinner () { MinHeight = 50 }); + + PackStart (new Label ("Click to toggle animation:")); + var clickable = new Spinner () { MinHeight = 30, Animate = true }; + clickable.ButtonPressed += (sender, e) => clickable.Animate = !clickable.Animate; + PackStart (clickable); } } } diff --git a/TestApps/Samples/Samples/TextEntries.cs b/TestApps/Samples/Samples/TextEntries.cs index 71ef4833..fd2a8152 100644 --- a/TestApps/Samples/Samples/TextEntries.cs +++ b/TestApps/Samples/Samples/TextEntries.cs @@ -77,6 +77,10 @@ namespace Samples TextEntry te2 = new TextEntry (); te2.Font = te2.Font.WithScaledSize (0.5); PackStart (te2); + + PackStart (new TextEntry { Text = "Entry with custom height", MinHeight = 50 }); + + PackStart (new TextEntry { Text = "Readonly text", ReadOnly = true }); PackStart (new Label ("Entry with placeholder text")); TextEntry te3 = new TextEntry ();