예제 #1
0
        internal SaveViewForm(string strConfigDir, Image preview)
        {
            InitializeComponent();
            m_strConfigDir = strConfigDir;

            m_fEditControl = null;
            try
            {
                // We pick up and serialize the path to the same cfg file as for the open dialog
                if (File.Exists(Path.Combine(strConfigDir, "viewhistory.cfg")))
                {
                    m_fOpenEditControl = FEditControl.DeSerialize(Path.Combine(strConfigDir, "viewhistory.cfg"));
                }
                else
                {
                    m_fOpenEditControl              = new Geosoft.OpenGX.UtilityForms.FEditControl();
                    m_fOpenEditControl.BrowseQuery  = "Open Dapple View";
                    m_fOpenEditControl.FileOpenSave = Geosoft.OpenGX.UtilityForms.FileOpenSaveEnum.Open;
                    m_fOpenEditControl.FilterIndex  = 1;
                    m_fOpenEditControl.Filters      = "Dapple View files (*.dapple)|*.dapple";
                }
            }
            catch
            {
                try
                {
                    File.Delete(Path.Combine(strConfigDir, "viewhistory.cfg"));
                }
                catch
                {
                }
            }
            m_fEditControl              = new Geosoft.OpenGX.UtilityForms.FEditControl();
            m_fEditControl.FilterIndex  = 1;
            m_fEditControl.BrowseQuery  = "Save Dapple View as...";
            m_fEditControl.FileOpenSave = Geosoft.OpenGX.UtilityForms.FileOpenSaveEnum.Save;
            m_fEditControl.Filters      = "Dapple View files (*.dapple)|*.dapple";
            m_fEditControl.Required     = true;
            m_fEditControl.MaxHistory   = 0;
            m_fEditControl.Anchor       = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                                                                                | System.Windows.Forms.AnchorStyles.Right)));
            m_fEditControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            m_fEditControl.Font         = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            m_fEditControl.Location     = new System.Drawing.Point(47, 356);
            m_fEditControl.MaximumSize  = new System.Drawing.Size(400, 21);
            m_fEditControl.MinimumSize  = new System.Drawing.Size(50, 21);
            m_fEditControl.Name         = "fEditControl";
            m_fEditControl.Size         = new System.Drawing.Size(202, 21);
            m_fEditControl.TabIndex     = 0;

            if (m_fOpenEditControl != null)
            {
                m_fEditControl.InitialDirectory = m_fOpenEditControl.InitialDirectory;
            }
            this.Controls.Add(m_fEditControl);


            this.Icon    = new System.Drawing.Icon(@"app.ico");
            m_imgPreview = preview;
        }
예제 #2
0
        internal ViewOpenDialog(string strConfigDir)
        {
            InitializeComponent();
            this.Icon      = new System.Drawing.Icon(@"app.ico");
            m_strConfigDir = strConfigDir;

            m_fEditControl = null;
            try
            {
                if (File.Exists(Path.Combine(strConfigDir, "viewhistory.cfg")))
                {
                    m_fEditControl = FEditControl.DeSerialize(Path.Combine(strConfigDir, "viewhistory.cfg"));
                }
            }
            catch
            {
            }
            if (m_fEditControl == null)
            {
                m_fEditControl              = new Geosoft.OpenGX.UtilityForms.FEditControl();
                m_fEditControl.BrowseQuery  = "Open Dapple View";
                m_fEditControl.FileOpenSave = Geosoft.OpenGX.UtilityForms.FileOpenSaveEnum.Open;
                m_fEditControl.FilterIndex  = 1;
                m_fEditControl.Filters      = "Dapple View files (*.dapple)|*.dapple";
            }

            m_fEditControl.Anchor            = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            m_fEditControl.AutoSizeMode      = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            m_fEditControl.Font              = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            m_fEditControl.Location          = new System.Drawing.Point(68, 456);
            m_fEditControl.MaximumSize       = new System.Drawing.Size(400, 21);
            m_fEditControl.MinimumSize       = new System.Drawing.Size(50, 21);
            m_fEditControl.Name              = "fEditControl";
            m_fEditControl.Size              = new System.Drawing.Size(180, 21);
            m_fEditControl.TabIndex          = 8;
            m_fEditControl.MaxHistory        = 10;
            m_fEditControl.Required          = true;
            m_fEditControl.FEditTextChanged += new Geosoft.OpenGX.UtilityForms.FEditControl.FEditTextChangedEventHandler(FEditTextChanged);
            this.Controls.Add(m_fEditControl);

            string strPath = "";

            m_fEditControl.GetFilePath(ref strPath);
            if (strPath.Length > 0)
            {
                ValidateView(strPath);
            }
        }
예제 #3
0
        internal ExportView(string strConfigDir, string strInitialFolder)
        {
            InitializeComponent();
            m_strConfigDir = strConfigDir;

            if (String.IsNullOrEmpty(strInitialFolder))
            {
                strInitialFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            }

            FEditControl m_fEditControl = null;

            try
            {
                if (File.Exists(Path.Combine(strConfigDir, "exporthistory.cfg")))
                {
                    m_fEditControl = FEditControl.DeSerialize(Path.Combine(strConfigDir, "exporthistory.cfg"));
                }
            }
            catch
            {
            }
            if (m_fEditControl == null)
            {
                cFilenameControl.FileName         = String.Empty;
                cFilenameControl.InitialDirectory = strInitialFolder;
            }
            else
            {
                cFilenameControl.FileName         = m_fEditControl.FileName;
                cFilenameControl.InitialDirectory = m_fEditControl.InitialDirectory;
            }

            cFilenameControl.Name    = "fEditControl";
            cFilenameControl.Filters = "GeoTIFF(*.tif)|*.tif";
        }