- April 27, 2009
- 778
- 333
- 32
- Home Country
-
Netherlands
I have 2 Dialogs:
I have no clue about how to assign an function to the one of the options of the GUIDialogSelect2 menu and the same for the GUIDialogYesNo when pressing yes.
My first plugin is almost working, I only need to assign some functions to the dialogs' options. How to do that?
What does "DoModal" do?
I'm am a noob at c# programming, but I learn fast.
Code:
private void OnDeviceClick()
{
GUIDialogSelect2 DeviceMenu = (GUIDialogSelect2)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_SELECT2);
DeviceMenu.SetHeading(GuiDeviceList.SelectedListItem.Label);
DeviceMenu.Add("on");
DeviceMenu.Add("off");
DeviceMenu.Add("dim 50%");
DeviceMenu.DoModal(GUIWindowManager.ActiveWindow);
}
private void OnMacroClick()
{
GUIDialogYesNo MacroMenu = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO);
MacroMenu.SetHeading(GuiDeviceList.SelectedListItem.Label);
MacroMenu.SetLine(1, "Weet u zeker dat u de macro met de naam");
MacroMenu.SetLine(2, "\""+GuiDeviceList.SelectedListItem.Label+"\"");
MacroMenu.SetLine(3, "wilt uitvoeren?");
MacroMenu.SetDefaultToYes(true);
MacroMenu.DoModal(GUIWindowManager.ActiveWindow);
//ExecuteAction(GuiDeviceList.SelectedListItem.ItemId)
}
I have no clue about how to assign an function to the one of the options of the GUIDialogSelect2 menu and the same for the GUIDialogYesNo when pressing yes.
My first plugin is almost working, I only need to assign some functions to the dialogs' options. How to do that?
What does "DoModal" do?
I'm am a noob at c# programming, but I learn fast.