mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
InputText: Added OnDismissAction
This commit is contained in:
parent
4b1d3f776f
commit
959bede3b5
@ -114,6 +114,7 @@ namespace InputText
|
|||||||
internal List<Dictionary<string, string>> OverrideOptions;
|
internal List<Dictionary<string, string>> OverrideOptions;
|
||||||
internal List<string> Commands;
|
internal List<string> Commands;
|
||||||
internal string Command;
|
internal string Command;
|
||||||
|
internal string DismissAction;
|
||||||
internal BangType Type;
|
internal BangType Type;
|
||||||
|
|
||||||
internal ExecuteBangParam(string args)
|
internal ExecuteBangParam(string args)
|
||||||
@ -122,6 +123,7 @@ namespace InputText
|
|||||||
this.OverrideOptions = new List<Dictionary<string, string>>();
|
this.OverrideOptions = new List<Dictionary<string, string>>();
|
||||||
this.Commands = new List<string>();
|
this.Commands = new List<string>();
|
||||||
this.Command = args.Trim();
|
this.Command = args.Trim();
|
||||||
|
this.DismissAction = null;
|
||||||
this.Type = BangType.Unknown;
|
this.Type = BangType.Unknown;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -43,6 +43,8 @@ namespace InputText
|
|||||||
ReadOption("Password", param.Options);
|
ReadOption("Password", param.Options);
|
||||||
ReadOption("TopMost", param.Options);
|
ReadOption("TopMost", param.Options);
|
||||||
|
|
||||||
|
param.DismissAction = rm.ReadString("OnDismissAction", "", false);
|
||||||
|
|
||||||
#region Handle a single parameter
|
#region Handle a single parameter
|
||||||
|
|
||||||
// If our parameter list only contains a single word, then open a textbox immediately
|
// If our parameter list only contains a single word, then open a textbox immediately
|
||||||
@ -184,7 +186,12 @@ namespace InputText
|
|||||||
|
|
||||||
// If the user cancelled out of the inputbox (ESC key, etc.), then abort
|
// If the user cancelled out of the inputbox (ESC key, etc.), then abort
|
||||||
if (sInput == null)
|
if (sInput == null)
|
||||||
|
{
|
||||||
|
// Execute OnDismissAction if defined
|
||||||
|
if (!String.IsNullOrEmpty(param.DismissAction))
|
||||||
|
API.Execute(rm.GetSkin(), param.DismissAction);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Ask Rainmeter to set the variable using a bang (http://rainmeter.net/RainCMS/?q=Bangs)
|
// Ask Rainmeter to set the variable using a bang (http://rainmeter.net/RainCMS/?q=Bangs)
|
||||||
API.Execute(rm.GetSkin(), "!SetVariable " + param.Command + " \"" + sInput + "\"");
|
API.Execute(rm.GetSkin(), "!SetVariable " + param.Command + " \"" + sInput + "\"");
|
||||||
@ -201,7 +208,12 @@ namespace InputText
|
|||||||
// Execute the line, but if there's a problem (error or they cancel the
|
// Execute the line, but if there's a problem (error or they cancel the
|
||||||
// input textbox), then abort
|
// input textbox), then abort
|
||||||
if (!ExecuteLine(param.Commands[i], param.Options, param.OverrideOptions[i]))
|
if (!ExecuteLine(param.Commands[i], param.Options, param.OverrideOptions[i]))
|
||||||
|
{
|
||||||
|
// Execute OnDismissAction if defined
|
||||||
|
if (!String.IsNullOrEmpty(param.DismissAction))
|
||||||
|
API.Execute(rm.GetSkin(), param.DismissAction);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Continue to the next line, if there is any
|
// Continue to the next line, if there is any
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user