private void ListBox3_MouseDown1(object sender, System.Windows.Forms.MouseEventArgs e) { #if DEBUG dbugLayoutMsg msg = listBox3.SelectedItem as dbugLayoutMsg; if (msg == null) { return; } switch (msg.msgOwnerKind) { case dbugLayoutMsgOwnerKind.Layer: { RenderElementLayer layer = (RenderElementLayer)msg.owner; } break; case dbugLayoutMsgOwnerKind.Line: { } break; case dbugLayoutMsgOwnerKind.VisualElement: { RenderElement ve = (RenderElement)msg.owner; dbugHelper01.dbugVE_HighlightMe = ve; lastestSelectVE = ve; vwport.PaintMe(); } break; } #endif }
static void CreateReadyForm( out LayoutFarm.UI.UISurfaceViewportControl viewport, out Form formCanvas) { int w = 800; int h = 600; var rootgfx = new MyRootGraphic(uiPlatformWinForm, useOpenGL ? openGLPlatform : gdiPlatform, w, h); var topRenderBox = rootgfx.TopWindowRenderBox; formCanvas = FormCanvasHelper.CreateNewFormCanvas(rootgfx, useOpenGL ? InnerViewportKind.GL : InnerViewportKind.GdiPlus, out viewport); formCanvas.Text = "FormCanvas 1"; viewport.PaintMe(); formCanvas.WindowState = FormWindowState.Maximized; formCanvas.Show(); }
private void cmdShowEmbededViewport_Click(object sender, EventArgs e) { Form simpleForm = new Form(); simpleForm.Text = "SimpleForm2"; simpleForm.WindowState = FormWindowState.Maximized; Rectangle screenClientAreaRect = Screen.PrimaryScreen.WorkingArea; var viewport = new LayoutFarm.UI.UISurfaceViewportControl(); viewport.Bounds = new Rectangle(0, 0, screenClientAreaRect.Width, screenClientAreaRect.Height); simpleForm.Controls.Add(viewport); int w = 800; int h = 600; var rootgfx = new MyRootGraphic(this.uiPlatformWinForm, this.gfxPlatform, w, h); viewport.InitRootGraphics(rootgfx, rootgfx.TopWinEventPortal, InnerViewportKind.GdiPlus); viewport.PaintMe(); simpleForm.Show(); ShowFormLayoutInspector(viewport); }
public void RunDemo(DemoBase selectedDemo) { YourImplementation.DemoFormCreatorHelper.CreateReadyForm(out _latestviewport, out _latest_formCanvas); selectedDemo.StartDemo(new SampleViewport(_latestviewport)); _latestviewport.TopDownRecalculateContent(); //================================================== _latestviewport.PaintMe(); if (this.chkShowLayoutInspector.Checked) { ShowFormLayoutInspector(_latestviewport); } if (this.chkShowFormPrint.Checked) { ShowFormPrint(_latestviewport); } }
private void cmdShowEmbededViewport_Click(object sender, EventArgs e) { Form simpleForm = new Form(); simpleForm.Text = "SimpleForm2"; simpleForm.WindowState = FormWindowState.Maximized; Rectangle screenClientAreaRect = Screen.PrimaryScreen.WorkingArea; var viewport = new LayoutFarm.UI.UISurfaceViewportControl(); viewport.Bounds = new Rectangle(0, 0, screenClientAreaRect.Width, screenClientAreaRect.Height); simpleForm.Controls.Add(viewport); int w = 800; int h = 600; var rootgfx = new MyRootGraphic(this.uiPlatformWinForm, w, h); viewport.InitRootGraphics(rootgfx, rootgfx.TopWinEventPortal, InnerViewportKind.GdiPlus); viewport.PaintMe(); simpleForm.Show(); ShowFormLayoutInspector(viewport); }
public void RunDemo(DemoBase selectedDemo) { Form formCanvas; CreateReadyForm(out viewport, out formCanvas); selectedDemo.StartDemo(new SampleViewport(viewport)); viewport.TopDownRecalculateContent(); //================================================== viewport.PaintMe(); if (this.chkShowLayoutInspector.Checked) { ShowFormLayoutInspector(viewport); } if (this.chkShowFormPrint.Checked) { ShowFormPrint(viewport); } }
public static void CreateReadyForm( out LayoutFarm.UI.UISurfaceViewportControl viewport, out Form formCanvas) { //1. select view port kind InnerViewportKind innerViewportKind = InnerViewportKind.GdiPlus; var workingArea = Screen.PrimaryScreen.WorkingArea; formCanvas = FormCanvasHelper.CreateNewFormCanvas( workingArea.Width, workingArea.Height, innerViewportKind, out viewport); formCanvas.Text = "FormCanvas 1 :" + innerViewportKind; viewport.PaintMe(); formCanvas.WindowState = FormWindowState.Maximized; formCanvas.Show(); }
public void RunDemo(App app) { //1. create blank form YourImplementation.DemoFormCreatorHelper.CreateReadyForm( (InnerViewportKind)lstPlatformSelectors.SelectedItem, out _latestviewport, out _latest_formCanvas); AppHostWinForm appHost = new AppHostWinForm(); appHost.SetUISurfaceViewportControl(_latestviewport); _latest_formCanvas.FormClosed += (s, e) => { //when owner form is disposed //we should clear our resource? app.OnClosing(); app.OnClosed(); _latest_formCanvas = null; _latestviewport = null; }; //2. create app host appHost.StartApp(app); _latestviewport.TopDownRecalculateContent(); _latestviewport.PaintMe(); //================================================== if (this.chkShowLayoutInspector.Checked) { YourImplementation.LayoutInspectorUtils.ShowFormLayoutInspector(_latestviewport); } if (this.chkShowFormPrint.Checked) { ShowFormPrint(_latestviewport); } }
void CreateReadyForm( out LayoutFarm.UI.UISurfaceViewportControl viewport, out Form formCanvas) { var workingArea = Screen.PrimaryScreen.WorkingArea; int w = workingArea.Width; int h = workingArea.Height; MyRootGraphic rootgfx = new MyRootGraphic(this.uiPlatformWinForm, this.chkUseGLCanvas.Checked ? openGLPlatform : gdiPlatform, w, h); formCanvas = FormCanvasHelper.CreateNewFormCanvas(rootgfx, this.chkUseGLCanvas.Checked ? InnerViewportKind.GL : InnerViewportKind.GdiPlus, out viewport); formCanvas.Text = "FormCanvas 1"; viewport.PaintMe(); formCanvas.WindowState = FormWindowState.Maximized; formCanvas.Show(); }