void SearchClick(Point p) { Point wp = map.GToW(p); GLib lib = app.Lib; ps.Search(lib, wp, map.Scale, map); switch (ps.Count) { case 0: if (lib.Selection.Count > 0) { Rect bounds = lib.Selection.Bounds; lib.Selection.Clear(); app.CheckRepaint(bounds); } app.Status = Locale.Get("_objectsnotfound"); app.ShowProperties(null); postponeStatusUpdate = true; break; default: lib.Selection.Set(ps.LastObject); app.CheckRepaint(ps.LastObject); app.ShowProperties(ps.LastObject); break; /* default: * ObjectsForm objectsForm=new ObjectsForm(app,ps.Objects); * objectsForm.ShowDialog(this); * break;*/ } }
public GObject Create() { GObject obj = null; switch (type.GeomType) { case GeomType.Point: obj = new GPoint(type, Points[0]); break; case GeomType.Caption: obj = new GCaption(type, Points[0]); break; case GeomType.Polyline: obj = new GPolyline(type, Points); break; case GeomType.Polygon: obj = new GPolygon(type, Points); break; } if (obj != null) { app.ShowProperties(obj); } app.Lib.Selection.Clear(); app.CheckRepaint(this); app.UpdateControls(); return(obj); }
private void lbLayers_SelectedValueChanged(object sender, System.EventArgs e) { OnLayerSelected(this, null); if (app.GetControlsAttr(ControlsAttr.ShowPropertiesOnSelect)) { app.ShowProperties(SelectedLayer); } }
void ShowProperties() { try { if (!updating) { TreeNode node = tvTypes.SelectedNode; if (node != null) { app.ShowProperties(node.Tag); } } } catch (Exception ex) { Log.Exception(ex); } }
private void tvItems_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) { if (!updating) { if (app.GetControlsAttr(ControlsAttr.ShowPropertiesOnSelect)) { app.ShowProperties(SelectedBgImage); } if (OnBgImageSelected != null) { OnBgImageSelected(this, null); } } }
public void ShowObject() { try { GObject obj = null; GLib lib = Lib; using (WaitCursor wr = new WaitCursor(app, "Loading object...")) { DataGridCell dc = dgSearch.CurrentCell; BindingManagerBase bm = dgSearch.BindingContext[dtSearch]; if (bm.Count == 0 || bm.Current.GetType() != typeof(DataRowView)) { return; } DataRowView drv = (DataRowView)bm.Current; int objectId = (int)drv[ObjectField.Id.ToString()]; int rangeId = (int)drv[ObjectField.RangeId.ToString()]; obj = lib.GetObject(objectId, rangeId); if (obj == null) { obj = lib.LoadObject(objectId); } if (obj != null) { lib.Selection.Set(obj); MapUserControl mapCtl = app.CurrentMapControl; if (mapCtl != null) { mapCtl.Map.EnsureVisible(lib.Selection.Bounds); mapCtl.Repaint(); } } } app.ShowProperties(obj); if (obj == null) { MessageBox.Show(Locale.Get("_objectsnotfound")); } } catch (Exception ex) { Log.Exception(ex); } }