סקר מחקר: נשמח לשמוע על החוויה שלך עם Blockly
לפתיחת הסקר
blockly > סמלים > WarningIcon
מחלקה Icon.WarningIcon
סמל שמזהיר את המשתמש שמשהו השתבש בבלוק שלו.
לדוגמה, אפשר להשתמש בכך כדי להזהיר אותם לגבי ערכי שדות שגויים או מיקום שגוי של הבלוק (ולהציב אותו במקום שלא שייך לו).
Signature:
export declare class WarningIcon extends Icon implements IHasBubble
הרחבה: סמל
הטמעות: IHasBubble
ה-constructor של המחלקה הזו מסומן כפנימי. אסור לקוד של צד שלישי לקרוא ישירות ל-constructor או ליצור מחלקות משנה שמרחיבות את המחלקה WarningIcon
.
מאפיינים
נכס |
גורמי שינוי |
סוג |
תיאור |
sourceBlock |
protected
readonly
|
BlockSvg |
|
סוג |
static
readonly
|
IconType<WarningIcon> |
מחרוזת הסוג שמשמשת לזיהוי הסמל הזה. |
משקל |
static
readonly
|
(לא מוצהר) |
המשקל של הסמל הזה ביחס לסמלים אחרים. סמלים בעלי ערכי משקל חיוביים יותר מוצגים רחוק יותר לקראת סוף הבלוק. |
שיטות
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-09-12 (שעון UTC).
[null,null,["עדכון אחרון: 2024-09-12 (שעון UTC)."],[[["The `WarningIcon` class in Blockly is used to display a warning icon on blocks, indicating potential issues like incorrect field values or placement."],["This icon is visually represented by a warning symbol and can have an associated bubble to provide more detailed information."],["The `WarningIcon` inherits from the `Icon` class and implements the `IHasBubble` interface, allowing it to display and manage a warning bubble."],["Developers should not directly instantiate or extend the `WarningIcon` class, as its constructor is marked as internal."],["The icon's weight property influences its rendering position relative to other icons on the block."]]],["The `WarningIcon` class, extending `Icon` and implementing `IHasBubble`, alerts users to issues with a block, such as incorrect values or placement. It has properties like `sourceBlock`, `TYPE`, and `WEIGHT`. Key methods include `onClick` to toggle bubble visibility, `onLocationChange` to update the bubble's position, and `isShownWhenCollapsed` to determine if it's visible when the block is collapsed. This class should not be constructed or extended directly by third-party code.\n"]]