Exemplo n.º 1
0
        private void cmdPreview_Click(object sender, System.EventArgs e)
        {
            //Preview the defined schedule area
            PrintDialogSettings dialogSettings = new PrintDialogSettings(DateTime.Parse("1/2/2004"), DateTime.Parse("9:00:00 AM"), DateTime.Parse("1/4/2004"), DateTime.Parse("4:00:00 PM"));

            schedule1.GoPreview(dialogSettings);
        }
Exemplo n.º 2
0
        private void cmdPrint_Click(object sender, System.EventArgs e)
        {
            //Print a portion of the schedule
            PrintDialogSettings dialogSettings = new PrintDialogSettings(DateTime.Parse("1/2/2004"), DateTime.Parse("9:00:00 AM"), DateTime.Parse("1/4/2004"), DateTime.Parse("4:00:00 PM"));

            schedule1.GoPrint();
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            PrintDialogSettings settings = new PrintDialogSettings(schedule1.MinDate, schedule1.StartTime, schedule1.MaxDate, schedule1.StartTime.AddHours(schedule1.DayLength));

            settings.PageSettings.Landscape = true;
            schedule1.GoPreview(settings);
        }
Exemplo n.º 4
0
        private void Print_Click(object sender, EventArgs e)
        {
            var settings = new PrintDialogSettings();

            settings.Header = "&b&w&b";
            settings.Footer = "&b&p";
            synBox1.Print(settings);
        }
Exemplo n.º 5
0
 private void tsPrint_Click(object sender, EventArgs e)
 {
     PrintDialogSettings printSettings = new PrintDialogSettings() { ShowPrintPreviewDialog = true};
     if (tabControl1.SelectedIndex == 0)
         txtHost.Print(printSettings);
     else
         txtAsm.Print(printSettings);
 }
Exemplo n.º 6
0
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            var settings = new PrintDialogSettings();

            settings.Title  = template.Name;
            settings.Header = "&b&w&b";
            settings.Footer = "&b&p";
            fctbCode.Print(settings);
        }
Exemplo n.º 7
0
        private void printToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PrintDialogSettings pds = new PrintDialogSettings();

            pds.ShowPrintDialog        = true;
            pds.ShowPrintPreviewDialog = false;
            pds.IncludeLineNumbers     = true;
            fileManager.SelectedFileTab.textBox.Margin = new Padding(10);
            fileManager.SelectedFileTab.textBox.Print(pds);
        }
 private void printToolStripButton_Click(object sender, EventArgs e)
 {
     if (CurrentTB != null)
     {
         var settings = new PrintDialogSettings();
         settings.Title  = tsFiles.SelectedItem.Title;
         settings.Header = "&b&w&b";
         settings.Footer = "&b&p";
         CurrentTB.Print(settings);
     }
 }
 private void printToolStripButton_Click(object sender, EventArgs e)
 {
     if (CurrentTb != null)
     {
         var settings = new PrintDialogSettings
         {
             Title  = tsFiles.SelectedItem.Title,
             Header = "&b&w&b",
             Footer = "&b&p"
         };
         CurrentTb.Print(settings);
     }
 }
Exemplo n.º 10
0
        private void printBtn_Click(object sender, EventArgs e)
        {
            var tb = (customTabControl1.SelectedTab.Controls[0].Controls[0] as FastColoredTextBox);

            if (tb != null)
            {
                var settings = new PrintDialogSettings();
                settings.Title  = customTabControl1.SelectedTab.Text;
                settings.Header = "&b&w&b";
                settings.Footer = "&b&p";
                tb.Print(settings);
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Prints range of text
        /// </summary>
        public static void Print(FastColoredTextBox textbox, Range range, PrintDialogSettings settings)
        {
            //prepare export with wordwrapping
            var exporter = new ExportToHTML();
            exporter.UseBr = true;
            exporter.UseForwardNbsp = true;
            exporter.UseNbsp = true;
            exporter.UseStyleTag = false;
            exporter.IncludeLineNumbers = settings.IncludeLineNumbers;

            if (range == null)
                range = textbox.Range;

            if (range.Text == string.Empty)
                return;

            //change visible range
            textbox.visibleRange = range;
            try
            {
                //call handlers for VisibleRange
                textbox.CallVisibleRangeHandlers();
            }
            finally
            {
                //restore visible range
                textbox.visibleRange = null;
            }

            //generate HTML
            string HTML = exporter.GetHtml(range);
            HTML = "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=UTF-8\"><head><title>" +
                   PrepareHtmlText(settings.Title) + "</title></head>" + HTML + "<br>" + SelectHTMLRangeScript(textbox);
            string tempFile = Path.GetTempPath() + "fctb.html";
            File.WriteAllText(tempFile, HTML);

            //clear wb page setup settings
            SetPageSetupSettings(settings);

            //create wb
            var wb = new WebBrowser();
            wb.Tag = settings;
            wb.Visible = false;
            wb.Location = new Point(-1000, -1000);
            wb.Parent = textbox;
            wb.StatusTextChanged += wb_StatusTextChanged;
            wb.Navigate(tempFile);
        }
Exemplo n.º 12
0
 /// <summary>
 /// Prints all text
 /// </summary>
 public static void Print(FastColoredTextBox textbox, PrintDialogSettings settings)
 {
     Print(textbox, textbox.Range, settings);
 }
Exemplo n.º 13
0
 private static void SetPageSetupSettings(PrintDialogSettings settings)
 {
     RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\PageSetup", true);
     if (key != null)
     {
         key.SetValue("footer", settings.Footer);
         key.SetValue("header", settings.Header);
     }
 }