private void Preview()
        {
            // Hide preview panel mechanics
            // Making sure that UpdatePanels doesn't get called when it's hidden!

            if (showPreview != pbPanel.Visible)
            {
                if (showPreview == false)
                {
                    panelPreview.Hide();
                    pbPanel.Hide();

                    pbFull.Width = pbFull.Width + (4 + panelPreview.Width);

                    if (drawing.MultiPage)
                    {
                        panelNavigation.Location = panelPreview.Location;
                    }
                    else
                    {
                        panelMenu.Width = pbFull.Width;
                    }

                    InitControl();
                    drawing.AvoidOutOfScreen();
                    pbFull.Refresh();
                }
                else
                {
                    panelPreview.Show();
                    pbPanel.Show();

                    pbFull.Width = pbFull.Width - (4 + panelPreview.Width);

                    if (drawing.MultiPage)
                    {
                        panelNavigation.Location = new Point(panelPreview.Location.X, (pbPanel.Location.Y + (pbPanel.Size.Height + 5)));
                    }
                    else
                    {
                        panelMenu.Width = pbFull.Width;
                    }

                    InitControl();
                    drawing.AvoidOutOfScreen();
                    pbFull.Refresh();

                    UpdatePanels(true);
                }
            }
        }
Beispiel #2
0
        //private void ToggleMultiPage()
        //{
        //    if (drawing.MultiPage)
        //    {
        //        if (!showPreview)
        //        {
        //            panelNavigation.Location = panelPreview.Location;

        //            panelMenu.Width = panelPreview.Right - 2 - (4 + panelPreview.Width);
        //            pbFull.Width = panelPreview.Right - 2;
        //        }
        //        else
        //        {
        //            panelNavigation.Location = new Point(panelPreview.Location.X, (pbPanel.Location.Y + (pbPanel.Size.Height + 5)));

        //            panelMenu.Width = panelPreview.Right - 2 - (4 + panelPreview.Width);
        //            pbFull.Width = panelPreview.Right - 2 - (4 + panelPreview.Width);
        //        }

        //        panelNavigation.Show();
        //        lblNavigation.Text = "/ " + drawing.Pages.ToString();
        //        tbNavigation.Text = (drawing.CurrentPage + 1).ToString();
        //    }
        //    else
        //    {
        //        if (!showPreview)
        //        {
        //            panelMenu.Width = panelPreview.Right - 2;
        //        }
        //        else
        //        {
        //            panelMenu.Width = pbFull.Width;
        //        }

        //        panelNavigation.Hide();
        //        lblNavigation.Text = "/ 0";
        //        tbNavigation.Text = "0";
        //    }
        //}

        private void KP_ImageViewerV2_Resize(object sender, EventArgs e)
        {
            InitControl();
            drawing.AvoidOutOfScreen();
            UpdatePanels(true);
        }