本文整理汇总了C#中ACAT.Lib.Core.WidgetManagement.Widget类的典型用法代码示例。如果您正苦于以下问题:C# Widget类的具体用法?C# Widget怎么用?C# Widget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Widget类属于ACAT.Lib.Core.WidgetManagement命名空间,在下文中一共展示了Widget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckEnabledArgs
/// <summary>
/// Initializes a new instance of the class.
/// </summary>
/// <param name="monitorInfo">Active window info</param>
/// <param name="widget">Scanner button that needs to be enabled/disabled</param>
public CheckEnabledArgs(WindowActivityMonitorInfo monitorInfo, Widget widget)
{
Handled = false;
Enabled = false;
Widget = widget;
MonitorInfo = monitorInfo;
}
示例2: ResolveUIWidgetsReferences
/// <summary>
/// The animation sequence can contain wildcard names for the
/// UI widgets or even references (such as @SelectedWidget for the
/// currently selected widget). Resolves all these referneces to their
/// actual names and adds the actual widgets to the child list
/// </summary>
internal void ResolveUIWidgetsReferences(Widget rootWidget, Variables variables)
{
clearAnimationWidgetList();
Log.Debug(rootWidget.Name + ". widgetXMLNodeList count: " + _widgetXMLNodeList.Count);
foreach (XmlNode xmlNode in _widgetXMLNodeList)
{
resolveWildCardReferences(rootWidget, variables, xmlNode);
resolveNonWildCardReferences(rootWidget, variables, xmlNode);
}
}
示例3: getWidgets
/// <summary>
/// Stores widget objects from the form
/// </summary>
private void getWidgets()
{
_sortOrderWidget = _scannerCommon.GetRootWidget().Finder.FindChild("SortOrderIcon");
_pageNumberWidget = _scannerCommon.GetRootWidget().Finder.FindChild("PageNumber");
_sortButton = _scannerCommon.GetRootWidget().Finder.FindChild("ButtonSort");
}
示例4: SetTargetControl
/// <summary>
/// Not used
/// </summary>
/// <param name="parent"></param>
/// <param name="widget"></param>
public void SetTargetControl(Form parent, Widget widget)
{
}
示例5: OnButtonActuated
/// <summary>
/// Triggered when a widget is actuated.
/// </summary>
/// <param name="widget">Which one triggered?</param>
public void OnButtonActuated(Widget widget)
{
var value = widget.Value;
if (String.IsNullOrEmpty(value))
{
return;
}
Log.Debug("**Actuate** " + widget.Name + " Value: " + value);
switch (value)
{
case "ok":
Windows.CloseForm(this);
break;
}
}
示例6: widget_EvtHighlightOn
/// <summary>
/// Event handler for when button is highlighted.
/// Update tooltip
/// </summary>
/// <param name="widget">widget that was highlighted</param>
/// <param name="handled">was it handled?</param>
private void widget_EvtHighlightOn(Widget widget, out bool handled)
{
handled = false;
var help = String.Empty;
var buttonWidget = widget as IButtonWidget;
if (buttonWidget != null)
{
help = buttonWidget.GetWidgetAttribute().ToolTip;
}
Windows.SetText(labelToolTip, help);
}
示例7: OnButtonActuated
/// <summary>
/// Triggered when a widget is actuated.
/// </summary>
/// <param name="widget">Which one triggered?</param>
public void OnButtonActuated(Widget widget)
{
Log.Debug("**Actuate** " + widget.UIControl.Name + " Value: " + widget.Value);
var value = widget.Value;
if (String.IsNullOrEmpty(value))
{
Log.Debug("OnButtonActuated() -- received actuation from empty widget!");
return;
}
Invoke(new MethodInvoker(delegate()
{
switch (value)
{
case "goBack":
onBack();
break;
case "ScannerZoomOut":
onZoomOut();
break;
case "ScannerZoomIn":
onZoomIn();
break;
case "ScannerRestoreDefaults":
onRestoreDefaults();
break;
case "ScannerMove":
onRepositionScanner();
break;
default:
Log.Debug("OnButtonActuated() -- unhandled widget actuation!");
break;
}
}));
}
示例8: OnWidgetActuated
/// <summary>
/// Called when the user clicks on a item that holds
/// an abbreviation
/// </summary>
/// <param name="widget">widget</param>
/// <param name="handled">true</param>
public void OnWidgetActuated(Widget widget, ref bool handled)
{
if (widget is TabStopScannerButton)
{
handled = true;
}
}
示例9: ActuateButton
/// <summary>
/// Activates the button that was triggered by
/// a switch actuator. 'command' is the character associated
/// with the button. For eg, if 'command' is the letter 'a',
/// the letter a will be sent to the application window
/// </summary>
/// <param name="widget">widget to activate</param>
/// <param name="value">char associated with the button</param>
public void ActuateButton(Widget widget, char value)
{
if (widget is IButtonWidget)
{
var button = (IButtonWidget)widget;
actuateNormalKey(button.GetWidgetAttribute().Modifiers, value);
}
}
示例10: initWidgetManager
/// <summary>
/// Create the widget manager. Load all the widgets
/// from the config file
/// </summary>
/// <param name="configFileName">name of the animation file</param>
/// <returns></returns>
private bool initWidgetManager(String configFileName)
{
_widgetManager = new WidgetManager(ScannerForm);
_widgetManager.Layout.SetColorScheme(ColorSchemes.ScannerSchemeName);
_widgetManager.Layout.SetDisabledButtonColorScheme(ColorSchemes.DisabledScannerButtonSchemeName);
bool retVal = _widgetManager.Initialize(configFileName);
if (!retVal)
{
Log.Error("Unable to initialize widget manager");
}
else
{
_rootWidget = _widgetManager.RootWidget;
if (String.IsNullOrEmpty(_rootWidget.SubClass))
{
_rootWidget.SubClass = (ScannerForm is ContextualMenuBase) ?
PanelClasses.PanelCategory.ContextualMenu.ToString() :
PanelClasses.PanelCategory.Scanner.ToString();
}
}
return retVal;
}
示例11: OnWidgetActuated
/// <summary>
/// Triggered when the user actuates a widget
/// </summary>
/// <param name="widget">widget actuated</param>
/// <param name="handled">was this handled?</param>
public void OnWidgetActuated(Widget widget, ref bool handled)
{
switch (widget.Value)
{
case "@Phrase1":
case "@Phrase2":
case "@Phrase3":
case "@Phrase4":
case "@Phrase5":
case "@Phrase6":
case "@Phrase7":
case "@Phrase8":
case "@Phrase9":
handled = true;
String text = widget.GetText().Trim();
if (!String.IsNullOrEmpty(text))
{
Context.AppTTSManager.ActiveEngine.Speak(text);
}
break;
}
_alphabetScannerCommon.OnWidgetActuated(widget, ref handled);
}
示例12: resolveWildCardReferences
/// <summary>
/// Resolves all widgets with wild card references (ends with an asterisk).
/// The format for a wild card reference is <widgetname>/* where widgnetname
/// is the parent widget and * represents all its children
/// Eg. Box1/* would resolve to Row1, Row2, Row3 and Row4
/// </summary>
/// <param name="rootWidget">The root widget of the scanner</param>
/// <param name="variables">variable references to resolve</param>
/// <param name="xmlNode">the xmlNode to parse</param>
private void resolveWildCardReferences(Widget rootWidget, Variables variables, XmlNode xmlNode)
{
var name = XmlUtils.GetXMLAttrString(xmlNode, "name");
if (name.Contains("*"))
{
Log.Debug("name=" + name);
var containerWidget = getContainerWidget(rootWidget, variables, name);
if (containerWidget != null)
{
Log.Debug("containerWidget: " + containerWidget.Name);
if (EvtResolveWidgetChildren != null)
{
EvtResolveWidgetChildren(this, new ResolveWidgetChildrenEventArgs(rootWidget, containerWidget, xmlNode));
}
foreach (var childWidget in containerWidget.Children)
{
Log.Debug("Found child name : " + childWidget.Name);
var animationWidget = createAndAddAnimationWidget(childWidget);
if (animationWidget != null)
{
animationWidget.Load(xmlNode);
}
}
}
}
}
示例13: resolveNonWildCardReferences
/// <summary>
/// Resolves non-wild card entries to their acutal names. For instance,
/// a @SelectedWidget would get resolved to the name of the widget that
/// is currently selected
/// </summary>
/// <param name="rootWidget">The root widget of the scanner</param>
/// <param name="variables">variable references to resolve</param>
/// <param name="xmlNode">the xmlNode to parse</param>
private void resolveNonWildCardReferences(Widget rootWidget, Variables variables, XmlNode xmlNode)
{
var name = XmlUtils.GetXMLAttrString(xmlNode, "name");
Log.Debug("name=" + name);
if (!String.IsNullOrEmpty(name) && !name.Contains("*"))
{
var widgetName = resolveName(variables, name);
Log.Debug("Resolved name : " + widgetName);
var uiWidget = rootWidget.Finder.FindChild(widgetName);
if (uiWidget != null)
{
Log.Debug("Found child name : " + widgetName);
var animationWidget = createAndAddAnimationWidget(uiWidget);
if (animationWidget != null)
{
animationWidget.Load(xmlNode);
}
}
else
{
Log.Debug("Did not find child " + widgetName);
}
}
return;
}
示例14: getContainerWidget
/// <summary>
/// Wild card names can be @variablename/* or widgetname/*. Parses
/// the string and returns the name of the container widget
/// </summary>
/// <param name="rootWidget">root widget of the scanner</param>
/// <param name="wildCard">wildcard to resolve</param>
/// <returns>container widget</returns>
private Widget getContainerWidget(Widget rootWidget, Variables variables, string wildCard)
{
Widget retVal = null;
String[] wildCardPatterns =
{
"\\@[a-zA-Z0-9]*/\\*", // @variablename/*
"[a-zA-Z0-9]*/\\*", // widgename/*"
"\\*" // *
};
String[] extractPatterns =
{
"\\@[a-zA-Z0-9]*",
"[a-zA-Z0-9]*",
"\\*"
};
bool done = false;
for (int ii = 0; !done && ii < wildCardPatterns.Length; ii++)
{
if (!Regex.IsMatch(wildCard, wildCardPatterns[ii]))
{
continue;
}
Match match = Regex.Match(wildCard, extractPatterns[ii]);
if (String.IsNullOrEmpty(match.Value))
{
continue;
}
done = true;
String widgetName;
switch (ii)
{
case 0:
widgetName = match.Value.Substring(1);
if (String.Compare(widgetName, Variables.SelectedWidget) == 0)
{
retVal = (Widget)variables.Get(Variables.SelectedWidget);
}
break;
case 1:
widgetName = match.Value;
if (String.Compare(widgetName, rootWidget.Name, true) == 0)
{
retVal = rootWidget;
}
else
{
retVal = rootWidget.Finder.FindChild(widgetName);
}
break;
case 2:
retVal = (Widget)variables.Get(Variables.SelectedWidget);
break;
}
}
return retVal;
}
示例15: createAndAddAnimationWidget
/// <summary>
/// Creates and adds an animation widget entry that will contain the
/// specified ui widget. UI widget represents a windows control
/// such as a button in the scanner. Raises an event that the
/// widget was added
/// </summary>
/// <param name="uiWidget">the ui widget</param>
/// <returns>animation widget</returns>
private AnimationWidget createAndAddAnimationWidget(Widget uiWidget)
{
var retVal = new AnimationWidget { UIWidget = uiWidget };
AnimationWidgetList.Add(retVal);
if (EvtAnimationWidgetAdded != null)
{
EvtAnimationWidgetAdded(this, new AnimationWidgetAddedEventArgs(retVal));
}
return retVal;
}