Rótulo do bloco declarado pela library (tb_type_block_set_label)

A library diz como o bloco aparece no editor ("liste as ferramentas de
%1", valores iniciais "a|b"); o editor usa a tabela dele quando conhece
o tipo e o rótulo da library quando não conhece. Assim uma library
carregada de fora não aparece só com o nome técnico.

Acessibilidade: aviso comum não repete "aviso" na descrição.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mguinhosandClaude Opus 5.5 committed 2026-10-23 07:50:39 -03:00
1 parent 8f046833e7
commit 2d580005b1
4 files changed
+33 -112

No files matched your search

+8
View File
@@ -78,6 +78,12 @@ struct TinyBlocks_TypeBlock {
(tb_block_get_input) quando e se quiser. Ex.: "tente obter", que
precisa ver o erro de dentro para transforma-lo em valor. */
bool lazy_inputs;
/* Rotulo no editor (strings estaticas da library; NULL = o editor decide):
texto com %1, %2... no lugar das entradas e os valores iniciais dos
campos separados por '|'. Ex.: "liste as ferramentas de %1". */
const char* label;
const char* label_defaults;
};
/* -- Forma e tracos --- */
@@ -86,6 +92,8 @@ TB_API void tb_type_block_set_flow (TinyBlocks_TypeBlock* tb, const TinyBlocks_F
TB_API void tb_type_block_set_flags(TinyBlocks_TypeBlock* tb, uint32_t flags); /* soma (OR) */
/* Chapeu disparado por um evento (string estatica, ex.: TB_EVENT_FLAG) */
TB_API void tb_type_block_set_event(TinyBlocks_TypeBlock* tb, const char* event);
/* Rotulo do bloco no editor (%N = entrada N) e valores iniciais "a|b|c" */
TB_API void tb_type_block_set_label(TinyBlocks_TypeBlock* tb, const char* label, const char* defaults);
TB_API void tb_type_block_set_input_flags (TinyBlocks_TypeBlock* tb, uint32_t i, uint32_t flags);
TB_API void tb_type_block_set_output_flags(TinyBlocks_TypeBlock* tb, uint32_t i, uint32_t flags);
TB_API uint32_t tb_type_block_input_flags (const TinyBlocks_TypeBlock* tb, uint32_t i);