/// <summary> /// Enables the zoom frame and also cleans it up depending on the checkbox value. /// </summary> /// <param name="b"></param> public void CheckboxChanged(bool b) { _zoomCheckbox = b; if (_zoomCheckbox) { _trackBar.Enabled = true; _view.Get("ListView").Enabled = false; // Disable listview when zooming _zoomView = new ZoomView(); UpdateZoom(); _zoomView.Show(); } else if (!_zoomCheckbox) { _panel.Invalidate(); _trackBar.Enabled = false; _view.Get("ListView").Enabled = true; // Enable listview when not zooming _zoomView?.Dispose(); } }
public void HandleCheckBoxEvent(object sender, EventArgs e) { CheckBox checkBox = (CheckBox)sender; zoomCheckboxChecked = checkBox.Checked; view.Get(ProductGrid.PropertyEnum.Trackbar).Enabled = zoomCheckboxChecked; if (zoomCheckboxChecked) { if (zoomView == null) { zoomView = new ZoomView(); } zoomView?.Show(); } else if (!zoomCheckboxChecked) { zoomView?.Hide(); view.Get(ProductGrid.PropertyEnum.Panel).Invalidate(); } }
/// <inheritdoc/> public override IDock CreateDefaultLayout() { // Dashboard var dashboardView = new DashboardView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Dashboard" }; // Page var pageView = new PageView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Page" }; // Left / Top var projectView = new ProjectView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Project" }; var optionsView = new OptionsView { Dock = "", Width = 200, Height = 200, Title = "Options" }; var imagesView = new ImagesView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Images" }; // Left / Bottom var groupsView = new GroupsView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Groups" }; var databasesView = new DatabasesView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Databases" }; // Right / Top var stylesView = new StylesView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Styles" }; var templatesView = new TemplatesView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Templates" }; var containerView = new ContainerView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Container" }; var zoomView = new ZoomView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Zoom" }; // Right / Bottom var toolsView = new ToolsView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Tools" }; var shapeView = new ShapeView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Shape" }; var dataView = new DataView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Data" }; var styleView = new StyleView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Style" }; var templateView = new TemplateView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Template" }; // Left var leftPane = new DockLayout { Dock = "Left", Width = 200, Height = double.NaN, Title = "EditorLeft", CurrentView = null, Views = new ObservableCollection <IDock> { new DockStrip { Dock = "Top", Width = double.NaN, Height = 340, Title = "EditorLeftTop", CurrentView = projectView, Views = new ObservableCollection <IDock> { projectView, optionsView, imagesView } }, new DockSplitter() { Dock = "Top", Title = "LeftTopSplitter" }, new DockStrip { Dock = "Bottom", Width = double.NaN, Height = double.NaN, Title = "EditorLeftBottom", CurrentView = groupsView, Views = new ObservableCollection <IDock> { groupsView, databasesView } } } }; // Right var rightPane = new DockLayout { Dock = "Right", Width = 240, Height = double.NaN, Title = "EditorRight", CurrentView = null, Views = new ObservableCollection <IDock> { new DockStrip { Dock = "Top", Width = double.NaN, Height = 340, Title = "EditorRightTop", CurrentView = stylesView, Views = new ObservableCollection <IDock> { stylesView, templatesView, containerView, zoomView } }, new DockSplitter() { Dock = "Top", Title = "RightTopSplitter" }, new DockStrip { Dock = "Bottom", Width = double.NaN, Height = double.NaN, Title = "EditorRightBottom", CurrentView = toolsView, Views = new ObservableCollection <IDock> { toolsView, shapeView, dataView, styleView, templateView } } } }; // Editor var editorLayout = new DockLayout { Dock = "", Width = double.NaN, Height = double.NaN, Title = "EditorLayout", CurrentView = null, Views = new ObservableCollection <IDock> { leftPane, new DockSplitter() { Dock = "Left", Title = "LeftSplitter" }, rightPane, new DockSplitter() { Dock = "Right", Title = "RightSplitter" }, pageView } }; var editorView = new EditorView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Editor", CurrentView = editorLayout, Views = new ObservableCollection <IDock> { editorLayout } }; // About var aboutView = new AboutView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "About" }; // Browser var browserView = new BrowserView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Browser" }; // Document var documentView = new DocumentView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Document" }; // Main var layout = new DockRoot { Dock = "", Width = double.NaN, Height = double.NaN, CurrentView = dashboardView, Views = new ObservableCollection <IDock> { dashboardView, editorView, aboutView, browserView, documentView } }; return(layout); }
// TreeViewの項目が選択された private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { Console.WriteLine(e.Node.Text); switch (e.Node.Tag) { case "101": { drawManager.Clear(); drawMode = EDrawMode.Draw1; drawManager.initDrawList(); UDrawable obj = new UDrawableRect(100, "rect1", 100, 100, 100, 100); obj.Color = Color.Yellow; drawManager.addDrawable(obj); UDrawable obj3 = new UDrawableRect(1, "rect2", 200, 200, 100, 100); obj3.Color = Color.Gray; drawManager.addDrawable(obj3); UDrawable obj2 = new UDrawableRect(1, "rect3", 150, 150, 100, 100); obj2.Color = Color.Orange; drawManager.addDrawable(obj2); } break; case "102": { drawManager.Clear(); drawMode = EDrawMode.Draw2; UTextView text1 = new UTextView("text1", 20, 100, StringAlignment.Near, StringAlignment.Near, true, 100, 100, Color.Red); drawManager.addDrawable(text1); } break; case "103": drawMode = EDrawMode.Draw3; break; case "201": { drawMode = EDrawMode.Button1; drawManager.Clear(); ButtonCallback callback1 = new ButtonCallback(ButtonCallback1); UButton button1 = new UButton(100, 1, "button1", 100, 100, 100, 50, callback1); drawManager.addDrawable(button1); UButton button2 = new UButton(100, 2, "button2", 100, 200, 100, 50, callback1); drawManager.addDrawable(button2); } break; case "202": { drawMode = EDrawMode.Button2; drawManager.Clear(); ZoomView zoomView = new ZoomView(100, "zoom1", 100, 100); drawManager.addDrawable(zoomView); } break; case "203": drawMode = EDrawMode.Button3; break; case "301": drawMode = EDrawMode.List1; break; case "302": drawMode = EDrawMode.List2; break; case "303": drawMode = EDrawMode.List3; break; case "401": drawMode = EDrawMode.SB1; break; case "402": drawMode = EDrawMode.SB2; break; case "403": drawMode = EDrawMode.SB3; break; default: return; } panel2.Invalidate(); }