Example #1
0
        private void ValidateInfo()
        {
            if (textBox1.Text.Length == 0)
            {
                button1.Enabled  = false;
                label3.Text      = GPStrings.getString(285);
                label3.ForeColor = Color.Red;
            }
            else if (GPCountryList.getShared().ExistsCode(textBox1.Text) && textBox1.Text != ValidCode)
            {
                button1.Enabled  = false;
                label3.Text      = GPStrings.getString(286);
                label3.ForeColor = Color.Red;
            }
            else
            {
                button1.Enabled  = true;
                label3.Text      = GPStrings.getString(288);
                label3.ForeColor = Color.Green;
            }

            if (textBox2.Text.Length == 0)
            {
                button1.Enabled  = false;
                label4.Text      = GPStrings.getString(287);
                label4.ForeColor = Color.Red;
            }
            else
            {
                label4.Text      = GPStrings.getString(288);
                label4.ForeColor = Color.Green;
            }
        }
Example #2
0
 private void StartForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     GPStrings.getSharedStrings().Save();
     GPLocationList.getShared().Save();
     GPEventList.getShared().Save();
     GPCountryList.getShared().Save();
     GPTimeZoneList.sharedTimeZones().Save();
     GPLocationProvider.SaveRecent();
 }
Example #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        public LocationPickerControl()
        {
            InitializeComponent();
            ActiveControl = textBox1;

            foreach (GPCountry cn in GPCountryList.getShared().countries)
            {
                comboBox1.Items.Add(cn.getCode());
            }

            foreach (GPTimeZone tz in GPTimeZoneList.sharedTimeZones().getTimeZones())
            {
                comboBox8.Items.Add(tz.Name);
            }

            for (int i = 0; i <= 180; i++)
            {
                comboBox2.Items.Add(i.ToString());
            }
            for (int i = 0; i < 90; i++)
            {
                comboBox7.Items.Add(i.ToString());
            }
            for (int i = 0; i < 60; i++)
            {
                comboBox4.Items.Add(i.ToString());
                comboBox5.Items.Add(i.ToString());
            }

            comboBox3.Items.Add("East");
            comboBox3.Items.Add("West");
            comboBox6.Items.Add("North");
            comboBox6.Items.Add("South");

            comboBox2.SelectedIndex = 0;
            comboBox3.SelectedIndex = 0;
            comboBox4.SelectedIndex = 0;
            comboBox5.SelectedIndex = 0;
            comboBox6.SelectedIndex = 0;
            comboBox7.SelectedIndex = 0;

            UpdateEnabledButtons();

            Debugger.Log(0, "", "textBox1 focus start\n");
            textBox1.Select();
//            textBox1.Focus();
//            textBox1.Select(0, textBox1.Text.Length);
            Debugger.Log(0, "", "textBox1 focus end\n");
        }
Example #4
0
        public EditLocationProperties()
        {
            InitializeComponent();

            GPCountryList  list   = GPCountryList.getShared();
            GPTimeZoneList tzones = GPTimeZoneList.sharedTimeZones();

            comboBox1.BeginUpdate();
            foreach (GPCountry country in list.countries)
            {
                comboBox1.Items.Add(country);
            }
            comboBox1.EndUpdate();

            comboBox2.BeginUpdate();
            foreach (GPTimeZone tzone in tzones.getTimeZones())
            {
                comboBox2.Items.Add(tzone);
            }
            comboBox2.EndUpdate();

            ValidateInfo();
        }