コード例 #1
0
 private GUIDialogMenu BuildDialogSelect(IEnumerable <GUIListItem> list)
 {
     _dlgSelect = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
     _dlgSelect.ResetAllControls();
     _dlgSelect.Reset();
     _dlgSelect.Init();
     _dlgSelect.InitControls();
     _dlgSelect.Process();
     _dlgSelect.SetHeading("Context Menu");
     foreach (GUIListItem item in list)
     {
         _dlgSelect.Add(item);
     }
     return(_dlgSelect);
 }
コード例 #2
0
        public DialogResult ShowDialogSelect(IEnumerable <GUIListItem> listLabels, bool addCustomButton)
        {
            _dlgSelect = BuildDialogSelect(listLabels);
            GUIListItem customButton = new GUIListItem("Set Custom Status...");

            if (addCustomButton)
            {
                _dlgSelect.Add(customButton);
            }
            _dlgSelect.DoModal(GUIWindowManager.ActiveWindow);

            DialogResult result = new DialogResult(_dlgSelect.SelectedLabel, _dlgSelect.SelectedLabelText, _dlgSelect.SelectedLabelText);

            _dlgSelect.ResetAllControls();
            _dlgSelect.Reset();
            if (result.selectedLabelText == "Set Custom Status...")
            {
                result         = ShowDialogSelect(listLabels, false);
                result.message = GetKeyBoardInput(result.selectedLabelText);
            }
            return(result);
        }