private void button1_Click(object sender, EventArgs e) { if (messageTextBox.Visible) { if (handw == null) { handw = new Handwriting(); handw.Parent = this.splitContainer2.Panel2; handw.Bounds = messageTextBox.Bounds; handw.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; handw.sendbtn.Text = Language.Translate(Language.StringID.Sendbtn_Send, handw.sendbtn); handw.sendbtn.Click += Handw_sendbtn_Click; } else { handw.Show(); } messageTextBox.Hide(); } else { handw.Hide(); messageTextBox.Show(); } }
public VirtualPaperUI(Program p) : base("Virtual Paper", "Virtual Paper") { program = p; DeleteEvent += new DeleteEventHandler(HandleDelete); handwriting = new Handwriting(); ui.AddUiFromResource("UILayout.xml"); PopulateActionGroups(); Menus = ui.GetWidget("/MainMenu") as MenuBar; Toolbar = TB = ui.GetWidget("/ControlBar") as Toolbar; AddColorToolButton(); Contents = handwriting; handwriting.PaperColor = Handwriting.White; handwriting.Changed += delegate { updateUndo(); }; updateUndo(); ShowAll(); program.Run(); }
private void Form1_Load(object sender, EventArgs e) { // Form initialisation: graphics bmp = new Bitmap(100, 100); using (Graphics bmpG = Graphics.FromImage(bmp)) { bmpG.Clear(backgroundColor); } pictureBox1Graphics = pictureBox1.CreateGraphics(); // Recognition library initialisation: handwritingRecObj = new Handwriting(bmp.Width * bmp.Height); // Input data manipulator dataManipulator = new DataManipulator(); info("Application started."); }
void OnMenuItemActivated(object sender, EventArgs args) { // Insert a new Sketching Widget at the current cursor position SketchingTextTag tag = (SketchingTextTag) Note.TagTable.CreateDynamicTag("sketch"); // FIXME: Create a dynamic name for a sketch file that will // be stored in the note's attachments directory. tag.Uri = "test"; Handwriting h = new Handwriting(new Paper(new Cairo.Color(1.0, 1.0, 1.0, 1.0))); h.SetSizeRequest(500, 500); tag.Widget = h; // Insert the sketch tag at the current cursor position Gtk.TextIter cursor = Buffer.GetIterAtMark(Buffer.InsertMark); Gtk.TextTag[] tags = { tag }; Buffer.InsertWithTags(ref cursor, String.Empty, tags); }