Пример #1
0
 void MnuScrollBarClick(object sender, EventArgs e)
 {
     if (mnuScrollBar.Checked == true)
     {
         mnuScrollBar.Checked = false;
     }
     else
     {
         mnuScrollBar.Checked = true;
     }
     m_Image.ScollbarVis(mnuScrollBar.Checked);
 }
Пример #2
0
        void FrmMainShown(object sender, EventArgs e)
        {
            Form fm = this;

            m_Image = new frmImage(fm, WinType.normal);
            m_Image.StatusChanged  += new HandleStatusMainChange(HandleStatus);
            m_Image.WindowChanged  += new HandleWindowMainChange(HandleWindow);
            m_Image.WindowSize     += new HandleWindowSize(HandleSize);
            m_Image.CommandChanged += new HandleCommandChange(HandleCommand);

            m_Image.Show(dockPanel1, DockState.Document);                  // sequence of tabs
            m_ExifDash = new ExifDash();
            m_ExifDash.StatusChanged  += new HandleStatusMainChange(HandleStatus);
            m_ExifDash.WindowSize     += new HandleWindowSize(HandleSize);
            m_ExifDash.CommandChanged += new HandleCommandChange(HandleCommand);
            //m_Image.Show(dockPanel1, DockState.Document);     // set active

            bool doShow = true;

            if (Control.ModifierKeys == Keys.Control)               // ctrl
            {
                doShow = false;
                //Debug.WriteLine(" key control ");
            }

            string firstImage = "";

            string[] args = Environment.GetCommandLineArgs();
            if (args.Length > 1)
            {
                firstImage = args[1];
            }
            if (File.Exists(firstImage))
            {
                //Debug.WriteLine("Image command line: " + firstImage);
                m_Image.PicScan(firstImage, false, 0);
                if (doShow)
                {
                    m_Image.PicLoadPos(firstImage, true);
                    recentItem1.AddRecentItem(firstImage);
                }
                else
                {
                    _currentPath = firstImage;
                }
            }
            else if (File.Exists(Settings.Default.LastImage))
            {
                //Debug.WriteLine("Last image settings: " + Settings.Default.LastImage);
                m_Image.PicScan(Settings.Default.LastImage, false, 0);
                if (doShow)
                {
                    m_Image.PicLoadPos(Settings.Default.LastImage, true);
                }
                else
                {
                    _currentPath = Settings.Default.LastImage;
                }
            }
            else
            {
                string userImagePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Pictures";
                if (Directory.Exists(userImagePath))
                {
                    m_Image.PicScan(userImagePath, true, 0);
                }
                firstImage = Directory.GetCurrentDirectory() + @"\Next-View-0.7.jpg";
                recentItem1.AddRecentItem(firstImage);
                if (doShow)
                {
                    m_Image.PicLoadPos(firstImage, true);
                }
                else
                {
                    _currentPath = firstImage;
                }
                //Debug.WriteLine("Default image: " + _currentPath);
            }
            m_Image.ScollbarVis(true);
        }