public DlgFavoritesOrganize(CameraManager cameraManager) { m_cameraManager = cameraManager; InitializeComponent(); makeFavoritesDataSet(); makeDataGridTableStyle(); int id = 0; foreach(CamPos camPos in Project.favorites) { GeoCoord loc = new GeoCoord(camPos); string sLoc = loc.ToString() + " / " + loc.heightToString(); object[] values = new Object[7]; values[0] = camPos.Name; values[1] = camPos.Lat; values[2] = camPos.Lng; values[3] = camPos.Elev; values[4] = sLoc; values[5] = id++; values[6] = camPos.Type; favoritesDataSet.Tables["favoritesTable"].LoadDataRow(values, true); } favoritesDataGrid.TableStyles.Add(this.dataGridTableStyle); favoritesDataGrid.SetDataBinding(favoritesDataSet, "favoritesTable"); //no adding of new rows thru dataview... CurrencyManager cm = (CurrencyManager)this.BindingContext[favoritesDataGrid.DataSource, favoritesDataGrid.DataMember]; ((DataView)cm.List).AllowNew = false; Project.setDlgIcon(this); }
public LayerWaypoints(PictureManager pm, CameraManager cm) : base(pm, cm) { WaypointsCache.PictureManager = pm; WaypointsCache.CameraManager = cm; WaypointsCache.init(); This = this; }
public LayerCustomMaps(PictureManager pm, CameraManager cm) : base(pm, cm) { This = this; CustomMapsCache.DynamicObjectCreateCallback += new DynamicObjectCreateHandler(CustomMapCreateHandler); CustomMapsCache.DynamicObjectDeleteCallback += new DynamicObjectDeleteHandler(CustomMapDeleteHandler); CustomMapsCache.DynamicObjectMoveCallback += new DynamicObjectMoveHandler(CustomMapMoveHandler); CustomMapsCache.init(); }
public LayerEarthquakes(PictureManager pm, CameraManager cm) : base(pm, cm) { EarthquakesCache.PictureManager = pm; EarthquakesCache.CameraManager = cm; EarthquakesCache.DynamicObjectCreateCallback += new DynamicObjectCreateHandler(EarthquakeCreateHandler); EarthquakesCache.DynamicObjectDeleteCallback += new DynamicObjectDeleteHandler(EarthquakeDeleteHandler); EarthquakesCache.DynamicObjectMoveCallback += new DynamicObjectMoveHandler(EarthquakeMoveHandler); EarthquakesCache.init(); This = this; }
public DlgEditWaypoint(CameraManager cameraManager, Waypoint wpt) : base(cameraManager) { m_wpt = wpt; if(m_wpt.TrackId == -1) { this.Text = "Edit Waypoint"; elevLabel.Text = "Elevation:"; } else { elevLabel.Text = "Altitude:"; Track trk = (Track)Project.mainCommand.getTrackById(m_wpt.TrackId); if(trk != null) { if(trk.isRoute) { this.Text = "Edit Route Point"; } else { this.Text = "Edit Trackpoint"; } } } GeoCoord location = m_wpt.Location; setCoordFields(location); setFormFields(); Project.setDlgIcon(this); if(waypointNameTextBox.Enabled) { waypointNameTextBox.Focus(); } else { urlNameTextBox.Focus(); } }
public FindForm(CameraManager cameraManager, bool firstTime) { m_cameraManager = cameraManager; m_firstTime = firstTime; // // Required for Windows Form Designer support // InitializeComponent(); goButton.Enabled = false; findTextBox.Text = Project.findKeyword; if(m_firstTime) { goButton.Text = "Continue"; goFind(); } Project.setDlgIcon(this); }
public GotoForm(CameraManager cameraManager) { m_cameraManager = cameraManager; // // Required for Windows Form Designer support // InitializeComponent(); waypointTypeComboBox.Items.Add("user waypoint"); waypointTypeComboBox.Items.Add("geocache"); waypointTypeComboBox.Items.Add("geocache found"); waypointTypeComboBox.SelectedIndex = 0; moveCameraCheckBox.Checked = true; setCoordTextBoxes(); goButton.Select(); goButton.Focus(); Project.setDlgIcon(this); }
public DlgMakeWaypoint(CameraManager cameraManager) { m_cameraManager = cameraManager; InitializeComponent(); // the time picker comes inactive, but if activated by button - current time will be displayed. timePicker = new MyTimePicker(); timePicker.Location = new System.Drawing.Point(88, 136); timePicker.TabIndex = 6; this.Controls.Add(timePicker); waypointTypeComboBox.Items.Add("user waypoint"); waypointTypeComboBox.Items.Add("geocache"); waypointTypeComboBox.Items.Add("geocache found"); waypointTypeComboBox.SelectedIndex = 0; }
public LayerTerraserver(PictureManager pm, CameraManager cm) : base(pm, cm) { }
public TileSetTerra(PictureManager pm, CameraManager cm) : base(pm, cm) { TerraserverCache.PictureManager = pm; TerraserverCache.CameraManager = cm; if(This == null) { This = this; // let camera manager and others use coordinate transformers TerraserverCache.init(); } else { m_isSecond = true; // we are topo when the first one is aerial/color } m_font = Project.getLabelFont(m_fontSize); m_evalWordLength = m_evalWord.Length; m_opacity = 0; }
private void MainForm_Load(object sender, System.EventArgs e) { LibSys.StatusBar.WriteLine("On Load"); this.hintsLabel.Text = "Mouse tips:\n\n" + " double click - to recenter\n" + " drag and click inside - to zoom\n" + " right click on map for more options\n" + " press F1 for Help\n" + " check out Help->Sample Files menu\n"; #if !DEBUG //gridCheckBox.Visible = false; vehCheckBox.Visible = false; #endif Project.favoritesFirstIndex = this.favMainMenuItem.MenuItems.Count; Project.recentFilesFirstIndex = this.fileMainMmenuItem.MenuItems.Count; Project.toolsFirstIndex = this.toolsMainMenuItem.MenuItems.Count; backLinkLabel.Enabled = false; forwardLinkLabel.Enabled = false; ProgressMonitor.Indicator = progressButton; progressButton.Text = ""; this.Text = Project.PROGRAM_NAME_HUMAN; //this.hintsPanel.BackColor = System.Drawing.Color.FromArgb(255, Color.Navy); if(m_firstTime) { this.notAssociatedButton.Visible = true; this.notAssociatedLabel.Visible = true; } else { // first time the greeting does not start, so HideGreeting will not set hintsPanel to visible this.hintsPanel.Visible = Project.showHelpAtStart && !hintsPanelClicked; } // good place to have camera coordinates set here, if supplied in command line: // /lat=34.123 /lon=-117.234 /elev=5000 /map=aerial (topo,color) processArgs(); // we need it as early as possible, before first web load - TileCache.init(Project.CGIBINPTR_URL) below - occured. Project.ApplyGlobalHTTPProxy(false); if(Project.mainFormMaximized) { this.WindowState = System.Windows.Forms.FormWindowState.Maximized; } else if(Project.fitsScreen(Project.mainFormX, Project.mainFormY, Project.mainFormWidth, Project.mainFormHeight) && Project.mainFormWidth > 300 && Project.mainFormHeight > 200) { this.Location = new Point(Project.mainFormX, Project.mainFormY); this.ClientSize = new System.Drawing.Size(Project.mainFormWidth, Project.mainFormHeight); // causes Resize() //this.Bounds = new System.Drawing.Rectangle(Project.mainFormX, Project.mainFormY, Project.mainFormWidth, Project.mainFormHeight); } reliefCheckBox.Checked = Project.drawRelief; overlayCheckBox.Checked = Project.terraUseOverlay; gridCheckBox.Enabled = Project.drawRelief || Project.drawTerraserver; citiesCheckBox.Enabled = Project.drawRelief; gridCheckBox.Checked = Project.drawGrid; if(Project.drawTerraserver) { if(Project.drawTerraserverMode.Equals("aerial")) { aerialCheckBox.Checked = true; } else if(Project.drawTerraserverMode.Equals("color aerial")) { colorAerialCheckBox.Checked = true; } else if(Project.drawTerraserverMode.Equals("topo")) { topoCheckBox.Checked = true; overlayCheckBox.Enabled = false; } lmCheckBox.Enabled = true; } else { Project.terraserverAvailable = false; aerialCheckBox.Checked = false; colorAerialCheckBox.Checked = false; topoCheckBox.Checked = false; lmCheckBox.Enabled = false; } //opacityPanel.Visible = Project.drawTerraserver; citiesCheckBox.Checked = Project.drawCities; lmCheckBox.Checked = Project.drawLandmarks; eqCheckBox.Checked = Project.drawEarthquakes; eqStylePanelVisible(Project.drawEarthquakes); wptCheckBox.Checked = Project.drawWaypoints; vehCheckBox.Checked = Project.drawVehicles; TileCache.init(Project.CGIBINPTR_URL); // try to reach the QuakeMap server if(TileCache.ZipcodeServer == null) { setInternetAvailable(false); this.hintsLabel.Text = "\n[offline]\n\nuse Internet-->Offline\n or Map-->Options-->Proxy menu\nif you think you should be connected\n "; string message = "\nWarning: couldn't reach server: " + Project.PROGRAM_MAIN_SERVER + "\n\nWorking offline.\n "; if(m_greetingForm == null) { Project.ErrorBox(null, message); } else { Point popupOffset = new Point(34, 230); Point screenPoint = m_greetingForm.PointToScreen(popupOffset); Project.ShowPopup (m_greetingForm, message, screenPoint); } } else { setInternetAvailable(true); } m_cameraTrack = new CameraTrack(); m_cameraManager = new CameraManager(this, m_cameraTrack); m_pictureManager = new PictureManager(mainPictureBox, this, m_cameraTrack); m_cameraManager.init(m_pictureManager); m_pictureManager.init(m_cameraManager); if(Project.hasOldTerrafolderStyleFiles()) { HideGreeting(); Project.AttemptTerrafolderMigration(); } findLinkLabel.Focus(); // on the very first run, bring up "Find by zipcode" window and try positioning // the map there: if(m_firstTime && TileCache.ZipcodeServer != null) { Project.findKeyword = Project.zipcode; FindForm findForm = new FindForm(m_cameraManager, true); findForm.ShowDialog(); } LibSys.StatusBar.WriteLine("IP: running init thread"); //add dt worker method to the thread pool / queue a task //Project.threadPool.PostRequest (new WorkRequestDelegate (runInit), "MainForm init"); //ThreadPool2.QueueUserWorkItem(new WaitCallback (runInit), "MainForm init"); runInit("MainForm init"); //ThreadPool2.QueueUserWorkItem(new WaitCallback (timeEater), "MainForm timeEater"); periodicMaintenanceTimer = new System.Windows.Forms.Timer(); periodicMaintenanceTimer.Interval = 1200; periodicMaintenanceTimer.Tick += new EventHandler(periodicMaintenance); periodicMaintenanceTimer.Start(); LibSys.StatusBar.WriteLine("OK: Maintenance ON"); if(!Project.showHelpAtStart) { if(!hasShownUpdateForm && Project.upgradeMessage.Length > 0) { hasShownUpdateForm = true; new DlgUpgradeMessage(Project.upgradeMessage).ShowDialog(); } } inResize = false; LibSys.StatusBar.WriteLine("On Load done"); }
public DlgGpsManager(GpsInsertWaypoint insertWaypoint, CameraManager cameraManager, PictureManager pictureManager, ArrayList waypoints, ArrayList routes, string command) { //LibSys.StatusBar.Trace("DlgGpsManager()"); if(isUp) { // duplicate for this instance stays true, so that all functions are disabled // and the form will be closed on load. this.duplicate = true; this.Load += new System.EventHandler(this.DlgGpsManager_Load); // we will close this instance on load } else { This = this; duplicate = false; m_insertWaypoint = insertWaypoint; m_cameraManager = cameraManager; m_pictureManager = pictureManager; m_waypoints = waypoints == null ? WaypointsCache.WaypointsAll : waypoints; m_routes = routes == null ? WaypointsCache.RoutesAll : routes; m_command = command; // // Required for Windows Form Designer support // InitializeComponent(); this.SuspendLayout(); populateGpsPanel(); //#if DEBUG // Project.gpsLogProtocol = true; // Project.gpsLogPackets = true; // Project.gpsLogErrors = true; //#else Project.gpsLogProtocol = false; Project.gpsLogPackets = false; Project.gpsLogErrors = false; //#endif Project.setDlgIcon(this); //LibSys.StatusBar.Trace("DlgGpsManager() done"); m_initialColor = gpsBasicsGroupBox.BackColor; gpsBasicsGroupBox.BackColor = Color.Yellow; gpsBasicsGroupBox.Text = "stopped"; progressDetailDelta = progressGroupBox.Height; maxShrinkDelta = progressDetailDelta + Math.Abs(this.PointToScreen(progressDetailButton.Bounds.Location).Y - this.PointToScreen(shrinkMaxButton.Bounds.Location).Y) - slopeLabel.Height; this.ResumeLayout(true); } }
public TileSet(PictureManager pm, CameraManager cm) : base(pm, cm) { }
public Layer(PictureManager pm, CameraManager cm) { m_pictureManager = pm; m_cameraManager = cm; }
public void init(CameraManager cm) { m_cameraManager = cm; m_layersManager = new LayersManager(this); LayerBasicMap lbm = new LayerBasicMap(this, cm); if(!Project.drawRelief) { lbm.Enabled = false; } m_layersManager.Add(lbm); LayerTerraserver lts = new LayerTerraserver(this, cm); if(!Project.drawTerraserver) { lts.Enabled = false; } m_layersManager.Add(lts); LayerTerraserver lts2 = new LayerTerraserver(this, cm); if(!Project.drawTerraserver) { lts2.Enabled = false; } m_layersManager.Add(lts2); LayerCustomMaps lcm = new LayerCustomMaps(this, cm); if(!Project.drawCustomMaps) { lcm.Enabled = false; } m_layersManager.Add(lcm); LayerEarthquakes le = new LayerEarthquakes(this, cm); if(!Project.drawEarthquakes) { le.Enabled = false; } m_layersManager.Add(le); LayerWaypoints lw = new LayerWaypoints(this, cm); if(!Project.drawWaypoints) { lw.Enabled = false; } m_layersManager.Add(lw); LayerVehicles lv = new LayerVehicles(this, cm); if(!Project.drawVehicles) { lv.Enabled = false; } m_layersManager.Add(lv); m_layersManager.Add(m_cameraManager); // camera manager is a layer too - draws camera and arrows }
public LayerBasicMap(PictureManager pm, CameraManager cm) : base(pm, cm) { }
public DlgMakeWaypoint(CameraManager cameraManager, Point clickPoint) : this(cameraManager) { m_clickPoint = clickPoint; m_clickLocation = m_cameraManager.toGeoLocation(m_clickPoint); setCoordFields(m_clickLocation); Project.setDlgIcon(this); waypointNameTextBox.Focus(); }
public CameraManager(ILocationWatcher lw, CameraTrack cameraTrack) : base(null, null) { m_locationWatcher = lw; m_cameraTrack = cameraTrack; This = this; ffont = Project.getLabelFont(Project.FONT_SIZE_REGULAR + 2); AdjustableArrowCap arrow = new AdjustableArrowCap(3.0f, 7.0f); Project.distancePen.CustomEndCap = arrow; Project.distancePen.CustomStartCap = arrow; AdjustableArrowCap arrowP = new AdjustableArrowCap(3.0f, 7.0f); Project.distancePenPrint.CustomEndCap = arrowP; Project.distancePenPrint.CustomStartCap = arrowP; AdjustableArrowCap arrowM = new AdjustableArrowCap(3.0f, 5.0f); Project.movePointPen.CustomEndCap = arrowM; }
public DlgWaypointsManager(PictureManager pictureManager, CameraManager cameraManager, int mode, long trackIdToSelect) { LayerWaypoints.This.makeRouteMode = false; // just in case route mode is still on if(This != null) { This.Dispose(); //GC.Collect(); //GC.WaitForPendingFinalizers(); } This = this; m_pictureManager = pictureManager; m_cameraManager = cameraManager; m_trackIdToSelect = trackIdToSelect; m_routeIdToSelect = trackIdToSelect; InitializeComponent(); this.SuspendLayout(); if(Project.fitsScreen(wptManagerX, wptManagerY, Project.wptManagerWidth, Project.wptManagerHeight)) { inResize = true; this.Location = new Point(wptManagerX, wptManagerY); this.ClientSize = new System.Drawing.Size(Project.wptManagerWidth, Project.wptManagerHeight); inResize = false; } this.fromTimeDateTimePicker.CustomFormat = "h:mm tt"; this.toTimeDateTimePicker.CustomFormat = "h:mm tt"; this.aroundTimeTimeDateTimePicker.CustomFormat = "h:mm tt"; SetTimeFilterDefaults(); showWaypointsCheckBox.Checked = Project.drawWaypoints; showTrackpointsCheckBox.Checked = Project.drawTrackpoints; showNumbersCheckBox.Checked = Project.showTrackpointNumbers; showNamesCheckBox.Checked = Project.showWaypointNames; sanityCheckBox.Checked = Project.sanityFilter; colorElevTracksCheckBox.Checked = Project.trackElevColor; colorSpeedTracksCheckBox.Checked = Project.trackSpeedColor; // order of tabs: tracks-trackpoints-routes-waypoints-filter-options switch(mode) { default: case 0: // stay on the last chosen rebuildTracksTab(); rebuildRoutesTab(); rebuildWaypointsTab(); // never jump straight to trackpoints tab: tabControl1.SelectedIndex = (selectedTabIndex == 1 || selectedTabIndex == 2) ? 0 : selectedTabIndex; if(tabControl1.SelectedTab == tracksTabPage || tabControl1.SelectedTab == routesTabPage) { prevSelectedTab = tabControl1.SelectedTab; } break; case 1: // tracks tab, show the grid: rebuildTracksTab(); rebuildRoutesTab(); prevSelectedTab = this.tracksTabPage; break; case 2: // go to Options tab rebuildTracksTab(); rebuildRoutesTab(); prevSelectedTab = this.tracksTabPage; tabControl1.SelectedTab = this.optionsTabPage; break; case 3: // routes tab, show the grid: rebuildTracksTab(); rebuildRoutesTab(); tabControl1.SelectedTab = this.routesTabPage; prevSelectedTab = this.routesTabPage; break; } switch(m_timeFilterMode) { case 0: // from/to setFilterModeFromTo(); fromToRadioButton.Checked = true; break; case 1: // around time setFilterModeAroundTime(); aroundTimeRadioButton.Checked = true; break; default: // no filter setFilterModeNone(); noFilterRadioButton.Checked = true; break; } breakTimeComboBox.SelectedIndex = breakTimeIndex(Project.breakTimeMinutes); aroundTimeComboBox.SelectedIndex = aroundTimeIndex(aroundTimeMinutes); playSleepTimeMs = 500 + (playSpeedTrackBar.Maximum - playSpeedTrackBar.Value) * 200; Project.setDlgIcon(this); this.waypointsDataGrid.MouseUp += new System.Windows.Forms.MouseEventHandler(this.waypointsDataGrid_MouseUp); this.trackpointsDataGrid.MouseUp += new System.Windows.Forms.MouseEventHandler(this.trackpointsDataGrid_MouseUp); setColorPaletteButtons(); colorPaletteMessageLabel.Text = "Note: track/route colors are picked\nrandomly from the choices above, unless explicitly set."; try { trackThicknessNumericUpDown.Value = (decimal)TrackPalette.penTrackThickness; routeThicknessNumericUpDown.Value = (decimal)TrackPalette.penRouteThickness; this.pointsPerRouteNumericUpDown.Value = (decimal)Project.gpsMaxPointsPerRoute; } catch {} graphByTimeControl = new LibGui.GraphByTimeControl(); this.graphPanel.Controls.Add(graphByTimeControl); this.graphByTimeControl.Dock = System.Windows.Forms.DockStyle.Fill; this.graphByTimeControl.Name = "graphByTimeControl"; inSet = true; timeUtcRadioButton.Checked = Project.useUtcTime; timeLocalRadioButton.Checked = !Project.useUtcTime; setUtcLabels(); inSet = false; this.ResumeLayout(true); }
public DlgMakeWaypoint(CameraManager cameraManager, PhotoDescr photoDescr, Waypoint wpt) : this(cameraManager) { this.TopMost = true; if(wpt == null) { m_clickLocation = m_cameraManager.Location.Clone(); m_clickLocation.Elev = 0.0d; } else { m_clickLocation = wpt.Location.Clone(); elevLabel.Text = wpt.TrackId == -1 ? "Elevation:" : "Altitude"; } setCoordFields(m_clickLocation); m_photoDescr = photoDescr; this.waypointNameTextBox.Text = m_photoDescr.imageName; this.urlTextBox.Text = m_photoDescr.imageUrl; this.detailTextBox.Text = m_photoDescr.imageSource; this.timePicker.dateTime = m_photoDescr.DTOrig; // all we can realistically change here is coordinates and elevation, so disable other conrols: this.symbolTextBox.Enabled = false; this.waypointNameTextBox.Enabled = false; this.waypointTypeComboBox.Enabled = false; this.urlNameTextBox.Enabled = false; this.urlTextBox.Enabled = false; this.detailTextBox.Enabled = false; this.commentTextBox.Enabled = false; //this.timePicker.Enabled = false; Project.setDlgIcon(this); waypointNameTextBox.Focus(); }
public DlgEarthquakesManager(PictureManager pictureManager, CameraManager cameraManager, int mode, int scope) { m_pictureManager = pictureManager; m_cameraManager = cameraManager; m_mode = mode; if(scope != -1) // or, stay with previously selected scope { m_scope = scope; } //EarthquakesCache.RefreshEarthquakesDisplayed(); // make sure we have correct data to fill the datagrid // // for the visible map. InitializeComponent(); Project.setDlgIcon(this); }