public ObjectPickerDialogEx(string title, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows, List <ObjectPicker.RowInfo> preSelectedRows) : base("UiObjectPicker", 1, true, ModalDialog.PauseMode.PauseSimulator, null) { if (mModalDialogWindow == null) { return; } Rect area = mModalDialogWindow.Area; area.mBottomRight.x += 200; mModalDialogWindow.Area = area; Text caption = mModalDialogWindow.GetChildByID(0x05ef6bd3, false) as Text; caption.Caption = title; mTable = mModalDialogWindow.GetChildByID(0x05ef6bd0, false) as ObjectPicker; mTable.ObjectTable.TableChanged += OnTableChanged; mTable.SelectionChanged += OnSelectionChanged; mTable.RowSelected += OnSelectionChanged; mTable.mViewButton.Visible = false; mTable.mTable.mPopulationCompletedCallback += OnComplete; area = mTable.Area; area.mBottomRight.x += 200; mTable.Area = area; mOkayButton = mModalDialogWindow.GetChildByID(0x05ef6bd1, false) as Button; mOkayButton.TooltipText = Common.LocalizeEAString("Ui/Caption/Global:Accept"); mOkayButton.Enabled = true; mOkayButton.Click += OnOkayButtonClick; OkayID = mOkayButton.ID; SelectedID = mOkayButton.ID; Button closeButton = mModalDialogWindow.GetChildByID(0x05ef6bd2, false) as Button; closeButton.TooltipText = Common.LocalizeEAString("Ui/Caption/ObjectPicker:Cancel"); closeButton.Click += OnCloseButtonClick; CancelID = closeButton.ID; mTableOffset = (mModalDialogWindow.Area.BottomRight - mModalDialogWindow.Area.TopLeft) - (mTable.Area.BottomRight - mTable.Area.TopLeft); mTable.Populate(listObjs, headers, numSelectableRows); mTable.mTabs.TabSelect -= mTable.OnTabSelect; mTable.mTabs.TabSelect += OnTabSelect; mTable.ViewTypeToggle = true; mTable.Selected = preSelectedRows; ResizeWindow(true); }
public override bool OnEnd(uint endID) { if (endID == OkayID) { if (!mOkayButton.Enabled) { return(false); } mResult = mTable.Selected; } else { mResult = null; } mTable.Populate(null, null, 0x0); return(true); }
// Methods public ObjectPickerDialog(string title, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows, List <ObjectPicker.RowInfo> preSelectedRows) : base("NRaas.OpportunityControl.UiObjectPicker", 1, true, ModalDialog.PauseMode.PauseSimulator, null) { if (mModalDialogWindow != null) { Text childByID = mModalDialogWindow.GetChildByID(0x5ef6bd3, false) as Text; childByID.Caption = title; mTable = mModalDialogWindow.GetChildByID(0x5ef6bd0, false) as ObjectPicker; mTable.ObjectTable.TableChanged += new TableContainer.TableChangedEventHandler(OnTableChanged); mTable.SelectionChanged += new ObjectPicker.ObjectPickerSelectionChanged(OnSelectionChanged); mTable.RowSelected += new ObjectPicker.ObjectPickerSelectionChanged(OnSelectionChanged); mOkayButton = mModalDialogWindow.GetChildByID(0x5ef6bd1, false) as Button; mOkayButton.TooltipText = NRaas.OpportunityControl.Localize("Choice:OK"); mOkayButton.Enabled = false; mOkayButton.Click += new UIEventHandler <UIButtonClickEventArgs>(OnOkayButtonClick); OkayID = mOkayButton.ID; SelectedID = mOkayButton.ID; mCloseButton = mModalDialogWindow.GetChildByID(0x5ef6bd2, false) as Button; mCloseButton.TooltipText = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]); mCloseButton.Click += new UIEventHandler <UIButtonClickEventArgs>(OnCloseButtonClick); CancelID = mCloseButton.ID; mTableOffset = (mModalDialogWindow.Area.BottomRight - mModalDialogWindow.Area.TopLeft) - (mTable.Area.BottomRight - mTable.Area.TopLeft); mTable.Populate(listObjs, headers, numSelectableRows); mTable.ViewTypeToggle = true; mTable.Selected = preSelectedRows; mModalDialogWindow.Area = new Rect(mModalDialogWindow.Area.TopLeft, (mModalDialogWindow.Area.TopLeft + mTable.TableArea.BottomRight) + mTableOffset); Rect area = mModalDialogWindow.Area; float num = area.BottomRight.x - area.TopLeft.x; float num2 = area.BottomRight.y - area.TopLeft.y; Rect rect2 = mModalDialogWindow.Parent.Area; float num5 = rect2.BottomRight.x - rect2.TopLeft.x; float num6 = rect2.BottomRight.y - rect2.TopLeft.y; float x = (float)Math.Round((double)((num5 - num) / 2f)); float y = (float)Math.Round((double)((num6 - num2) / 2f)); area.Set(x, y, x + num, y + num2); mModalDialogWindow.Area = area; mModalDialogWindow.Visible = true; } }
// Methods public ObjectPickerDialog(string title, List<ObjectPicker.TabInfo> listObjs, List<ObjectPicker.HeaderInfo> headers, int numSelectableRows, List<ObjectPicker.RowInfo> preSelectedRows) : base("NRaas.OpportunityControl.UiObjectPicker", 1, true, ModalDialog.PauseMode.PauseSimulator, null) { if (mModalDialogWindow != null) { Text childByID = mModalDialogWindow.GetChildByID(0x5ef6bd3, false) as Text; childByID.Caption = title; mTable = mModalDialogWindow.GetChildByID(0x5ef6bd0, false) as ObjectPicker; mTable.ObjectTable.TableChanged += new TableContainer.TableChangedEventHandler(OnTableChanged); mTable.SelectionChanged += new ObjectPicker.ObjectPickerSelectionChanged(OnSelectionChanged); mTable.RowSelected += new ObjectPicker.ObjectPickerSelectionChanged(OnSelectionChanged); mOkayButton = mModalDialogWindow.GetChildByID(0x5ef6bd1, false) as Button; mOkayButton.TooltipText = NRaas.OpportunityControl.Localize("Choice:OK"); mOkayButton.Enabled = false; mOkayButton.Click += new UIEventHandler<UIButtonClickEventArgs>(OnOkayButtonClick); OkayID = mOkayButton.ID; SelectedID = mOkayButton.ID; mCloseButton = mModalDialogWindow.GetChildByID(0x5ef6bd2, false) as Button; mCloseButton.TooltipText = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]); mCloseButton.Click += new UIEventHandler<UIButtonClickEventArgs>(OnCloseButtonClick); CancelID = mCloseButton.ID; mTableOffset = (mModalDialogWindow.Area.BottomRight - mModalDialogWindow.Area.TopLeft) - (mTable.Area.BottomRight - mTable.Area.TopLeft); mTable.Populate(listObjs, headers, numSelectableRows); mTable.ViewTypeToggle = true; mTable.Selected = preSelectedRows; mModalDialogWindow.Area = new Rect(mModalDialogWindow.Area.TopLeft, (mModalDialogWindow.Area.TopLeft + mTable.TableArea.BottomRight) + mTableOffset); Rect area = mModalDialogWindow.Area; float num = area.BottomRight.x - area.TopLeft.x; float num2 = area.BottomRight.y - area.TopLeft.y; Rect rect2 = mModalDialogWindow.Parent.Area; float num5 = rect2.BottomRight.x - rect2.TopLeft.x; float num6 = rect2.BottomRight.y - rect2.TopLeft.y; float x = (float)Math.Round((double)((num5 - num) / 2f)); float y = (float)Math.Round((double)((num6 - num2) / 2f)); area.Set(x, y, x + num, y + num2); mModalDialogWindow.Area = area; mModalDialogWindow.Visible = true; } }