Exemplo n.º 1
0
        public Form1(string[] args)
        {
            singleton = this;
            InitializeComponent();
            progress = new RenderingProgress(this);

            // Init scenes etc.
            FormSupport.InitializeScenes(args, out string name);

            Text     += @" (" + rev + @") '" + name + '\'';
            formTitle = Text;
            SetWindowTitleSuffix(" Zoom: 100%");

            SetOptions(args);
            buttonRes.Text = FormResolution.GetLabel(ref ImageWidth, ref ImageHeight);

            // Placeholder image for PictureBox.
            Image image = Resources.CGG_Logo;

            additionalViews = new AdditionalViews(collectDataCheckBox, Notification);

            additionalViews.Initialize();
            // Makes all maps to initialize again.
            additionalViews.SetNewDimensions(ImageWidth, ImageHeight);

            // Default PaZ button = Right.
            panAndZoom = new PanAndZoomSupport(pictureBox1, image, SetWindowTitleSuffix)
            {
                Button = MouseButtons.Right
            };

            rayVisualizer = new RayVisualizer();
        }
Exemplo n.º 2
0
        public AdditionalViews(CheckBox collectDataCheckBox, Action <string, string, int> notification)
        {
            this.collectDataCheckBox = collectDataCheckBox;
            this.notification        = notification;

            singleton = this;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor which sets location of Form1 window and initializes AdditionalViews class
        /// </summary>
        public AdditionalViewsForm(
            AdditionalViews additionalViews,
            Form otherForm)
        {
            singleton = this;

            this.additionalViews = additionalViews;
            additionalViews.form = this;

            InitializeComponent();

            SetFormPosition(otherForm);

            if (additionalViews.mapsEmpty ||
                MT.renderingInProgress)
            {
                RenderButtonsEnabled(false);
                ExportDataButtonsEnabled(false);
            }
            else
            {
                RenderButtonsEnabled(true);
                ExportDataButtonsEnabled(true);
            }

            panAndZoomControls = new PanAndZoomSupport[MapsTabControl.TabCount];

            for (int i = 0; i < MapsTabControl.TabCount; i++)
            {
                bool condition(Control c) => c.Name.Contains("PictureBox") && c.GetType() == typeof(PictureBox);

                PictureBox pictureBox = FindAllControls(condition, MapsTabControl.TabPages [i])[0] as PictureBox;
                pictureBox.MouseWheel += new MouseEventHandler(pictureBox_MouseWheel);
                pictureBox.SizeMode    = PictureBoxSizeMode.Zoom;

                panAndZoomControls[i] = new PanAndZoomSupport(pictureBox, null, SetWindowTitleSuffix)
                {
                    Button = MouseButtons.Right
                };
            }

            newImageAvailable = new bool[MapsTabControl.TabCount];

            for (int i = 0; i < newImageAvailable.Length; i++)
            {
                newImageAvailable[i] = true;
            }

            KeyPreview = true;
        }
Exemplo n.º 4
0
 public AdditionalViewsForm(AdditionalViews additionalViews)
 {
     this.additionalViews = additionalViews;
 }