public SelectableText SelectOptionProp(string selfValueHeaderDictText) { self.value = selfValueHeaderDictText; selList.elemNum += 1; float loc = selList.loc - 1f / (1f + selList.elemNum); UITextPhrase textHead = new UITextPhrase(loc, self.value); List <string> newEntries = opdict[self.value].ToList(); newEntries.Add(OptionsDict.SelectableList.removeTag); SelectableText selTex = new SelectableText(textHead, infoPanel, selList, self.value, newEntries, false); uilist.Add(textHead); thisAsSel = new Selectable(selTex); selTex.thisAsSel = thisAsSel; infoPanel.selectables.Add(thisAsSel); targetUIdesc.ClearCurrent(); if (newEntries.Count > 1) { if (selList.which.Equals(OptionsDict.Phase2.positive) || selList.which.Equals(OptionsDict.Phase3.positive)) { thisAsSel.SetValue(newEntries[1]); } else if (selList.which.Equals(OptionsDict.Phase2.negative) || selList.which.Equals(OptionsDict.Phase3.negative)) { thisAsSel.SetValue(newEntries[Math.Max(0, (newEntries.Count - 1) * 3 / 4 - 1)]); } } return(selTex); }
public SelectableText AddSelectable(string header, List <string> properties) { UITextPhrase textHead = new UITextPhrase(uielem.Count + 1, header); SelectableText newSel = new SelectableText(textHead, uidesc, opdict, header, properties); selectables.Add(new Selectable(newSel)); uielem.Add(textHead); return(newSel); }
public Selectable(UISortInputText inputText) { this.selText = null; this.inputText = inputText; GetValue = GetValueInputText; SetValue = SetValueInputText; GetHeader = GetHeaderInputText; ind = inputText.ind; }
public Selectable(SelectableText selText) { this.selText = selText; this.inputText = null; GetValue = GetValueSelText; SetValue = SetValueSelText; GetHeader = GetHeaderSelText; ind = selText.self.ind; }
public SelectableText AddSelectable(string header, int from, int steps, int stepSize = 1, int factor1 = 1, int factor2 = 0) { UITextPhrase textHead = new UITextPhrase(uielem.Count + 1, header); List <string> values = new List <string>(); int n = from; int cfactor = 0; int factor = 1; for (int i = 0; i < steps; i++) { cfactor = cfactor == factor1 && factor2 != 0 ? factor2 : factor1; factor *= cfactor; n = (from + i * stepSize) * factor; values.Add(n.ToString()); } SelectableText newSel = new SelectableText(textHead, uidesc, opdict, header, values); selectables.Add(new Selectable(newSel)); uielem.Add(textHead); return(newSel); }
public SelectableText AddSelectableList(SelectableList selList, char kind) { SelectableText selt; switch (kind) { case listKindPositive: (selt = this.AddSelectable(OptionsDict.SelectableList.positive, OptionsDict.SelectableList.positiveDescription)).setCustomColor(Color.LightGreen); break; case listKindNegative: (selt = this.AddSelectable(OptionsDict.SelectableList.negative, OptionsDict.SelectableList.negativeDescription)).setCustomColor(Color.PaleVioletRed); break; case listKindNaming: (selt = this.AddSelectable(OptionsDict.SelectableList.name, OptionsDict.SelectableList.nameDescription)).setCustomColor(Color.LightGoldenrodYellow); break; case listKindOmitRare: (selt = this.AddSelectable(OptionsDict.SelectableList.omitRare, OptionsDict.SelectableList.omitRareDescription)).setCustomColor(Color.LightGoldenrodYellow); break; default: selt = this.AddSelectable("?VVVVVVV select VVVVVVV?", "here you can add what?"); break; } UITextPhrase textHead = new UITextPhrase(uielem.Count + 1, OptionsDict.SelectableList.addingTag); selList.elemNum = 0; selList.loc = uielem.Count + 1; //SelectableText newSel = new SelectableText(textHead, uidesc, uielem, selList, opdict, "Add", opdict[selList.which]);sdfd SelectableText newSel = new SelectableText(textHead, this, selList, OptionsDict.SelectableList.addingTag, opdict[selList.which]); newSel.SetValue(selList.which); uielem.Add(textHead); newSel.setCustomColor(Color.SlateGray); //SelectableText bo = this.AddSelectable("'''''''''''''''''''''''''''''''''''''''''''''''''''''", new List<string>{}); //if (isPositive) bo.setCustomColor(Color.LightGreen); else bo.setCustomColor(Color.PaleVioletRed); return(newSel); }