コード例 #1
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.textItText1 = new TextItText(new Point(0, (int)(this.pnlTop.Height)), this);
            this.save_timer  = new Timer();
            this.SuspendLayout();
            //
            // Timer
            //
            save_timer.Interval = 3000;
            save_timer.Tick    += new EventHandler(timer_Tick);
            //
            // textItText1
            //
            this.textItText1.AcceptsReturn = true;
            this.textItText1.BorderStyle   = System.Windows.Forms.BorderStyle.None;
            this.textItText1.Multiline     = true;
            this.textItText1.Name          = "textItText1";
            this.textItText1.Size          = new System.Drawing.Size(147, 30);
            this.textItText1.TabIndex      = 0;
            this.textItText1.Font          = TextStylusModel.GetInstance().DefaultFont;
            this.textItText1.MouseDown    += new System.Windows.Forms.MouseEventHandler(this.textItText1_MouseDown);

            //
            // TextItBox
            //
            this.Controls.Add(this.textItText1);
            this.Name = "TextItBox";
            this.ResumeLayout(false);
            this.PerformLayout();
        }
コード例 #2
0
ファイル: TextItText.cs プロジェクト: zhujingcheng/CP3
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.SuspendLayout();
     //
     // TextItBox
     //
     this.AcceptsReturn = true;
     this.AcceptsTab    = false;
     this.Multiline     = true;
     this.ResumeLayout(false);
     this.AutoSize = true;
     this.Font     = TextStylusModel.GetInstance().DefaultFont;
 }
コード例 #3
0
        /// <summary>
        /// Constructs a default textsheetmodel which has been scaled to fit the current transform
        /// </summary>
        /// <param name="id"></param>
        /// <param name="text"></param>
        /// <param name="editable"></param>
        /// <param name="is_public"></param>
        /// <param name="c"></param>
        /// <param name="untransformed_bounds"></param>
        /// <param name="scale_x"></param>
        /// <param name="scale_y"></param>
        public TextSheetModel(Guid id, string text, SheetDisposition disp, bool editable, bool is_public, Color c, Rectangle untransformed_bounds,
                              float i_scale_x, float i_scale_y) : base(Guid.NewGuid(), editable, 0)
        {
            Rectangle new_bounds = new Rectangle((int)(untransformed_bounds.X * i_scale_x), (int)(untransformed_bounds.Y * i_scale_y),
                                                 (int)(untransformed_bounds.Width * i_scale_x), (int)(untransformed_bounds.Height * i_scale_y));

            using (Synchronizer.Lock(this.SyncRoot)) {
                this.Bounds = new_bounds;
            }
            text_   = text;
            public_ = is_public;
            color_  = c;
            font_   = new Font(TextStylusModel.GetInstance().DefaultFont.Name, (int)(TextStylusModel.GetInstance().DefaultFont.Size));
        }
コード例 #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="model">The presenter model</param>
        public StylusToolBarButtons(PresenterModel model)
        {
            this.m_Model = model;

            // Initialize the stylus models.
            this.m_PenModel         = new PenStylusModel(Guid.NewGuid());
            this.m_HighlighterModel = new PenStylusModel(Guid.NewGuid());
            this.m_EraserModel      = new EraserStylusModel(Guid.NewGuid());
            // Comment out as it is not being used currently
            //this.m_LassoModel = new LassoStylusModel(Guid.NewGuid());
            this.m_ImageModel = new ImageStylusModel(Guid.NewGuid());
            this.m_TextModel  = TextStylusModel.GetInstance();

            this.m_PenAtts         = new DrawingAttributes(Color.Black);
            this.m_HighLighterAtts = new HighlighterDrawingAttributes(Color.Orange);
            this.m_StylusEntrys    = new StylusEntry[][] {
                new StylusEntry[] {
                    new StylusEntry(new DrawingAttributes(Color.Orange), this.m_PenModel, Strings.SelectCustomColorPen, PenType.Pen),
                    new StylusEntry(new HighlighterDrawingAttributes(Color.Pink), this.m_HighlighterModel, Strings.SelectCustomColorHighlighter, PenType.Hightlighter),
                    new StylusEntry(new DrawingAttributes(Color.Orange), this.m_TextModel, Strings.CustomColorText, PenType.Text),
                },
                new StylusEntry[] {
                    new StylusEntry(new DrawingAttributes(Color.Blue), this.m_PenModel, Strings.SelectBluePen, PenType.Pen),
                    new StylusEntry(new HighlighterDrawingAttributes(Color.Cyan), this.m_HighlighterModel, Strings.SelectCyanHighlighter, PenType.Hightlighter),
                    new StylusEntry(new DrawingAttributes(Color.Blue), this.m_TextModel, Strings.BlueText, PenType.Text),
                },
                new StylusEntry[] {
                    new StylusEntry(new DrawingAttributes(Color.Green), this.m_PenModel, Strings.SelectGreenPen, PenType.Pen),
                    new StylusEntry(new HighlighterDrawingAttributes(Color.LawnGreen), this.m_HighlighterModel, Strings.SelectGreenHighlighter, PenType.Hightlighter),
                    new StylusEntry(new DrawingAttributes(Color.Green), this.m_TextModel, Strings.GreenText, PenType.Text),
                },
                new StylusEntry[] {
                    new StylusEntry(new DrawingAttributes(Color.Red), this.m_PenModel, Strings.SelectRedPen, PenType.Pen),
                    new StylusEntry(new HighlighterDrawingAttributes(Color.Magenta), this.m_HighlighterModel, Strings.SelectMagentaHighlighter, PenType.Hightlighter),
                    new StylusEntry(new DrawingAttributes(Color.Red), this.m_TextModel, Strings.RedText, PenType.Text),
                },
                new StylusEntry[] {
                    new StylusEntry(new DrawingAttributes(Color.Yellow), this.m_PenModel, Strings.SelectYellowPen, PenType.Pen),
                    new StylusEntry(new HighlighterDrawingAttributes(Color.Yellow), this.m_HighlighterModel, Strings.SelectYellowHighlighter, PenType.Hightlighter),
                    new StylusEntry(new DrawingAttributes(Color.Yellow), this.m_TextModel, Strings.YellowText, PenType.Text),
                },
                new StylusEntry[] {
                    new StylusEntry(this.m_PenAtts, this.m_PenModel, Strings.SelectBlackPen, PenType.Pen),
                    new StylusEntry(this.m_HighLighterAtts, this.m_HighlighterModel, Strings.SelectOrangeHighlighter, PenType.Hightlighter),
                    new StylusEntry(new DrawingAttributes(Color.Black), this.m_TextModel, Strings.BlackText, PenType.Text),
                },
            };
        }
コード例 #5
0
        /// <summary>
        /// pops up a font dialogue and changes the font.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);
            FontDialog d = new FontDialog();

            d.ShowApply   = true;
            d.ShowColor   = false;
            d.ShowEffects = false;
            d.Font        = TextStylusModel.GetInstance().DefaultFont;
            d.ShowDialog();

            ///pre: we are in text stylus mode
            ///this is ensured by textbutton_.PerformClick()
            using (Synchronizer.Lock(TextStylusModel.GetInstance().SyncRoot)) {
                try {
                    TextStylusModel.GetInstance().Font = d.Font;
                } catch (Exception) {}
            }
        }
コード例 #6
0
 /// <summary>
 /// constructs a default textsheet at the origin, which is by default editable
 /// </summary>
 /// <param name="id"></param>
 /// <param name="bounds"></param>
 public TextSheetModel(Guid id, SheetDisposition disp, Color color) : this(id, null, disp, true, true, new Rectangle(), color, TextStylusModel.GetInstance().DefaultFont)
 {
 }