Exemple #1
0
 /// <summary>
 /// Initializes the singleton application object.  This is the first line of authored code
 /// executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     this.InitializeComponent();
     this.Suspending += this.OnSuspending;
     DataModel        = new DataSource();
     ComboBoxModel    = new ComboBoxList();
 }
        public ComboBoxListViewDesktop(ComboBox cmbBox)
            : base(DesktopManager.ScreenWidth - 50, DesktopManager.ScreenHeight - 50)
        {
            _suspended = true;

            ComboBoxList _itemsList = new ComboBoxList(5, 5, _mWidth - 10, _mHeight - 40);
            foreach (object item in cmbBox.Items)
                _itemsList.AddItem(item);

            object initialSelectedItem = _itemsList.SelectedItem = cmbBox.SelectedItem;
            _itemsList.BringItemIntoView(cmbBox.SelectedIndex);
            _itemsList.SelectedItemChanged += (s) =>
                {
                    cmbBox.SelectedItem = _itemsList.SelectedItem;
                };

            base.AddChild(_itemsList);

            TextButton cancelBut = new TextButton("Cancel", _mWidth - 105, _mHeight - 30, 100, 25);
            cancelBut.ButtonPressed += (s) => { cmbBox.SelectedItem = initialSelectedItem; Close(); };
            base.AddChild(cancelBut);

            TextButton okBut = new TextButton("Ok", cancelBut.X - 105, _mHeight - 30, 100, 25);
            okBut.ButtonPressed += (s) => Close();
            base.AddChild(okBut);

            _suspended = false;
        }
Exemple #3
0
        public ComboBoxListViewDesktop(ComboBox cmbBox)
            : base(DesktopManager.ScreenWidth - 50, DesktopManager.ScreenHeight - 50)
        {
            _suspended = true;

            ComboBoxList _itemsList = new ComboBoxList(5, 5, _mWidth - 10, _mHeight - 40);

            foreach (object item in cmbBox.Items)
            {
                _itemsList.AddItem(item);
            }

            object initialSelectedItem = _itemsList.SelectedItem = cmbBox.SelectedItem;

            _itemsList.BringItemIntoView(cmbBox.SelectedIndex);
            _itemsList.SelectedItemChanged += (s) =>
            {
                cmbBox.SelectedItem = _itemsList.SelectedItem;
            };

            base.AddChild(_itemsList);

            TextButton cancelBut = new TextButton("Cancel", _mWidth - 105, _mHeight - 30, 100, 25);

            cancelBut.ButtonPressed += (s) => { cmbBox.SelectedItem = initialSelectedItem; Close(); };
            base.AddChild(cancelBut);

            TextButton okBut = new TextButton("Ok", cancelBut.X - 105, _mHeight - 30, 100, 25);

            okBut.ButtonPressed += (s) => Close();
            base.AddChild(okBut);

            _suspended = false;
        }
Exemple #4
0
 private void BuildComboBox()
 {
     ComboBoxList.Add("Engine");
     ComboBoxList.Add("Gears");
     ComboBoxList.Add("Tyre");
     ComboBoxList.Add("Body");
     ComboBoxList.Add("Chassi");
 }
Exemple #5
0
        public override void RefreshSecondaryData()
        {
            ComboBoxList <EDocumentoAlumno> docs = moleQule.Library.Instruction.EnumText <EDocumentoAlumno> .GetList();

            foreach (ComboBoxSource item in docs)
            {
                Documentos_CLB.Items.Add(item.Texto);
            }
        }
Exemple #6
0
        protected override ComboBoxList <EMedioPago> GetPaymentMethods()
        {
            switch (_entity.EMedioPago)
            {
            case EMedioPago.ComercioExterior:
                return(moleQule.Common.Structs.EnumText <EMedioPago> .GetList(new EMedioPago[] { EMedioPago.ComercioExterior }));

            default:
                ComboBoxList <EMedioPago> list = moleQule.Common.Structs.EnumText <EMedioPago> .GetList(false);

                list.Remove((int)EMedioPago.ComercioExterior);
                return(list);
            }
        }
 /// <summary>
 /// Called once per frame if EnableScriptEvents is true.
 /// </summary>
 public override void Update()
 {
     // if list is open check if user has clicked outside
     if (ComboBoxList.IsActive)
     {
         if (Input.GetMouseButtonDown(0))
         {
             if (!ComboBoxButton.ContainsMouse(Input.mousePosition) &&
                 !ComboBoxList.ContainsMouse(Input.mousePosition))
             {
                 ComboBoxList.IsActive      = false;
                 ComboBoxButton.ToggleValue = false;
             }
         }
     }
 }
Exemple #8
0
        private void ComboBox_Font_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxList CBL = (ComboBoxList)e.AddedItems[0];

            if (CBL.Name == "OldFont")
            {
                CharList = Static.FontMap.old_char;
            }
            else if (CBL.Name == "NewFont")
            {
                CharList = Static.FontMap.new_char;
            }

            TextBox_TextChanged(TextBoxText, null);
            TextBox_NameChanged(TextBoxName, null);
        }
		public static MvcHtmlString PaymentGatewaysDropDown(this System.Web.Mvc.HtmlHelper helper, string name, object selectedValue)
		{
			ComboBoxList<EPaymentGateway> list = Library.Invoice.EnumText<EPaymentGateway>.GetList(true, false);

			StringBuilder b = new StringBuilder();
			b.Append(string.Format("<select name=\"{0}\" id=\"{0}\" class=\"input-small\">", name));

			string selected = string.Empty;

			foreach (ComboBoxSource item in list)
			{
				selected = (item.Oid == Convert.ToInt64(selectedValue)) ? "selected=\"selected\"" : string.Empty;

				b.Append(string.Format("<option value=\"{0}\" {1}>{2}</option>", item.Oid, selected, item.Texto));
			}
			b.Append("</select>");

			return MvcHtmlString.Create(b.ToString());
		}
Exemple #10
0
 public ComboBoxCustomType() : base()
 {
     this.Items = new ComboBoxList <TCustomType>(base.Items);
 }
Exemple #11
0
 /// <summary>
 /// Selects item in the list.
 /// </summary>
 public void SelectItem(BindableObject item, bool triggeredByClick = false)
 {
     ComboBoxList.SelectItem(item, triggeredByClick);
 }
Exemple #12
0
 /// <summary>
 /// Selects item in the list.
 /// </summary>
 public void SelectItem(int index, bool triggeredByClick = false)
 {
     ComboBoxList.SelectItem(index, triggeredByClick);
 }