示例#1
0
        private void ClipBtn_Click(object sender, EventArgs e)
        {
            ImageLister dlg = new ImageLister(Root);

            dlg.FromClpBtn.Visible   = false;
            dlg.LoadImageBtn.Visible = false;
            dlg.DelBtn.Visible       = false;
            dlg.FillingCombo.Visible = false;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                ((Button)sender).BackgroundImage = FormCollection.getImgFromDiskOrRes(dlg.ImageStamp);
                if ((string)(((Control)sender).Tag) == "1")
                {
                    Root.ImageStamp1 = dlg.ImageStamp;
                }
                else if ((string)(((Control)sender).Tag) == "2")
                {
                    Root.ImageStamp2 = dlg.ImageStamp;
                }
                else if ((string)(((Control)sender).Tag) == "3")
                {
                    Root.ImageStamp3 = dlg.ImageStamp;
                }
            }
        }
示例#2
0
 public void Initialize(Stroke st = null)
 {
     ArrowHead_Pnl.BackgroundImage?.Dispose();
     ArrowTail_Pnl.BackgroundImage?.Dispose();
     if (st != null)
     {
         EditStroke      = st;
         ArrowHead       = (string)st.ExtendedProperties[Root.ARROWSTART_FN_GUID].Data;
         ArrowTail       = (string)st.ExtendedProperties[Root.ARROWEND_FN_GUID].Data;
         PrevBtn.Visible = false;
         NextBtn.Visible = false;
         AddBtn.Visible  = false;
         DelBtn.Visible  = false;
         this.Text       = Root.Local.ArrowDlg;
     }
     else
     {
         ArrowHead = Root.ArrowHead[Root.CurrentArrow];
         ArrowTail = Root.ArrowTail[Root.CurrentArrow];
         this.Text = Root.Local.ArrowDlg + string.Format(" - {0}/{1}", Root.CurrentArrow + 1, Root.ArrowHead.Count);
     }
     ArrowHead_Pnl.BackgroundImage = (Image)FormCollection.getImgFromDiskOrRes(ArrowHead).Clone();
     ArrowTail_Pnl.BackgroundImage = (Image)FormCollection.getImgFromDiskOrRes(ArrowTail).Clone();
     ArrowTail_Pnl.BackgroundImage.RotateFlip(RotateFlipType.Rotate180FlipNone);
     SaveBtn.Enabled = false;
 }
示例#3
0
        private void FormOptions_Load(object sender, EventArgs e)
        {
            Root.UnsetHotkey();
            ToolbarDwg.BackColor = Color.FromArgb(Root.ToolbarBGColor[0], Root.ToolbarBGColor[1], Root.ToolbarBGColor[2], Root.ToolbarBGColor[3]);
            ToolbarOrientationBtn.BackgroundImage = ToolBarOrientationIcons[Root.ToolbarOrientation];
            Clip1Btn.BackColor       = ToolbarDwg.BackColor;
            Clip1Btn.BackgroundImage = FormCollection.getImgFromDiskOrRes(Root.ImageStamp1);
            Clip2Btn.BackColor       = ToolbarDwg.BackColor;
            Clip2Btn.BackgroundImage = FormCollection.getImgFromDiskOrRes(Root.ImageStamp2);
            Clip3Btn.BackColor       = ToolbarDwg.BackColor;
            Clip3Btn.BackgroundImage = FormCollection.getImgFromDiskOrRes(Root.ImageStamp3);

            if (Root.EraserEnabled)
            {
                cbEraserEnabled.Checked = true;
            }
            if (Root.PointerEnabled)
            {
                cbPointerEnabled.Checked = true;
            }
            if (Root.SnapEnabled)
            {
                cbSnapEnabled.Checked = true;
            }
            if (Root.UndoEnabled)
            {
                cbUndoEnabled.Checked = true;
            }
            if (Root.ClearEnabled)
            {
                cbClearEnabled.Checked = true;
            }
            WidthAtPenSelCb.Checked = Root.WidthAtPenSel;
            cbWidthEnabled.Checked  = Root.PenWidthEnabled;
            if (Root.PanEnabled)
            {
                cbPanEnabled.Checked = true;
            }
            if (Root.InkVisibleEnabled)
            {
                cbInkVisibleEnabled.Checked = true;
            }
            if (Root.ToolsEnabled)
            {
                cbToolsEnabled.Checked = true;
            }

            if (Root.WhiteTrayIcon)
            {
                cbWhiteIcon.Checked = true;
            }
            if (Root.AllowDraggingToolbar)
            {
                cbAllowDragging.Checked = true;
            }
            if (Root.AllowHotkeyInPointerMode)
            {
                cbAllowHotkeyInPointer.Checked = true;
            }
            cbLoadSaveEnabled.Checked = Root.LoadSaveEnabled;

            AltTabActivateCb.Checked = Root.AltTabPointer;

            ToolBarHeight.Text = string.Format("{0:F1}", Root.ToolbarHeight * 100);
            //MoveToolBarCb.Checked = Root.AllowDraggingToolbar;

            comboCanvasCursor.SelectedIndex = Root.CanvasCursor;

            BoardAtOpenCombo.SelectedIndex = Root.BoardAtOpening;
            BoardCustColorPnl.BackColor    = Color.FromArgb(Root.Gray1[0], Root.Gray1[1], Root.Gray1[2], Root.Gray1[3]);


            tbSnapPath.Text             = Root.SnapshotBasePath;
            this.OpenIntoSnapCb.Checked = Root.OpenIntoSnapMode;
            ShowFloatingWinCb.Checked   = Root.FormOpacity > 0;
            ArrHdAperture.Text          = (Root.ArrowAngle * 180.0 / Math.PI).ToString("#0", CultureInfo.InvariantCulture);
            ArrHdLength.Text            = (Root.ArrowLen / System.Windows.SystemParameters.PrimaryScreenWidth * 100.0).ToString("#0.0000", CultureInfo.InvariantCulture);
            Magnet_TB.Text        = (Root.MagneticRadius / System.Windows.SystemParameters.PrimaryScreenWidth * 100.0).ToString("#0.0000", CultureInfo.InvariantCulture);
            DefArrStartCb.Checked = Root.DefaultArrow_start;

            ZoomWidthEd.Text        = Root.ZoomWidth.ToString();
            ZoomHeightEd.Text       = Root.ZoomHeight.ToString();
            ZoomScaleEd.Text        = Root.ZoomScale.ToString();
            ZoomContinousCb.Checked = Root.ZoomContinous;

            lbNote.ForeColor = Color.Black;

            lbcbPens       = new Label();
            lbcbPens.Left  = (int)(this.Width / 500.0 * 25);
            lbcbPens.Width = 100;
            lbcbPens.Top   = 15;
            tabPage2.Controls.Add(lbcbPens);

            lbpboxPens       = new Label();
            lbpboxPens.Left  = (int)(this.Width / 500.0 * 125);
            lbpboxPens.Width = 60;
            lbpboxPens.Top   = 15;
            tabPage2.Controls.Add(lbpboxPens);

            lbcomboPensAlpha       = new Label();
            lbcomboPensAlpha.Left  = (int)(this.Width / 500.0 * 185);
            lbcomboPensAlpha.Width = 100;
            lbcomboPensAlpha.Top   = 15;
            tabPage2.Controls.Add(lbcomboPensAlpha);

            lbcomboPensWidth       = new Label();
            lbcomboPensWidth.Left  = (int)(this.Width / 500.0 * 275);
            lbcomboPensWidth.Width = 100;
            lbcomboPensWidth.Top   = 15;
            tabPage2.Controls.Add(lbcomboPensWidth);

            lbcomboPensFading          = new Label();
            lbcomboPensFading.Left     = (int)(this.Width / 500.0 * 375);
            lbcomboPensFading.Width    = 100;
            lbcomboPensFading.Top      = 15;
            lbcomboPensFading.AutoSize = true;
            tabPage2.Controls.Add(lbcomboPensFading);

            for (int p = 0; p < Root.MaxPenCount; p++)
            {
                int top = p * (int)(this.Height * 0.075) + (int)(this.Height * 0.09);
                lbPens[p]       = new Label();
                lbPens[p].Left  = (int)(this.Width / 500.0 * 60);
                lbPens[p].Width = 80;
                lbPens[p].Top   = top;

                cbPens[p]                 = new CheckBox();
                cbPens[p].Left            = (int)(this.Width / 500.0 * 30);
                cbPens[p].Width           = 25;
                cbPens[p].Top             = top - 5;
                cbPens[p].Text            = "";
                cbPens[p].Checked         = Root.PenEnabled[p];
                cbPens[p].CheckedChanged += cbPens_CheckedChanged;

                pboxPens[p]           = new PictureBox();
                pboxPens[p].Left      = (int)(this.Width / 500.0 * 130);
                pboxPens[p].Top       = top;
                pboxPens[p].Width     = 15;
                pboxPens[p].Height    = 15;
                pboxPens[p].BackColor = Root.PenAttr[p].Color;
                pboxPens[p].Click    += pboxPens_Click;

                comboPensAlpha[p] = new ComboBox();

                comboPensAlpha[p].Left         = (int)(this.Width / 500.0 * 180);
                comboPensAlpha[p].Top          = top - 2;
                comboPensAlpha[p].Width        = 80;
                comboPensAlpha[p].Text         = (255 - Root.PenAttr[p].Transparency).ToString();
                comboPensAlpha[p].TextChanged += comboPensAlpha_TextChanged;

                comboPensWidth[p] = new ComboBox();

                comboPensWidth[p].Left         = (int)(this.Width / 500.0 * 270);
                comboPensWidth[p].Top          = top - 2;
                comboPensWidth[p].Width        = 80;
                comboPensWidth[p].Text         = ((int)Root.PenAttr[p].Width).ToString();
                comboPensWidth[p].TextChanged += comboPensWidth_TextChanged;

                comboPensFading[p] = new CheckBox();

                comboPensFading[p].Left            = (int)(this.Width / 500.0 * 380);
                comboPensFading[p].Top             = top - 2;
                comboPensFading[p].Width           = 20;
                comboPensFading[p].Checked         = Root.PenAttr[p].ExtendedProperties.Contains(Root.FADING_PEN);
                comboPensFading[p].CheckedChanged += comboPensFading_Changed;

                tabPage2.Controls.Add(lbPens[p]);
                tabPage2.Controls.Add(cbPens[p]);
                tabPage2.Controls.Add(pboxPens[p]);
                tabPage2.Controls.Add(comboPensAlpha[p]);
                tabPage2.Controls.Add(comboPensWidth[p]);
                tabPage2.Controls.Add(comboPensFading[p]);
            }

            FadingTimeEd.Text = Root.TimeBeforeFading.ToString();

            cbAllowHotkeyInPointer.Top = (int)(this.Height * 0.18);

            for (int p = 0; p < Root.MaxPenCount; p++)
            {
                int top = p * (int)(this.Height * 0.055) + (int)(this.Height * 0.24);
                lbHotkeyPens[p]       = new Label();
                lbHotkeyPens[p].Left  = 20;
                lbHotkeyPens[p].Width = 80;
                lbHotkeyPens[p].Top   = top;

                hiPens[p]                  = new HotkeyInputBox();
                hiPens[p].Hotkey           = Root.Hotkey_Pens[p];
                hiPens[p].Left             = 100;
                hiPens[p].Width            = 120;
                hiPens[p].Top              = top;
                hiPens[p].OnHotkeyChanged += hi_OnHotkeyChanged;

                tabPage3.Controls.Add(lbHotkeyPens[p]);
                tabPage3.Controls.Add(hiPens[p]);
            }

            AltAsOneCommandCb.Checked = Root.AltAsOneCommand;

            hiGlobal.Hotkey     = Root.Hotkey_Global;
            hiEraser.Hotkey     = Root.Hotkey_Eraser;
            hiPan.Hotkey        = Root.Hotkey_Pan;
            hiInkVisible.Hotkey = Root.Hotkey_InkVisible;
            hiPointer.Hotkey    = Root.Hotkey_Pointer;
            hiSnapshot.Hotkey   = Root.Hotkey_Snap;
            hiUndo.Hotkey       = Root.Hotkey_Undo;
            hiRedo.Hotkey       = Root.Hotkey_Redo;
            hiClear.Hotkey      = Root.Hotkey_Clear;
            hiVideo.Hotkey      = Root.Hotkey_Video;
            hiDockUndock.Hotkey = Root.Hotkey_DockUndock;
            hiClose.Hotkey      = Root.Hotkey_Close;

            hiToolHand.Hotkey     = Root.Hotkey_Hand;
            hiToolLine.Hotkey     = Root.Hotkey_Line;
            hiToolRect.Hotkey     = Root.Hotkey_Rect;
            hiToolOval.Hotkey     = Root.Hotkey_Oval;
            hiToolArrow.Hotkey    = Root.Hotkey_Arrow;
            hiToolNumb.Hotkey     = Root.Hotkey_Numb;
            HiToolText.Hotkey     = Root.Hotkey_Text;
            hiToolEdit.Hotkey     = Root.Hotkey_Edit;
            hiToolMagnet.Hotkey   = Root.Hotkey_Magnet;
            hiToolClipArt.Hotkey  = Root.Hotkey_ClipArt;
            hiToolClipArt1.Hotkey = Root.Hotkey_ClipArt1;
            hiToolClipArt2.Hotkey = Root.Hotkey_ClipArt2;
            hiToolClipArt3.Hotkey = Root.Hotkey_ClipArt3;
            hiZoom.Hotkey         = Root.Hotkey_Zoom;

            WsUrlTxt.Text     = Root.ObsUrl;
            WsPwdTxt.Text     = Root.ObsPwd;
            FfmpegCmdTxt.Text = Root.FFMpegCmd;
            switch (Root.VideoRecordMode)
            {
            case VideoRecordMode.NoVideo:
                OptNoVideo.Checked = true;
                break;

            case VideoRecordMode.OBSRec:
                OptObsRecord.Checked = true;
                break;

            case VideoRecordMode.OBSBcst:
                OptObsBcast.Checked = true;
                break;

            case VideoRecordMode.FfmpegRec:
                OptFfmpeg.Checked = true;
                break;

            default:
                throw new System.Exception(String.Format("unk video recording mode", Root.VideoRecordMode));
            }

            FormOptions_LocalReload();
        }
示例#4
0
 public CallForm(Root r)
 {
     InitializeComponent();
     Root    = r;
     backImg = FormCollection.getImgFromDiskOrRes("FloatingCall");
 }