مصادر الإدخال المضمّنة في مقابل مصادر الإدخال الخارجية
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يمكن عرض المدخلات بشكل مضمّن أو خارجي. تتحكّم هذه السمة في ما إذا كان سيتم عرض أدوات الربط الخاصة بمدخلات القيم داخل الكتلة (في السطر) أو على الحافة الخارجية (خارجية)، بالإضافة إلى ما إذا كان سيتم عرض المدخلات في الصف نفسه أو في صفوف مختلفة.

يمكن أن يحدّد تعريف الحظر قيمة منطقية اختيارية تتحكّم في ما إذا كانت المدخلات مضمّنة أم لا.
JSON
{
// ...,
"inputsInline": true
}
JavaScript
init: function() {
// ...
this.setInputsInline(true);
}
عند ضبط قيمة هذا البولياني على true
(عمليات الإدخال المضمّنة):
- يتم عرض موصلات إدخالات القيم داخل الكتلة.
- يتم عرض إدخالات العبارات في صفها الخاص.
- يتم عرض الإدخالات الوهمية وإدخالات نهاية الصف وإدخالات القيم في الصف نفسه، باستثناء أي إدخال يتبع عبارة أو إدخال نهاية الصف، إذ يتم عرضه في صف جديد.
عند ضبطه على false
(مصادر الإدخال الخارجية):
- يتم عرض موصلات إدخالات القيم على الحافة الخارجية للكتلة.
- يتم عرض جميع الإدخالات في صف خاص بها، باستثناء إدخال نهاية الصف الذي يلي إدخالًا وهميًا، إذ يتم عرضه في الصف نفسه الذي يظهر فيه الإدخال الوهمي.
إذا كنت تواجه صعوبة في تصوّر ذلك، يمكنك إنشاء مربّعات في أدوات المطوّرين في Blockly واختيار إعدادات مختلفة من القائمة المنسدلة inputs
(automatic
وexternal
وinline
).
في حال عدم تحديد قيمة منطقية، سيستخدم Blockly بعض الإرشادات التوجيهية لتخمين الوضع الأفضل. بافتراض أنّ Blockly يحدّد الخيار المناسب، من الأفضل ترك هذا الحقل بدون تحديد قيمة، لأنّه يمكن أن تتضمّن ترجمات اللغات المختلفة أوضاعًا مختلفة تلقائيًا. يمكنك الاطّلاع على مثال عن "set %1 to %2"
(المدخلات الخارجية) و"put %2 in %1"
(المدخلات المضمّنة) في ترتيب الرموز المميزة للاستيفاء.
استخدِم الإدخالات المضمّنة عندما يكون من المحتمل أن يحتوي أحد المربّعات على إدخالات صغيرة مثل الأرقام.
يمكن للمستخدم تفعيل هذا الخيار أو إيقافه من خلال قائمة السياق.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Inline vs. external inputs\n\nInputs can be rendered **inline** or **externally**. This controls whether the\nconnectors for value inputs are rendered inside the block (inline) or on the\noutside edge (external), as well as whether inputs are rendered in the same or\ndifferent rows.\n\nThe block definition can specify an optional boolean controlling whether inputs\nare inline or not. \n\n### JSON\n\n {\n // ...,\n \"inputsInline\": true\n }\n\n### JavaScript\n\n init: function() {\n // ...\n this.setInputsInline(true);\n }\n\nWhen this boolean is set to `true` (inline inputs):\n\n- The connectors for value inputs are rendered inside the block.\n- Statement inputs are rendered on their own row.\n- Dummy, end-of-row, and value inputs are all rendered in the same row, except that any input following a statement or end-of-row input is rendered on a new row.\n\nWhen it is set to `false` (external inputs):\n\n- The connectors for value inputs are rendered on the outside edge of the block.\n- All inputs are rendered in their own row, except that an end-of-row input that follows a dummy input is rendered in the same row as the dummy input.\n\nIf you're having trouble visualizing this, construct blocks in the\n[Blockly Developer Tools](https://google.github.io/blockly-samples/examples/developer-tools/index.html) and choose different settings for the\n`inputs` dropdown (`automatic`, `external`, `inline`).\n\nIf this boolean is not defined then Blockly will use some heuristics to guess\nwhich mode is\nbest. Assuming Blockly makes the right choice, leaving this field undefined\nis preferable since different language translations can automatically have\ndifferent modes. See the example of `\"set %1 to %2\"` (external inputs) and\n`\"put %2 in %1\"` (inline inputs) in [Interpolation token\norder](/blockly/guides/create-custom-blocks/define/structure-json#interpolation_token_order).\n\nUse inline inputs when a block is likely to have small inputs such as numbers.\nThe user can toggle this option through the context menu."]]