Ejemplo n.º 1
0
        public void ItemClicked(string ItemName, ref bool Handled)
        {
            if (ItemName == "mConfig")
            {
                Forms.Configuracion config = new Configuracion();
                config.ShowDialog();
                Handled = true;
            }

            if (!InitOk)
            {
                return;
            }
            // mostrar ventana de geocod
            if (ItemName == "Geocodificar" || ItemName == "mGeocodificar")
            {
                if (Screen.AllScreens.Length > 1)
                {
                    Dirs.SetDesktopLocation(Screen.AllScreens[1].Bounds.Left + 10, Screen.AllScreens[1].Bounds.Top + 100);
                }
                else
                {
                    Dirs.SetDesktopLocation(10, 100);
                }

                DialogResult dr = Dirs.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    // tenemos direccion
                    direccion          = Dirs.Direccion;
                    PlugData.Direccion = direccion;
                    //Menues[1].Enabled = true;
                    //Botones[1].Enabled = true;
                }
                Handled = true;
            }

            if (ItemName == "VerExpediente" || ItemName == "mExpediente")
            {
                Forms.ListadoExpedientes Expediente = new Zeus.PluginGeocodificacion.Forms.ListadoExpedientes();
                Expediente.ShowDialog();
                Handled = true;
            }

            if (ItemName == "Grifos" || ItemName == "mGrifos")
            {
                Forms.ListadoGrifos Grifos = new Zeus.PluginGeocodificacion.Forms.ListadoGrifos();
                Grifos.ShowDialog();
                Handled = true;
            }

            if (ItemName == "Agenda" || ItemName == "mAgenda")
            {
                Forms.Agenda Agenda = new Zeus.PluginGeocodificacion.Forms.Agenda();
                Agenda.ShowDialog();
                Handled = true;
            }


            if (ItemName == "Limpiar" || ItemName == "mLimpiar")
            {
                MapWin.View.Draw.ClearDrawings();
                Handled = true;
            }

            // seleccionar
            if (ItemName == "SelMapa" || ItemName == "mSelMapa")
            {
                if (Botones[4].Pressed == true)
                {
                    Botones[4].Pressed     = false;
                    MapWin.View.MapCursor  = _prevCursor;
                    MapWin.View.CursorMode = _prevMode;
                }
                else
                {
                    Botones[4].Pressed           = true;
                    _prevCursor                  = MapWin.View.MapCursor;
                    _prevMode                    = MapWin.View.CursorMode;
                    MapWin.View.UserCursorHandle = (int)LoadColorCursor(Iconos.CursorPunto).Handle;
                    MapWin.View.MapCursor        = MapWinGIS.tkCursor.crsrUserDefined;
                    MapWin.View.CursorMode       = MapWinGIS.tkCursorMode.cmNone;
                    //MapWin.View.Draw.ClearDrawing(PlugData.DrDireccion);
                }
                Handled = true;
            }

            // puntos de interes
            if (ItemName == "SelInteres" || ItemName == "mSelInteres")
            {
                Forms.PuntosInteres Interes = new Zeus.PluginGeocodificacion.Forms.PuntosInteres();
                if (Screen.AllScreens.Length > 1)
                {
                    Interes.SetDesktopLocation(Interes.Left + Screen.AllScreens[1].Bounds.Left + 10, Interes.Location.Y);
                }

                Interes.ShowDialog();
                Handled = true;
            }

            // localizacion de carros
            if (ItemName == "Localizar" || ItemName == "mLocalizar")
            {
                Forms.RepresentacionGPS Rep = new Zeus.PluginGeocodificacion.Forms.RepresentacionGPS();
                if (Screen.AllScreens.Length > 1)
                {
                    Rep.SetDesktopLocation(Rep.Left + Screen.AllScreens[1].Bounds.Left + 10, Rep.Location.Y);
                }

                Rep.ShowDialog();
                Handled = true;
            }

            // localizacion de carros
            if (ItemName == "SelCarr" || ItemName == "mCarretera")
            {
                Forms.Carreteras carr = new Zeus.PluginGeocodificacion.Forms.Carreteras();
                if (Screen.AllScreens.Length > 1)
                {
                    carr.SetDesktopLocation(carr.Left + Screen.AllScreens[1].Bounds.Left + 10, carr.Location.Y);
                }

                carr.ShowDialog();
                Handled = true;
            }
        }