Skip to content

Commit

Permalink
Version 0.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
rds1983 committed Jan 2, 2018
1 parent 21e4078 commit 7c9ade2
Show file tree
Hide file tree
Showing 36 changed files with 3,283 additions and 275 deletions.
2 changes: 1 addition & 1 deletion Source/Myra.Editor/UI/PropertyGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private PropertyGrid(TreeStyle style, string category, Record parentProperty)
_parentProperty = parentProperty;
ColumnSpacing = 8;
RowSpacing = 8;
ColumnsProportions.Add(new Proportion(ProportionType.Pixels, 100));
ColumnsProportions.Add(new Proportion(ProportionType.Pixels, 150));
ColumnsProportions.Add(new Proportion(ProportionType.Fill));

Category = category;
Expand Down
4 changes: 4 additions & 0 deletions Source/Myra.UIEditor/Studio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ private void BuildUI()
{
AddStandardControl<ImageButton>();
};
_ui._menuControlsAddTextButton.Selected += (s, a) =>
{
AddStandardControl<TextButton>();
};
_ui._menuControlsAddHorizontalSlider.Selected += (s, a) =>
{
AddStandardControl<HorizontalSlider>();
Expand Down
8 changes: 7 additions & 1 deletion Source/Myra.UIEditor/UI/StudioWidget.Generated.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by Myra UI Editor at 12/16/2017 7:58:34 PM */
/* Generated by Myra UI Editor at 12/31/2017 6:08:24 PM */
using Microsoft.Xna.Framework;
using Myra.Graphics2D.UI;

Expand Down Expand Up @@ -65,6 +65,10 @@ private void BuildUI()
_menuControlsAddImageButton.Id = "_menuControlsAddImageButton";
_menuControlsAddImageButton.Text = "Add ImageButton";

_menuControlsAddTextButton = new MenuItem();
_menuControlsAddTextButton.Id = "_menuControlsAddTextButton";
_menuControlsAddTextButton.Text = "Add TextButton";

_menuControlsAddHorizontalSlider = new MenuItem();
_menuControlsAddHorizontalSlider.Id = "_menuControlsAddHorizontalSlider";
_menuControlsAddHorizontalSlider.Text = "Add HorizontalSlider";
Expand Down Expand Up @@ -149,6 +153,7 @@ private void BuildUI()
_menuControls.Items.Add(_menuControlsAddButton);
_menuControls.Items.Add(_menuControlsAddCheckBox);
_menuControls.Items.Add(_menuControlsAddImageButton);
_menuControls.Items.Add(_menuControlsAddTextButton);
_menuControls.Items.Add(_menuControlsAddHorizontalSlider);
_menuControls.Items.Add(_menuControlsAddVerticalSlider);
_menuControls.Items.Add(_menuControlsAddHorizontalProgressBar);
Expand Down Expand Up @@ -247,6 +252,7 @@ private void BuildUI()
public MenuItem _menuControlsAddButton;
public MenuItem _menuControlsAddCheckBox;
public MenuItem _menuControlsAddImageButton;
public MenuItem _menuControlsAddTextButton;
public MenuItem _menuControlsAddHorizontalSlider;
public MenuItem _menuControlsAddVerticalSlider;
public MenuItem _menuControlsAddHorizontalProgressBar;
Expand Down
69 changes: 37 additions & 32 deletions Source/Myra.UIEditor/UI/studio.ui
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"$type": "Myra.Graphics2D.UI.ExportOptions, Myra",
"Namespace": "Myra.UIEditor.UI",
"Class": "StudioWidget",
"OutputPath": "D:/Projects/Hebron/Myra/Source/Myra.UIEditor/UI"
"OutputPath": "D:/Projects/Wanderers/Myra/Source/Myra.UIEditor/UI"
},
"Root": {
"$id": "2",
Expand All @@ -22,14 +22,12 @@
"RowsProportions": [
{
"$id": "4",
"$type": "Myra.Graphics2D.UI.Grid+Proportion, Myra",
"Value": 1.0
"$type": "Myra.Graphics2D.UI.Grid+Proportion, Myra"
},
{
"$id": "5",
"$type": "Myra.Graphics2D.UI.Grid+Proportion, Myra",
"Type": 2,
"Value": 1.0
"Type": 2
}
],
"Widgets": [
Expand Down Expand Up @@ -131,134 +129,141 @@
"$id": "21",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddTextButton",
"Text": "Add TextButton"
},
{
"$id": "22",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddHorizontalSlider",
"Text": "Add HorizontalSlider"
},
{
"$id": "22",
"$id": "23",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddVerticalSlider",
"Text": "Add VerticalSlider"
},
{
"$id": "23",
"$id": "24",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddHorizontalProgressBar",
"Text": "Add Horizontal ProgressBar"
},
{
"$id": "24",
"$id": "25",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddVerticalProgressBar",
"Text": "Add Vertical ProgressBar"
},
{
"$id": "25",
"$id": "26",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddComboBox",
"Text": "Add ComboBox"
},
{
"$id": "26",
"$id": "27",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddListBox",
"Text": "Add ListBox"
},
{
"$id": "27",
"$id": "28",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddPanel",
"Text": "Add Panel"
},
{
"$id": "28",
"$id": "29",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddGrid",
"Text": "Add Grid"
},
{
"$id": "29",
"$id": "30",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddImage",
"Text": "Add Image"
},
{
"$id": "30",
"$id": "31",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddHorizontalMenu",
"Text": "Add HorizontalMenu"
},
{
"$id": "31",
"$id": "32",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddVerticalMenu",
"Text": "Add Vertical Menu"
},
{
"$id": "32",
"$id": "33",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddScrollPane",
"Text": "Add ScrollPane"
},
{
"$id": "33",
"$id": "34",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddHorizontalSplitPane",
"Text": "Add Horizontal SplitPane"
},
{
"$id": "34",
"$id": "35",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddVerticalSplitPane",
"Text": "Add Vertical SplitPane"
},
{
"$id": "35",
"$id": "36",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddTextBlock",
"Text": "Add TextBlock"
},
{
"$id": "36",
"$id": "37",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddTextField",
"Text": "Add TextField"
},
{
"$id": "37",
"$id": "38",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddSpinButton",
"Text": "Add SpinButton"
},
{
"$id": "38",
"$id": "39",
"$type": "Myra.Graphics2D.UI.MenuSeparator, Myra"
},
{
"$id": "39",
"$id": "40",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddMenuItem",
"Text": "Add Menu Item"
},
{
"$id": "40",
"$id": "41",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuControlsAddMenuSeparator",
Expand All @@ -269,11 +274,11 @@
"Text": "&Controls"
},
{
"$id": "41",
"$id": "42",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [
{
"$id": "42",
"$id": "43",
"$type": "Myra.Graphics2D.UI.MenuItem, Myra",
"Items": [],
"Id": "_menuHelpAbout",
Expand All @@ -285,7 +290,7 @@
}
],
"DrawLinesColor": {
"$id": "43",
"$id": "44",
"$type": "Microsoft.Xna.Framework.Color, MonoGame.Framework",
"B": 255,
"G": 255,
Expand All @@ -297,31 +302,31 @@
"VerticalAlignment": 3
},
{
"$id": "44",
"$id": "45",
"$type": "Myra.Graphics2D.UI.HorizontalSplitPane, Myra",
"Widgets": [
{
"$id": "45",
"$id": "46",
"$type": "Myra.Graphics2D.UI.Panel, Myra",
"Widgets": [],
"Id": "_projectHolder",
"HorizontalAlignment": 3,
"VerticalAlignment": 3
},
{
"$id": "46",
"$id": "47",
"$type": "Myra.Graphics2D.UI.VerticalSplitPane, Myra",
"Widgets": [
{
"$id": "47",
"$id": "48",
"$type": "Myra.Graphics2D.UI.Panel, Myra",
"Widgets": [],
"Id": "_explorerHolder",
"HorizontalAlignment": 3,
"VerticalAlignment": 3
},
{
"$id": "48",
"$id": "49",
"$type": "Myra.Graphics2D.UI.ScrollPane, Myra",
"Id": "_propertyGridPane",
"HorizontalAlignment": 3,
Expand Down
7 changes: 7 additions & 0 deletions Source/Myra.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Myra.Samples.CustomUIStyles
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Myra.Samples.AllWidgetsSample", "Samples\Myra.Samples.AllWidgetsSample\Myra.Samples.AllWidgetsSample.csproj", "{0F48899B-E533-423E-BAE4-FDD09A3A6698}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Myra.Samples.TabControlSample", "Samples\Myra.Samples.TabControlSample\Myra.Samples.TabControlSample.csproj", "{46A18A74-5EB4-4B85-B1B7-279A1D8FDDA6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -100,6 +102,10 @@ Global
{0F48899B-E533-423E-BAE4-FDD09A3A6698}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F48899B-E533-423E-BAE4-FDD09A3A6698}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F48899B-E533-423E-BAE4-FDD09A3A6698}.Release|Any CPU.Build.0 = Release|Any CPU
{46A18A74-5EB4-4B85-B1B7-279A1D8FDDA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46A18A74-5EB4-4B85-B1B7-279A1D8FDDA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46A18A74-5EB4-4B85-B1B7-279A1D8FDDA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46A18A74-5EB4-4B85-B1B7-279A1D8FDDA6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -115,6 +121,7 @@ Global
{74E297C2-1081-4C9A-9311-EAAF4746A413} = {EAB0AA24-7185-4897-A866-AE87AF3F2E0B}
{79441052-8F88-4578-8A94-0CC87B0EFE5C} = {EAB0AA24-7185-4897-A866-AE87AF3F2E0B}
{0F48899B-E533-423E-BAE4-FDD09A3A6698} = {EAB0AA24-7185-4897-A866-AE87AF3F2E0B}
{46A18A74-5EB4-4B85-B1B7-279A1D8FDDA6} = {EAB0AA24-7185-4897-A866-AE87AF3F2E0B}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Myra.UIEditor\Myra.UIEditor.csproj
Expand Down
11 changes: 10 additions & 1 deletion Source/Myra/Graphics2D/UI/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ public virtual bool ImageVisible
set { _image.Visible = value; }
}

[EditCategory("Appearance")]
[DefaultValue(0)]
public int ImageTextSpacing
{
get { return Widget.ColumnSpacing; }

set { Widget.ColumnSpacing = value; }
}

public Button(ButtonStyle style)
{
Widget = new Grid();
Expand Down Expand Up @@ -234,4 +243,4 @@ internal override string[] GetStyleNames(Stylesheet stylesheet)
return stylesheet.ButtonStyles.Keys.ToArray();
}
}
}
}
10 changes: 9 additions & 1 deletion Source/Myra/Graphics2D/UI/ButtonBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public virtual VerticalAlignment ContentVerticalAlignment
[EditCategory("Behavior")]
public virtual bool Toggleable { get; set; }

[EditCategory("Behavior")]
public bool IgnoreMouseButton { get; set; }

[HiddenInEditor]
[JsonIgnore]
public bool IsPressed
Expand Down Expand Up @@ -80,6 +83,11 @@ public override void OnMouseUp(MouseButtons mb)
{
base.OnMouseUp(mb);

if (IgnoreMouseButton)
{
return;
}

if (!Toggleable)
{
IsPressed = false;
Expand All @@ -90,7 +98,7 @@ public override void OnMouseDown(MouseButtons mb)
{
base.OnMouseDown(mb);

if (!Enabled)
if (!Enabled || IgnoreMouseButton)
{
return;
}
Expand Down
Loading

0 comments on commit 7c9ade2

Please sign in to comment.