private void Menuclick(string name) { string mName = name.Substring(name.IndexOf("_") + 1); ChoiceForm choiceForm = new ChoiceForm(mName); choiceForm.StartPosition = FormStartPosition.Manual; choiceForm.Location = new Point(parentForm.Location.X + (parentForm.Width / 2) - (choiceForm.Width / 4), parentForm.Location.Y + (parentForm.Height / 2) - (choiceForm.Height / 2)); choiceForm.ShowDialog(); uv.tt(); }
//TODO bug, since we dont create the form from scratch each time, the button sizes dont get updated private ChoiceForm createChoiceForm() { if (this.moveChoiceForm == null || this.moveChoiceForm.IsDisposed == true) { this.moveChoiceForm = new ChoiceForm(this.ccToolbar, 4, false, false); //moveChoiceForm.TransparencyKey = Color.Magenta; //moveChoiceForm.BackColor = Color.Magenta; moveChoiceForm.TopButton.SetIcon("Icons/arrow_up.png"); moveChoiceForm.LeftButton.SetIcon("Icons/arrow_left.png"); moveChoiceForm.RightButton.SetIcon("Icons/arrow_right.png"); moveChoiceForm.BottomButton.SetIcon("Icons/arrow_down.png"); moveChoiceForm.BottomButton.Click += new EventHandler(BottomButton_Click); } return(this.moveChoiceForm); }
/// <summary> /// On Click: Show Zoom choice form. /// </summary> public override void ClickAction(object sender, EventArgs e) { this.ccMainForm.State = CCMainForm.CCFormState.Etc; //TODO refactor this.ccMainForm.resetState(); ChoiceForm zoomCF = createChoiceForm(); zoomCF.Show(); //buttons will get resized zoomCF.TopMost = true; //zoomCF.ShowDialog(); //buttons will not get resized //TODO refactor, maybe move can be a choice form within the zoom choice form? //also show moving arrows so you can move around while zooming //display instructions for move arrows ccMainForm.ShowMessage("Put mouse in arrows to move image"); ccMainForm.State = CCMainForm.CCFormState.Moving; }
private ChoiceForm createChoiceForm() { if (this.zoomChoiceForm == null || this.zoomChoiceForm.IsDisposed == true) { zoomChoiceForm = new ChoiceForm(this.ccToolbar, 2, false, false); zoomChoiceForm.Label.Text = "Zoom: " + (this.zoomLevel * 100) + "%"; zoomChoiceForm.LeftButton.Text = "Zoom Out"; zoomChoiceForm.RightButton.Text = "Zoom In"; //ref icon: http://www.openclipart.org/detail/38995 zoomChoiceForm.LeftButton.SetIcon("Icons/ZoomOut.png"); //ref icon: http://www.openclipart.org/detail/38989 zoomChoiceForm.RightButton.SetIcon("Icons/ZoomIn.png"); zoomChoiceForm.LeftButton.Click += new EventHandler(LeftButton_Click); zoomChoiceForm.RightButton.Click += new EventHandler(RightButton_Click); zoomChoiceForm.BottomButton.Click += new EventHandler(BottomButton_Click); } return(this.zoomChoiceForm); }
ChoiceForm createChoiceForm() { if (this.choiceForm == null) { choiceForm = new ChoiceForm(ccToolbar, 4, true, true); choiceForm.Label.Text = "Contrast: " + this.contrastValue; //top: cancel choiceForm.SetButtonToCancel(choiceForm.TopButton); choiceForm.LeftButton.Text = "Less"; choiceForm.LeftButton.Click += new EventHandler(LeftButton_Click); choiceForm.RightButton.Text = "More"; choiceForm.RightButton.Click += new EventHandler(RightButton_Click); //bottom: apply choiceForm.SetButtonIconToApply(choiceForm.BottomButton); choiceForm.BottomButton.Click += new EventHandler(ApplyButton_Click); choiceForm.PreviewImage = ccToolbar.CCMainForm.MainImage.ContrastPreview(this.contrastValue); } return(choiceForm); }