📄 focusmanager.as
字号:
if (_loc3 == _loc2)
{
_loc7 = true;
break;
} // end if
_loc3 = _loc3._parent;
} // end while
if (_loc7 == false)
{
_prevNode = _lastx;
} // end if
} // end if
_needPrev = false;
if (_nextNode == undefined)
{
_nextIsNext = true;
} // end if
}
else if (!(_loc2.focusManager != undefined && _loc2.focusManager._parent == _loc2))
{
if (_loc2._searchKey == _searchKey)
{
continue;
} // end if
_loc2._searchKey = _searchKey;
this.getTabCandidateFromChildren(_loc2, index, groupName, dir, _loc5 && firstChild);
} // end else if
_loc5 = false;
} // end if
} // end of for...in
_lastNode = _lastx;
if (lookup)
{
if (p._parent != undefined)
{
if (p != _parent)
{
if (_prevNode == undefined && dir)
{
_needPrev = true;
}
else if (_nextNode == undefined && !dir)
{
_nextIsNext = false;
} // end else if
_lastTarget = _lastTarget._parent;
this.getTabCandidate(p._parent, index, groupName, dir, true);
} // end if
} // end if
} // end if
} // End of the function
function getTabCandidate(o, index, groupName, dir, firstChild)
{
var _loc2;
var _loc3 = true;
if (o == _parent)
{
_loc2 = o;
_loc3 = false;
}
else
{
_loc2 = o._parent;
if (_loc2 == undefined)
{
_loc2 = o;
_loc3 = false;
} // end if
} // end else if
this.walkTree(_loc2, index, groupName, dir, _loc3, firstChild);
} // End of the function
function getTabCandidateFromChildren(o, index, groupName, dir, firstChild)
{
this.walkTree(o, index, groupName, dir, false, firstChild);
} // End of the function
function getFocusManagerFromObject(o)
{
while (o != undefined)
{
if (o.focusManager != undefined)
{
return (o.focusManager);
} // end if
o = o._parent;
} // end while
return;
} // End of the function
function tabHandler(Void)
{
bDrawFocus = true;
var _loc5 = this.getSelectionFocus();
var _loc4 = this.getActualFocus(_loc5);
if (_loc4 != _loc5)
{
_loc5 = _loc4;
} // end if
if (this.getFocusManagerFromObject(_loc5) != this)
{
_loc5 == undefined;
} // end if
if (_loc5 == undefined)
{
_loc5 = form;
}
else if (_loc5.tabIndex != undefined)
{
if (_foundList != undefined || _foundList.tabIndex != _loc5.tabIndex)
{
_foundList = new Object();
_foundList.tabIndex = _loc5.tabIndex;
} // end if
_foundList[_loc5._name] = _loc5;
} // end else if
var _loc3 = Key.isDown(16) != true;
_searchKey = getTimer();
_needPrev = true;
_nextIsNext = false;
_lastx = undefined;
_firstNode = undefined;
_lastNode = undefined;
_nextNode = undefined;
_prevNode = undefined;
_firstObj = undefined;
_lastObj = undefined;
_nextObj = undefined;
_prevObj = undefined;
_lastTarget = _loc5;
var _loc6 = _loc5;
this.getTabCandidate(_loc6, _loc5.tabIndex == undefined ? (0) : (_loc5.tabIndex), _loc5.groupName, _loc3, true);
var _loc2;
if (_loc3)
{
if (_nextObj != undefined)
{
_loc2 = _nextObj;
}
else
{
_loc2 = _firstObj;
} // end else if
}
else if (_prevObj != undefined)
{
_loc2 = _prevObj;
}
else
{
_loc2 = _lastObj;
} // end else if
if (_loc2.tabIndex != _loc5.tabIndex)
{
_foundList = new Object();
_foundList.tabIndex = _loc2.tabIndex;
_foundList[_loc2._name] = _loc2;
}
else
{
if (_foundList == undefined)
{
_foundList = new Object();
_foundList.tabIndex = _loc2.tabIndex;
} // end if
_foundList[_loc2._name] = _loc2;
} // end else if
if (_loc2 == undefined)
{
if (_loc3 == false)
{
if (_nextNode != undefined)
{
_loc2 = _nextNode;
}
else
{
_loc2 = _firstNode;
} // end else if
}
else if (_prevNode == undefined || _loc5 == form)
{
_loc2 = _lastNode;
}
else
{
_loc2 = _prevNode;
} // end else if
} // end else if
if (_loc2 == undefined)
{
return;
} // end if
lastTabFocus = _loc2;
this.setFocus(_loc2);
if (_loc2.emphasized != undefined)
{
if (defPushButton != undefined)
{
_loc5 = defPushButton;
defPushButton = _loc2;
_loc5.emphasized = false;
_loc2.emphasized = true;
} // end if
}
else if (defPushButton != undefined && defPushButton != __defaultPushButton)
{
_loc5 = defPushButton;
defPushButton = __defaultPushButton;
_loc5.emphasized = false;
__defaultPushButton.__set__emphasized(true);
} // end else if
} // End of the function
function onKeyDown(Void)
{
mx.managers.SystemManager.idleFrames = 0;
if (defaultPushButtonEnabled)
{
if (Key.getCode() == 13)
{
if (this.__get__defaultPushButton() != undefined)
{
this.doLater(this, "sendDefaultPushButtonEvent");
} // end if
} // end if
} // end if
} // End of the function
function sendDefaultPushButtonEvent(Void)
{
defPushButton.dispatchEvent({type: "click"});
} // End of the function
function getMousedComponentFromChildren(x, y, o)
{
for (var _loc7 in o)
{
var _loc2 = o[_loc7];
if (_loc2._visible && _loc2.enabled && _loc2._parent == o && _loc2._searchKey != _searchKey)
{
_loc2._searchKey = _searchKey;
if (_loc2.hitTest(x, y, true))
{
if (_loc2.onPress != undefined || _loc2.onRelease != undefined)
{
return (_loc2);
} // end if
var _loc3 = this.getMousedComponentFromChildren(x, y, _loc2);
if (_loc3 != undefined)
{
return (_loc3);
} // end if
return (_loc2);
} // end if
} // end if
} // end of for...in
return;
} // End of the function
function mouseActivate(Void)
{
if (!bNeedFocus)
{
return;
} // end if
_searchKey = getTimer();
var _loc2 = this.getMousedComponentFromChildren(lastMouse.x, lastMouse.y, form);
if (_loc2 instanceof mx.core.UIComponent)
{
return;
} // end if
_loc2 = this.findFocusFromObject(_loc2);
if (_loc2 == lastFocus)
{
return;
} // end if
if (_loc2 == undefined)
{
this.doLater(this, "restoreFocus");
return;
} // end if
var _loc3 = _loc2.hscroll;
if (_loc3 != undefined)
{
var _loc6 = _loc2.scroll;
var _loc5 = _loc2.background;
} // end if
this.setFocus(_loc2);
var _loc4 = Selection;
Selection.setSelection(_loc4.lastBeginIndex, _loc4.lastEndIndex);
if (_loc3 != undefined)
{
_loc2.scroll = _loc6;
_loc2.hscroll = _loc3;
_loc2.background = _loc5;
} // end if
} // End of the function
function _onMouseDown(Void)
{
bDrawFocus = false;
if (lastFocus != undefined)
{
lastFocus.drawFocus(false);
} // end if
mx.managers.SystemManager.idleFrames = 0;
var _loc3 = Selection;
_loc3.lastBeginIndex = Selection.getBeginIndex();
_loc3.lastEndIndex = Selection.getEndIndex();
lastMouse.x = _root._xmouse;
lastMouse.y = _root._ymouse;
_root.localToGlobal(lastMouse);
} // End of the function
function onMouseUp(Void)
{
if (_visible)
{
this.doLater(this, "mouseActivate");
} // end if
} // End of the function
function handleEvent(e)
{
if (e.type == "reveal")
{
mx.managers.SystemManager.activate(form);
}
else
{
mx.managers.SystemManager.deactivate(form);
} // end else if
} // End of the function
static function enableFocusManagement()
{
if (!mx.managers.FocusManager.initialized)
{
initialized = true;
Object.registerClass("FocusManager", mx.managers.FocusManager);
if (_root.focusManager == undefined)
{
_root.createClassObject(mx.managers.FocusManager, "focusManager", mx.managers.DepthManager.highestDepth--);
} // end if
} // end if
} // End of the function
static var symbolName = "FocusManager";
static var symbolOwner = mx.managers.FocusManager;
static var version = "2.0.1.78";
var className = "FocusManager";
var bNeedFocus = false;
var bDrawFocus = false;
var defaultPushButtonEnabled = true;
var activated = true;
static var initialized = false;
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
} // End of Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -