Exemple #1
0
        public FormInput(string caption, string label, string txt, bool ML, gInk.Root rt = null, Microsoft.Ink.Stroke stk = null)
        {
            InitializeComponent();

            // local
            this.btOK.Text     = rt.Local.ButtonOkText;
            this.btCancel.Text = rt.Local.ButtonCancelText;
            this.FontBtn.Text  = rt.Local.ButtonFontText;
            boxingCb.Items.AddRange(rt.Local.TextFramingText.Split(';'));

            Text            = caption;
            captionLbl.Text = label;
            if (ML)
            {
                InputML.Visible = true;
                InputML.Text    = txt;
                ActiveControl   = InputML;
            }
            else
            {
                InputSL.Visible = true;
                InputSL.Text    = txt;
                ActiveControl   = InputSL;
            }
            Root   = rt;
            stroke = stk;
            if (stroke == null)
            {
                FontBtn.Visible  = false;
                boxingCb.Visible = false;
            }
            else
            {
                FontBtn.Visible  = true;
                ColorBtn.Visible = true;
                boxingCb.Visible = true;// !stk.ExtendedProperties.Contains(Root.ISTAG_GUID);

                FontDlg.Font = new Font((string)stk.ExtendedProperties[Root.TEXTFONT_GUID].Data, (float)stk.ExtendedProperties[Root.TEXTFONTSIZE_GUID].Data,
                                        (System.Drawing.FontStyle)stk.ExtendedProperties[Root.TEXTFONTSTYLE_GUID].Data);
                InputML.TextChanged += new System.EventHandler(this.InputML_TextChanged);
                int i = (stk.ExtendedProperties.Contains(Root.ISSTROKE_GUID) ? 1 : 0) +
                        (stk.ExtendedProperties.Contains(Root.ISFILLEDWHITE_GUID) ? 2 : 0) +
                        (stk.ExtendedProperties.Contains(Root.ISFILLEDBLACK_GUID) ? 4 : 0);
                boxingCb.Text = boxingCb.Items[i].ToString();

                Saved_Txt   = InputML.Text;
                Saved_Da    = stk.DrawingAttributes.Clone();
                Saved_Font  = (Font)FontDlg.Font.Clone();
                Saved_Frame = stk.ExtendedProperties.Contains(Root.ISSTROKE_GUID);
                Saved_White = stk.ExtendedProperties.Contains(Root.ISFILLEDWHITE_GUID);
                Saved_Black = stk.ExtendedProperties.Contains(Root.ISFILLEDBLACK_GUID);
            }
        }
Exemple #2
0
        public FormInput(string caption, string label, string txt, bool ML, gInk.Root rt = null, Microsoft.Ink.Stroke stk = null)
        {
            InitializeComponent();

            // local
            this.btOK.Text     = rt.Local.ButtonOkText;
            this.btCancel.Text = rt.Local.ButtonCancelText;
            this.FontBtn.Text  = rt.Local.ButtonFontText;

            Text            = caption;
            captionLbl.Text = label;
            if (ML)
            {
                InputML.Visible = true;
                InputML.Text    = txt;
                ActiveControl   = InputML;
            }
            else
            {
                InputSL.Visible = true;
                InputSL.Text    = txt;
                ActiveControl   = InputSL;
            }
            Root   = rt;
            stroke = stk;
            if (stroke == null)
            {
                FontBtn.Visible = false;
            }
            else
            {
                FontBtn.Visible  = true;
                ColorBtn.Visible = true;
                FontDlg.Font     = new Font((string)stk.ExtendedProperties[Root.TEXTFONT_GUID].Data, (float)stk.ExtendedProperties[Root.TEXTFONTSIZE_GUID].Data,
                                            (System.Drawing.FontStyle)stk.ExtendedProperties[Root.TEXTFONTSTYLE_GUID].Data);
                InputML.TextChanged += new System.EventHandler(this.InputML_TextChanged);
            }
        }