مربع الأدوات
يحتوي صندوق الأدوات على الكتل التي تستخدمها في البرمجة. يمكن
سحب الكتل إلى مساحة العمل.
لمزيد من المعلومات حول شكل صندوق الأدوات، يمكنك الاطّلاع على مسرد المصطلحات المرئية.
التعريف الأساسي
يحدِّد تعريف صندوق الأدوات الكتل التي يتم تضمينها في صندوق الأدوات، و
الترتيب الذي يتم تضمينها به. يتم تحديد معظم مظهر وأسلوب صندوق الأدوات بطرق
أخرى.
ننصحك بتحديد مجموعة الأدوات باستخدام تنسيق JSON.
يحدِّد مقتطف الرمز هذا صندوق أدوات منبثقًا يتضمّن وحدتَين:
const toolbox = {
// There are two kinds of toolboxes. The simpler one is a flyout toolbox.
kind: 'flyoutToolbox',
// The contents is the blocks and other items that exist in your toolbox.
contents: [
{
kind: 'block',
type: 'controls_if'
},
{
kind: 'block',
type: 'controls_whileUntil'
}
// You can add more blocks to this array.
]
};
// The toolbox gets passed to the configuration struct during injection.
const workspace = Blockly.inject('blocklyDiv', {toolbox: toolbox});

لمزيد من المعلومات عن كيفية تحديد مجموعة الأدوات وضبطها، راجِع نظرة عامة على مجموعة الأدوات.
للحصول على مزيد من المعلومات حول الإضافة، يُرجى الاطّلاع على إنشاء Workspace.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-11-04 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-11-04 (حسب التوقيت العالمي المتفَّق عليه)"],[[["The Blockly toolbox houses programming blocks that users can drag onto the workspace to build programs."],["Toolboxes are typically defined using JSON to specify which blocks are included and their arrangement."],["The provided code snippet demonstrates creating a basic flyout toolbox containing 'controls_if' and 'controls_whileUntil' blocks."],["Further information regarding toolbox configuration and workspace injection can be found in the linked resources."]]],["The toolbox, containing program blocks, is defined using JSON and can be dragged onto the workspace. A flyout toolbox, a simpler type, is specified by its `kind` and `contents`. The `contents` array lists blocks, defined by their `kind` and `type`, such as `controls_if` and `controls_whileUntil`. This toolbox definition is then passed to the configuration during the workspace injection process using `Blockly.inject`.\n"]]