Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo n.º 5
0
        /// <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);
        }
Ejemplo n.º 6
0
 private void ButtonDeletePage_Click(object sender, RoutedEventArgs e)
 {
     if (LPTED.EachPage.Count == 1)
     {
         MessageBox.Show("最后一页面无法删除", "删除失败");
         return;
     }
     if (MessageBox.Show("确认删除该页面吗,此操作无法撤回", "删除本页面", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
     {
         IsChange = true;
         LPTED.EachPage.RemoveAt(NowPage);
         if (NowPage >= LPTED.EachPage.Count)
         {
             NowPage = LPTED.EachPage.Count - 1;
         }
         RefreshLeftPanelAll();
         MarkLeftPanelColor();
         LPTED.DisplaySource(NowPage);
     }
 }
Ejemplo n.º 7
0
        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();
        }