From: Jean-Philippe Bruyère Date: Wed, 14 Mar 2018 20:42:59 +0000 (+0100) Subject: scroller x, ide wip X-Git-Tag: 0.7.3~4^2~6 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=d02e2c723e8c6dfaf13ba2ef23f31588710b6c95;p=jp%2Fcrow.git scroller x, ide wip --- diff --git a/CrowIDE/CrowIDE.csproj b/CrowIDE/CrowIDE.csproj index 51f6debe..1cae7289 100644 --- a/CrowIDE/CrowIDE.csproj +++ b/CrowIDE/CrowIDE.csproj @@ -297,6 +297,7 @@ + diff --git a/CrowIDE/src/CrowIDE.cs b/CrowIDE/src/CrowIDE.cs index 94bec4a4..3850a865 100644 --- a/CrowIDE/src/CrowIDE.cs +++ b/CrowIDE/src/CrowIDE.cs @@ -42,7 +42,7 @@ namespace Crow.Coding CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp, CMDAbout, CMDOptions, CMDViewGTExp, CMDViewProps, CMDViewProj, CMDViewProjProps, CMDViewErrors, CMDViewSolution, CMDViewEditor, CMDViewProperties, - CMDViewToolbox, CMDViewSchema, CMDViewStyling, + CMDViewToolbox, CMDViewSchema, CMDViewStyling,CMDViewDesign, CMDCompile; void initCommands () { @@ -70,6 +70,8 @@ namespace Crow.Coding { Caption = "Editor Pane"}; CMDViewProperties = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winProperties.crow"))) { Caption = "Properties"}; + CMDViewDesign = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winDesign.crow"))) + { Caption = "Quick Design", CanExecute = true}; CMDViewToolbox = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow"))) { Caption = "Toolbox", CanExecute = false}; CMDViewSchema = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winSchema.crow"))) diff --git a/CrowIDE/src/Editors/ImlVisualEditor.cs b/CrowIDE/src/Editors/ImlVisualEditor.cs index 59a80430..3ccf6278 100644 --- a/CrowIDE/src/Editors/ImlVisualEditor.cs +++ b/CrowIDE/src/Editors/ImlVisualEditor.cs @@ -58,7 +58,9 @@ namespace Crow.Coding Measure designWidth, designHeight; bool updateEnabled; - SvgPicture icoMove, icoStyle; + Picture icoMove, icoStyle; + Rectangle rIcons = default(Rectangle); + Size iconSize = new Size(10,10); public List Commands; Crow.Command cmdDelete; @@ -72,8 +74,8 @@ namespace Crow.Coding void initIcons () { icoMove = new SvgPicture (); icoMove.Load (IFace, "#Crow.Coding.icons.move-arrows.svg"); - icoStyle = new SvgPicture (); - icoStyle.Load (IFace, "#Crow.Coding.icons.palette.svg"); +// icoStyle = new SvgPicture (); +// icoStyle.Load (IFace, "#Crow.Coding.icons.palette.svg"); } [DefaultValue(true)] @@ -283,6 +285,10 @@ namespace Crow.Coding } protected override void updateCheckPostProcess () { + if (Error != null) { + RegisterForRedraw (); + return; + } imlVE.Update (); bool isDirty = false; @@ -375,8 +381,6 @@ namespace Crow.Coding } } - Rectangle rIcons = default(Rectangle); - Size iconSize = new Size(10,10); protected override void onDraw (Cairo.Context gr) { @@ -411,9 +415,6 @@ namespace Crow.Coding Foreground.SetAsSource (gr, cb); gr.Stroke (); } - gr.SetSourceColor (Color.Black); - gr.Rectangle (cb, 1.0 / z); - gr.Stroke (); lock (imlVE.RenderMutex) { using (Cairo.Surface surf = new Cairo.ImageSurface (imlVE.bmp, Cairo.Format.Argb32, @@ -423,6 +424,15 @@ namespace Crow.Coding } imlVE.IsDirty = false; } + if (Error == null) { + gr.SetSourceColor (Color.Black); + gr.Rectangle (cb, 1.0 / z); + } else { + gr.SetSourceColor (Color.LavenderBlush); + gr.Rectangle (cb, 2.0 / z); + drawCenteredTextLine(gr, cb.Center, Error.InnerException?.Message); + } + gr.Stroke (); Rectangle hr; @@ -481,7 +491,7 @@ namespace Crow.Coding gr.Restore (); } - void drawIcon (Context gr, SvgPicture pic, Rectangle r) { + void drawIcon (Context gr, Picture pic, Rectangle r) { // gr.SetSourceColor (Color.Black); // CairoHelpers.CairoRectangle (gr, r.Inflated (1), 2, 1.0); gr.SetSourceColor (Color.White); @@ -544,6 +554,9 @@ namespace Crow.Coding gr.Operator = Operator.Over; } + void drawCenteredTextLine (Context gr, Point center, string txt){ + drawCenteredTextLine (gr, new PointD(center.X,center.Y), txt); + } void drawCenteredTextLine (Context gr, PointD center, string txt){ FontExtents fe = gr.FontExtents; TextExtents te = gr.TextExtents (txt); @@ -855,84 +868,6 @@ namespace Crow.Coding return false; } -// public bool ProcessMouseMove(int x, int y) -// { -// int deltaX = x - imlVE.Mouse.X; -// int deltaY = y - imlVE.Mouse.Y; -// imlVE.Mouse.X = x; -// imlVE.Mouse.Y = y; -// MouseMoveEventArgs e = new MouseMoveEventArgs (x, y, deltaX, deltaY); -// e.Mouse = imlVE.Mouse; -// -// if (imlVE.ActiveWidget != null) { -// //TODO, ensure object is still in the graphic tree -// //send move evt even if mouse move outside bounds -// WidgetMouseMove (imlVE.ActiveWidget, e); -// return true; -// } -// -// if (HoverWidget != null) { -// //TODO, ensure object is still in the graphic tree -// //check topmost graphicobject first -// GraphicObject tmp = HoverWidget; -// GraphicObject topc = null; -// while (tmp is GraphicObject) { -// topc = tmp; -// tmp = tmp.LogicalParent as GraphicObject; -// } -// int idxhw = imlVE.GraphicTree.IndexOf (topc); -// if (idxhw != 0) { -// int i = 0; -// while (i < idxhw) { -// if (GraphicTree [i].MouseIsIn (e.Position)) { -// while (HoverWidget != null) { -// WidgetMouseLeave (imlVE.HoverWidget, e); -// HoverWidget = HoverWidget.focusParent; -// } -// -// GraphicTree [i].checkHoverWidget (e); -// WidgetMouseMove (imlVE.HoverWidget, e); -// return true; -// } -// i++; -// } -// } -// -// -// if (imlVE.HoverWidget.MouseIsIn (e.Position)) { -// WidgetCheckOver (imlVE.HoverWidget, (e)); -// WidgetMouseMove (imlVE.HoverWidget, e); -// return true; -// } else { -// WidgetMouseLeave (imlVE.HoverWidget, e); -// //seek upward from last focused graph obj's -// while (imlVE.HoverWidget.focusParent != null) { -// imlVE.HoverWidget = imlVE.HoverWidget.LogicalParent as GraphicObject; -// if (imlVE.HoverWidget.MouseIsIn (e.Position)) { -// WidgetCheckOver (imlVE.HoverWidget, e); -// WidgetMouseMove (imlVE.HoverWidget, e); -// return true; -// } else -// WidgetMouseLeave (imlVE.HoverWidget, e); -// } -// } -// } -// -// //top level graphic obj's parsing -// lock (imlVE.GraphicTree) { -// for (int i = 0; i < imlVE.GraphicTree.Count; i++) { -// GraphicObject g = imlVE.GraphicTree [i]; -// if (g.MouseIsIn (e.Position)) { -// WidgetCheckOver (g, e); -// WidgetMouseMove (imlVE.HoverWidget, e); -// return true; -// } -// } -// } -// imlVE.HoverWidget = null; -// return false; -// -// } void GTView_SelectedItemChanged (object sender, SelectionChangeEventArgs e) { diff --git a/CrowIDE/src/Editors/SourceEditor.cs b/CrowIDE/src/Editors/SourceEditor.cs index 2fcdc2bd..724def34 100644 --- a/CrowIDE/src/Editors/SourceEditor.cs +++ b/CrowIDE/src/Editors/SourceEditor.cs @@ -894,7 +894,8 @@ namespace Crow.Coding if (hoverLine == value) return; hoverLine = value; - NotifyValueChanged ("HoverLine", hoverLine); + NotifyValueChanged ("HoverLine", hoverLine); + NotifyValueChanged ("HoverError", buffer [hoverLine].exception); } } void updateHoverLine () { diff --git a/CrowIDE/ui/CrowIDE.crow b/CrowIDE/ui/CrowIDE.crow index 9e1b110e..7fe511f1 100644 --- a/CrowIDE/ui/CrowIDE.crow +++ b/CrowIDE/ui/CrowIDE.crow @@ -22,6 +22,7 @@ + diff --git a/CrowIDE/ui/DockWindows/winDesign.crow b/CrowIDE/ui/DockWindows/winDesign.crow new file mode 100644 index 00000000..4b5125b9 --- /dev/null +++ b/CrowIDE/ui/DockWindows/winDesign.crow @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/CrowIDE/ui/ItemTemplates/Enum.template b/CrowIDE/ui/ItemTemplates/Enum.template index 1df1c7a0..701217c7 100755 --- a/CrowIDE/ui/ItemTemplates/Enum.template +++ b/CrowIDE/ui/ItemTemplates/Enum.template @@ -23,7 +23,7 @@ - - - - @@ -28,7 +23,7 @@ + Margin="2" ScrollY="{../scrollbar1.Value}"> - - + -