blockly > FlyoutButton

FlyoutButton 類別

彈出式視窗中的按鈕或標籤類別。

Signature:

export declare class FlyoutButton implements IBoundedElement, IRenderedElement, IFocusableNode 

實作: IBoundedElementIRenderedElementIFocusableNode

附註

這個類別的建構函式已標示為內部。第三方程式碼不應直接呼叫建構函式,或建立擴充 FlyoutButton 類別的子類別。

屬性

屬性 修飾符 類型 說明
BORDER_RADIUS static 數字 彈出式按鈕邊框的半徑。
cursorSvg SVGElement | null 當游標附加到按鈕時,會保留游標的 SVG 元素。如果按鈕上沒有游標,則為空值。
height 數字 按鈕的矩形高度。
資訊 toolbox.ButtonOrLabelInfo
TEXT_MARGIN_X static 數字 按鈕中文字的水平邊界。
TEXT_MARGIN_Y static 數字 按鈕中文字的垂直邊界。
width 數字 按鈕的矩形寬度。

方法

方法 修飾符 說明
canBeFocused() 請參閱 IFocusableNode.canBeFocused。
createDom()
dispose() 處置這個按鈕。
getBoundingRectangle() 傳回描述元素尺寸的受限元素座標。座標系統:工作區座標。
getButtonText()
getFocusableElement() 請參閱 IFocusableNode.getFocusableElement。
getFocusableTree() 請參閱 IFocusableNode.getFocusableTree。
getSvgRoot()
getTargetWorkspace() 取得按鈕的目標工作區。
getWorkspace() 取得按鈕的工作區。
isLabel()
moveBy(dx, dy, _reason) 以相對偏移量移動元素。
moveTo(x, y) 將按鈕移至指定的 x、y 座標。
onNodeBlur() 請參閱 IFocusableNode.onNodeBlur。
onNodeFocus() 請參閱 IFocusableNode.onNodeFocus。
setCursorSvg(cursorSvg) 將游標 SVG 新增至這個按鈕的 SVG 群組。
show() 正確放置彈出式按鈕,並讓按鈕顯示在畫面上。