From: Jean-Philippe Bruyère Date: Fri, 9 Mar 2018 22:11:41 +0000 (+0100) Subject: undo/redo, hscrollbar X-Git-Tag: v0.9.5-beta~153^2~12 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=991a840bf9bc92ddc76e9e9961706168328a211b;p=jp%2Fcrow.git undo/redo, hscrollbar --- diff --git a/Crow.csproj b/Crow.csproj index 9e474f58..f14b185a 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -386,6 +386,9 @@ Crow.DockWindow.template + + Crow.HScrollBar.template + diff --git a/Default.style b/Default.style index 5cb1aad6..0c9fe38f 100644 --- a/Default.style +++ b/Default.style @@ -148,6 +148,11 @@ ScrollBar { Maximum = "0"; Value = "0"; } +HScrollBar { + Template = "#Crow.HScrollBar.template"; + Maximum = "0"; + Value = "0"; +} Scroller { CacheEnabled = "false"; } @@ -193,4 +198,16 @@ ArrowBut { MouseUp="{Background=hgradient|0:Gray|1:Jet}"; MouseEnter="{Foreground=Black}"; MouseLeave="{Foreground=Jet}"; +} +HArrowBut { + MouseRepeat="true"; + Height="Fit"; + Width="Fit"; + Focusable="true"; + Foreground="Jet"; + Background="vgradient|0:Gray|1:Jet"; + MouseDown="{Background=vgradient|0:White|0.4:BlueCrayola|1:Jet}"; + MouseUp="{Background=vgradient|0:Gray|1:Jet}"; + MouseEnter="{Foreground=Black}"; + MouseLeave="{Foreground=Jet}"; } \ No newline at end of file diff --git a/Templates/HScrollBar.template b/Templates/HScrollBar.template new file mode 100755 index 00000000..57f575c5 --- /dev/null +++ b/Templates/HScrollBar.template @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/src/GraphicObjects/FileDialog.cs b/src/GraphicObjects/FileDialog.cs index 8f1a0830..8069b8a7 100644 --- a/src/GraphicObjects/FileDialog.cs +++ b/src/GraphicObjects/FileDialog.cs @@ -149,6 +149,7 @@ namespace Crow void onCancel(object sender, MouseButtonEventArgs e){ IFace.DeleteWidget (this); } + } } diff --git a/src/GraphicObjects/Slider.cs b/src/GraphicObjects/Slider.cs index 2e4a5fef..59eb99ec 100644 --- a/src/GraphicObjects/Slider.cs +++ b/src/GraphicObjects/Slider.cs @@ -68,7 +68,7 @@ namespace Crow protected double unity; #region Public properties - [XmlAttributeAttribute()][DefaultValue("vgradient|0:White|0,1:LightGray|0,9:LightGray|1:DimGray")] + [DefaultValue("vgradient|0:White|0,1:LightGray|0,9:LightGray|1:DimGray")] public virtual Fill CursorColor { get { return _cursorColor; } set { @@ -79,7 +79,7 @@ namespace Crow NotifyValueChanged ("CursorColor", _cursorColor); } } - [XmlAttributeAttribute()][DefaultValue(20)] + [DefaultValue(20)] public virtual int CursorSize { get { return _cursorSize; } set { @@ -90,7 +90,7 @@ namespace Crow NotifyValueChanged ("CursorSize", _cursorSize); } } - [XmlAttributeAttribute()][DefaultValue(Orientation.Horizontal)] + [DefaultValue(Orientation.Horizontal)] public virtual Orientation Orientation { get { return _orientation; } @@ -105,7 +105,7 @@ namespace Crow } #endregion - [XmlAttributeAttribute()][DefaultValue(10.0)] + [DefaultValue(10.0)] public override double Maximum { get { return base.Maximum; } set { diff --git a/src/Interface.cs b/src/Interface.cs index eb4caefa..f17ac895 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -1131,15 +1131,16 @@ namespace Crow MenuItem ctxMenuContainer; protected void initContextMenus (){ ctxMenuContainer = Load ("#Crow.ContextMenu.template") as MenuItem; + ctxMenuContainer.LayoutChanged += CtxMenuContainer_LayoutChanged; } void CtxMenuContainer_LayoutChanged (object sender, LayoutingEventArgs e) { Rectangle r = ctxMenuContainer.ScreenCoordinates (ctxMenuContainer.Slot); - if (e.LayoutType == LayoutingType.Width) { + if (e.LayoutType == LayoutingType.Width || e.LayoutType == LayoutingType.X) { if (r.Right > this.clientRectangle.Right) ctxMenuContainer.Left = this.clientRectangle.Right - ctxMenuContainer.Slot.Width; - }else if (e.LayoutType == LayoutingType.Width) { + }else if (e.LayoutType == LayoutingType.Width || e.LayoutType == LayoutingType.Y) { if (r.Bottom > this.clientRectangle.Bottom) ctxMenuContainer.Top = this.clientRectangle.Bottom - ctxMenuContainer.Slot.Height; }