private void ButtonInsertPage_Click(object sender, RoutedEventArgs e) { IsChange = true; //先保存当前正在编辑的文档 LPTED.SavePage(NowPage); LPTED.EachPage.Insert(NowPage, new LinePutScript.LpsDocument()); RefreshLeftPanelAll(); MarkLeftPanelColor(); TextBox1.Document.Blocks.Clear(); }
private void ButtonStart_Click(object sender, RoutedEventArgs e) { //先保存当前正在编辑的文档 LPTED.SavePage(NowPage); //将page内容储存到lpt LPTED.Save(); Lineputxaml lineputxaml = new Lineputxaml(LPTED.ToString()); this.Hide(); lineputxaml.ShowDialog(); this.Show(); }
private void ButtonOAFontFamily_Click(object sender, RoutedEventArgs e) { FontDialog fd = new FontDialog(); fd.Font = new Font(LPTED.OADisplay.FontFamily.ToString(), LPTED.OADisplay.FontSize); if (fd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { LPTED.SavePage(NowPage); //先保存 LPTED.OADisplay.FontFamily = new FontFamily(fd.Font.FontFamily.Name); //储存设置 LPTED.OADisplay.FontSize = fd.Font.Size; ButtonOAFontFamily.Content = "字体:" + fd.Font.FontFamily.Name; LPTED.DisplaySource(NowPage);//重新加载 } fd.Dispose(); }
private void ChangeOAFontSize() { if (!float.TryParse(ComboBoxOAFontSize.Text, out float fsize)) { MessageBox.Show("请输入数字", "设置字体大小"); return; } if (LPTED.OADisplay.FontSize.ToString("f1") != fsize.ToString("f1")) { LPTED.SavePage(NowPage);//先保存 //储存设置 LPTED.OADisplay.FontSize = fsize; LPTED.DisplaySource(NowPage); //重新加载 //重新绘制全部图片 RefreshLeftPanelAll(); } }
/// <summary> /// 左侧按钮被选中 /// </summary> /// <param name="sender">按钮</param> /// <param name="e">信息</param> private void Bt_Click(object sender, RoutedEventArgs e) { int chosepage = Convert.ToInt32(((Button)sender).Name.Substring(2)); //MessageBox.Show(chosepage.ToString()); //刷新当前页面 RefreshLeftPanelSingle(); if (NowPage == chosepage) { return; } //储存 LPTED.SavePage(NowPage); //跳转 NowPage = chosepage; MarkLeftPanelColor(); LPTED.DisplaySource(NowPage); }
private void ButtonOAFontColor_Click(object sender, RoutedEventArgs e) { ButtonOAFontColor.IsChecked = false; ColorDialog cd = new ColorDialog(); cd.CustomColors = CustomColors; cd.Color = ColorConvent(LPTED.OADisplay.FontColor); if (cd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { LPTED.SavePage(NowPage);//先保存 LPTED.OADisplay.FontColor = ColorConvent(cd.Color); ButtonOAFontColor.Background = new SolidColorBrush(LPTED.OADisplay.FontColor); LPTED.DisplaySource(NowPage);//重新加载 //重新绘制全部图片 RefreshLeftPanelAll(); } //储存自定义颜色 CustomColors = cd.CustomColors; cd.Dispose(); }