public MainForm() { InitializeComponent(); cbScale.SelectedIndex = 1; cbScale.SelectedIndexChanged += CbScale_SelectedIndexChanged; cbBGMode.SelectedIndex = 0; cbBGMode.SelectedIndexChanged += cbBGMode_SelectedIndexChanged; drawArea = new SpeccyDrawControl(); drawArea.Scale = 2; drawArea.Tool = SpeccyDrawControlTool.Line; drawArea.Mode = SpeccyDrawControlMode.Bitmap; drawArea.ActiveAttribute.Bright = false; drawArea.ActiveAttribute.Ink = ZXClasses.ZXColor.Black; drawArea.ActiveAttribute.Paper = ZXClasses.ZXColor.White; drawArea.HistoryChanged += drawArea_HistoryChanged; drawArea.PolyToolChanged += DrawArea_PolyToolChanged; containerForm = new Form(); containerForm.FormBorderStyle = FormBorderStyle.FixedSingle; containerForm.TopLevel = false; containerForm.ClientSize = drawArea.Size; containerForm.MaximizeBox = false; containerForm.MinimizeBox = false; containerForm.FormClosing += containerForm_FormClosing; containerForm.Controls.Add(drawArea); containerForm.Move += ContainerForm_Move; drawArea.Location = Point.Empty; drawArea.Visible = false; windowPanel.Controls.Add(containerForm); containerForm.Visible = true; drawArea.Visible = true; }
public MainForm() { InitializeComponent(); cbScale.SelectedIndex = 1; cbScale.SelectedIndexChanged += CbScale_SelectedIndexChanged; cbBGMode.SelectedIndex = 0; cbBGMode.SelectedIndexChanged += cbBGMode_SelectedIndexChanged; drawArea = new SpeccyDrawControl(); drawArea.Scale = 2; drawArea.Tool = SpeccyDrawControlTool.Line; drawArea.Mode = SpeccyDrawControlMode.Bitmap; drawArea.ActiveAttribute.Bright = false; drawArea.ActiveAttribute.Ink = ZXClasses.ZXColor.Black; drawArea.ActiveAttribute.Paper = ZXClasses.ZXColor.White; drawArea.HistoryChanged += drawArea_HistoryChanged; drawArea.PolyToolChanged += DrawArea_PolyToolChanged; drawArea.ActionsChanged += DrawArea_ActionsChanged; drawArea.GrabFinished += DrawArea_GrabFinished; drawArea.RequestPattern += DrawArea_RequestPattern; drawArea.RequestAllPatterns += DrawArea_RequestAllPatterns; drawArea.SetAllPatterns += DrawArea_SetAllPatterns; containerForm = new Form(); containerForm.FormBorderStyle = FormBorderStyle.FixedToolWindow; containerForm.ControlBox = false; containerForm.TopLevel = false; containerForm.ClientSize = drawArea.Size; containerForm.MaximizeBox = false; containerForm.MinimizeBox = false; containerForm.FormClosing += containerForm_FormClosing; containerForm.Text = "Drawing"; containerForm.Controls.Add(drawArea); containerForm.Move += ContainerForm_Move; drawArea.Location = Point.Empty; drawArea.Visible = false; windowPanel.Controls.Add(containerForm); containerForm.Visible = true; drawArea.Visible = true; drawArea.BackgroundAlpha = 0.5f; actionListFrm = new ActionList(); actionListFrm.FormBorderStyle = FormBorderStyle.SizableToolWindow; actionListFrm.TopLevel = false; actionListFrm.MaximizeBox = false; actionListFrm.MinimizeBox = false; actionListFrm.Visible = true; actionListFrm.Move += ActionListFrm_Move; windowPanel.Controls.Add(actionListFrm); actionListFrm.CopyActions += ActionListFrm_CopyActions; actionListFrm.PasteActions += ActionListFrm_PasteActions; actionListFrm.ShiftUpActions += ActionListFrm_ShiftUpActions; actionListFrm.ShiftDownActions += ActionListFrm_ShiftDownActions; actionListFrm.DeleteActions += ActionListFrm_DeleteActions; actionListFrm.HorizontalMirrorActions += ActionListFrm_HorizontalMirrorActions; actionListFrm.VerticalMirrorActions += ActionListFrm_VerticalMirrorActions; actionListFrm.AbsoulteHorizontalMirrorActions += ActionListFrm_AbsoulteHorizontalMirrorActions; actionListFrm.AbsoulteVerticalMirrorActions += ActionListFrm_AbsoulteVerticalMirrorActions; actionListFrm.GrabActions += ActionListFrm_GrabActions; patternEditorFrm = new PatternEditor(); patternEditorFrm.FormBorderStyle = FormBorderStyle.SizableToolWindow; patternEditorFrm.TopLevel = false; patternEditorFrm.MaximizeBox = false; patternEditorFrm.MinimizeBox = false; patternEditorFrm.Visible = true; patternEditorFrm.Move += PatternEditorFrm_Move; patternEditorFrm.SelectedPatternChanged += PatternEditorFrm_SelectedPatternChanged; windowPanel.Controls.Add(patternEditorFrm); actionListFrm.Left = containerForm.Right + 5; actionListFrm.Height = containerForm.Height; patternEditorFrm.Left = actionListFrm.Right + 5; patternEditorFrm.Top = actionListFrm.Top; patternEditorFrm.Height = actionListFrm.Height; }