public void cmbDatabases_onchange(GuiComboBox control) { GuiComboBox cmbDatabases = ui["databaseName"] as GuiComboBox; GuiComboBox cmbTables = ui["tableName"] as GuiComboBox; cmbTables.BindData(MyMeta.Databases[cmbDatabases.SelectedValue].Tables); // clear columns list GuiListBox lstColumns = ui["lstColumns"] as GuiListBox; lstColumns.Clear(); }
/** * Populates listbox with all dead characters currently in the morgue */ private void PopulateDeadCharacterList() { deadCharactersList.Clear(); foreach (MDRCharacter character in CoM.CharacterList) { if (character.IsDead && character.IsInTown) { deadCharactersList.Add(character); } } doUpdateRaiseInfo(); raiseCharacterButton.SelfEnabled = deadCharactersList.Count > 0; }
/** * Populates the guild list with guilds this character is able to join */ private void updateGuildList() { GuildList.Clear(); foreach (MDRGuild guild in CoM.Guilds) { if (guild.CanAcceptRace(Character.Race)) { GuildList.Add(guild); } } GuildList.Selected = Character.CurrentGuild; }
public void UpdateData() { Control w32ctrl; foreach (GuiControl control in guiControls.Values) { w32ctrl = win32Controls[control.ID] as Control; if (control is GuiLabel) { GuiLabel guiLabel = control as GuiLabel; Label l = w32ctrl as Label; guiLabel.Text = l.Text; } else if (control is GuiButton) { GuiButton guiButton = control as GuiButton; Button b = w32ctrl as Button; guiButton.Text = b.Text; } else if (control is GuiCheckBox) { GuiCheckBox guiCheckBox = control as GuiCheckBox; CheckBox cb = w32ctrl as CheckBox; guiCheckBox.Text = cb.Text; guiCheckBox.Checked = cb.Checked; } else if (control is GuiFilePicker) { GuiFilePicker guiPicker = control as GuiFilePicker; Button b = w32ctrl as Button; guiPicker.Text = b.Text; b.Tag = win32Controls[guiPicker.TargetControl]; } else if (control is GuiTextBox) { GuiTextBox guiTextBox = control as GuiTextBox; TextBox tb = w32ctrl as TextBox; guiTextBox.Text = tb.Text; } else if (control is GuiComboBox) { GuiComboBox guiComboBox = control as GuiComboBox; ComboBox cb = w32ctrl as ComboBox; if (cb.SelectedItem is ListControlItem) { guiComboBox.SelectedValue = ((ListControlItem)cb.SelectedItem).Value; } } else if (control is GuiListBox) { GuiListBox guiListBox = control as GuiListBox; ListBox lb = w32ctrl as ListBox; guiListBox.Clear(); foreach (ListControlItem item in lb.Items) { guiListBox[item.Value] = item.Text; } foreach (ListControlItem item in lb.SelectedItems) { guiListBox.SelectedItems.Add(item.Value); } } else if (control is GuiGrid) { GuiGrid guiGrid = control as GuiGrid; DataGrid dg = w32ctrl as DataGrid; guiGrid.DataSource = SimpleTableTools.ConvertToSimpleTable(dg.DataSource as DataTable); } else if (control is GuiCheckBoxList) { GuiCheckBoxList guiCheckBoxList = control as GuiCheckBoxList; CheckedListBox lb = w32ctrl as CheckedListBox; guiCheckBoxList.Clear(); foreach (ListControlItem item in lb.Items) { guiCheckBoxList[item.Value] = item.Text; } foreach (ListControlItem item in lb.CheckedItems) { guiCheckBoxList.SelectedItems.Add(item.Value); } } } }