//------------------------------------------------------------------- /// <summary> /// /// </summary> private void DoShowDlgComboChoice() { List <DlgComboChoiceItem> listItem = new List <DlgComboChoiceItem>(); DlgComboChoiceItem selectedBeforeItem = null; // create some object List <string> listString = new List <string>(); listString.Add("dog"); listString.Add("cat"); listString.Add("horse"); listString.Add("duck"); foreach (string s in listString) { var item = new DlgComboChoiceItem(s, s); listItem.Add(item); // select the first item //if (selectedBeforeItem == null) // selectedBeforeItem = item; } DlgComboChoiceItem selected; CommonDlgResult res = AppCtrlProvider.AppCtrl.CommonDlg.ShowDlgComboChoice("Choose it", listItem, selectedBeforeItem, out selected); if (res == CommonDlgResult.Ok) { AppCtrlProvider.AppCtrl.CommonDlg.ShowInformation("Selected item:\n " + selected.Object.ToString() + "."); } else { AppCtrlProvider.AppCtrl.CommonDlg.ShowWarning("Aborted!"); } }
/// <summary> /// A long question text. /// </summary> private void DoShowDlg_WXL_HXL_Question() { string text = "Le temps est maussade aujourd'hui, il pleut, il ne fait pas beau, mon ordinateur ne marche pas bien, que faire?"; //CommonDlgResult res = AppCtrlProvider.AppCtrl.CommonDlg.ShowDlg(WHSize.WXL_HXL, "La question du jour", text, CommonDlgIcon.Question, CommonDlgButtons.YesNo); CommonDlgResult res = AppCtrlProvider.AppCtrl.CommonDlg.ShowQuestion(WHSize.WXL_HXL, text); // decode res: yes or no }
//--------------------------------------------------------------------- /// <summary> /// Set the result, close the dlgBox. /// </summary> private void DoBtn3Cmd() { _dlgResult = CommonDlgResult.Cancel; // close the dlgBox if (DoCloseView != null) { // prevent the manager of the dlgBox DoCloseView(); } }
//--------------------------------------------------------------------- /// <summary> /// Set the result, close the dlgBox. /// </summary> private void DoBtnOkCmd() { // the default case _dlgResult = CommonDlgResult.Ok; // close the dlgBox if (DoCloseView != null) { // prevent the manager of the dlgBox DoCloseView(); } }
/// <summary> /// /// </summary> private void DoShowDlgInputTextMulti() { string text; CommonDlgResult res = AppCtrlProvider.AppCtrl.CommonDlg.ShowDlgInputTextMulti("Input", "Give a description:", "", out text); if (res != CommonDlgResult.Ok) { AppCtrlProvider.AppCtrl.CommonDlg.ShowWarning(WHSize.WL, "The user cancelled the operation!"); return; } AppCtrlProvider.AppCtrl.CommonDlg.ShowInformation("description is: " + text); }
/// <summary> /// /// </summary> private void DoShowDlg_WL_InputText() { string text; CommonDlgResult res = AppCtrlProvider.AppCtrl.CommonDlg.ShowDlgInputText(WHSize.WL, "Input", "Give a name:", "name", out text); if (res != CommonDlgResult.Ok) { AppCtrlProvider.AppCtrl.CommonDlg.ShowWarning(WHSize.WL, "The user cancelled the operation!"); return; } AppCtrlProvider.AppCtrl.CommonDlg.ShowInformation("Name is: " + text); }
/// <summary> /// /// </summary> private void DoShowDlgQuestion() { CommonDlgResult res = AppCtrlProvider.AppCtrl.CommonDlg.ShowDlg("The question of the day", "Do you like dogs?", CommonDlgIcon.Question, CommonDlgButtons.YesNo); if (res == CommonDlgResult.Yes) { AppCtrlProvider.AppCtrl.CommonDlg.ShowInformation("Yes, you do like dogs."); } else { AppCtrlProvider.AppCtrl.CommonDlg.ShowError("No, you don't like dogs."); } }
private void DoBtnOkCmd() { // the default case _dlgResult = CommonDlgResult.Ok; // mémorise la valeur selectionnée // TODO: // close the dlgBox if (DoCloseView != null) { // prevent the manager of the dlgBox DoCloseView(); } }
//--------------------------------------------------------------------- /// <summary> /// Set the result, close the dlgBox. /// </summary> private void DoBtn2Cmd() { // the default case _dlgResult = CommonDlgResult.Cancel; if (_buttons == CommonDlgButtons.YesNo || _buttons == CommonDlgButtons.YesNoCancel) { _dlgResult = CommonDlgResult.No; } // close the dlgBox if (DoCloseView != null) { // prevent the manager of the dlgBox DoCloseView(); } }
/// <summary> /// /// </summary> private void DoShowDlgListChoice() { List <DlgListChoiceItem> listItem = new List <DlgListChoiceItem>(); List <DlgListChoiceItem> listSelectedBeforeItem = null; // create some object List <string> listString = new List <string>(); listString.Add("Au revoir"); listString.Add("salut"); listString.Add("bye"); listString.Add("tchao"); foreach (string s in listString) { var item = new DlgListChoiceItem(s, s); listItem.Add(item); // select the first item //if (selectedBeforeItem == null) // selectedBeforeItem = item; } List <DlgListChoiceItem> listSelected; CommonDlgResult res = AppCtrlProvider.AppCtrl.CommonDlg.ShowDlgListChoice("Choose it", listItem, listSelectedBeforeItem, out listSelected); if (res == CommonDlgResult.Ok) { string sel = ""; foreach (var s in listSelected) { sel += s + ", "; } AppCtrlProvider.AppCtrl.CommonDlg.ShowInformation("Les items suivants ont été selectionnés: " + sel + "."); } else { AppCtrlProvider.AppCtrl.CommonDlg.ShowInformation("Abandon."); } }
/// <summary> /// Add a new column at the end of the existing col, create all missing cell on each row. /// No need to create cellVM, will be created automatically by the gridMappingcell. /// </summary> private void AddCol() { // ask to the user the name and the type //List<DlgComboChoiceItem> listItem = new List<DlgComboChoiceItem>(); //DlgComboChoiceItem selectedBeforeItem = null; //var item = new DlgComboChoiceItem("string", "string"); //listItem.Add(item); //selectedBeforeItem = item; //item = new DlgComboChoiceItem("int", "int"); //listItem.Add(item); //DlgComboChoiceItem selected; string newColName; CommonDlgResult res = _commonDlg.ShowDlgInputText("Input", "Column name:", "col", out newColName); if (res != CommonDlgResult.Ok) { return; } // check the column name if (string.IsNullOrEmpty(newColName)) { return; } newColName = newColName.Trim(); if (DynDataGridVM.DynDataGrid.ListColumn.Where(c => c.Name.Equals(newColName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault() != null) { _commonDlg.ShowError("The name is already used by a column."); return; } // create a column, type string IGridColumnVM gridColumnVM; DynDataGridVM.CreateColumnWithCells(GridColumnType.String, newColName, out gridColumnVM); }