Anveo Mobile App / Caratteristiche di base dell’applicazione / Didascalie delle mattonelle dinamiche nel menu principale
Questa è una traduzione automatica. Il messaggio originale è disponibile in Inglese.

Didascalie delle mattonelle dinamiche nel menu principale

La modifica dinamica delle didascalie delle tegole nel menu principale viene eseguita all’interno del menu principale corrispondente, all’interno del menu principale OnOpenMenMenu Trigger. In questo modo è possibile regolare l’icona, il colore e il testo della piastrella.

Icone/Colori

L’icona e il colore delle caselle del menu principale sono memorizzati nella tabella ACF Anveo Page Element Menu. Per modificare questi valori nell’applicazione, è necessario identificare prima la voce corrispondente nella tabella. Tutte le voci di menu che non appartengono ad una Anveo Page sono contrassegnate dal campo Codice Anveo Page vuoto.

local anveoPageElementMenu = Record('ACF Anveo Page Element Menu');

-- [[get Main Menu Entry for My Messages]]
anveoPageElementMenu:SETRANGE('Anveo Page Code','');
anveoPageElementMenu:SETRANGE('Action Code','');
anveoPageElementMenu:SETRANGE('Linked Anveo Page','ASLS_NOTIFICATIONS');
anveoPageElementMenu:FINDFIRST();

In questa voce, il simbolo e il colore di sfondo possono essere modificati dinamicamente cambiando i campi Background Color e Icon Description. Un esempio completo delle notifiche potrebbe assomigliare a questo:

local anveoPageElementMenu = Record('ACF Anveo Page Element Menu');
local ACFNotification = Record('ACF Notification');
local colorRed = '#bd3939';
local colorGreen = '#00b050';
local colorBlue = '#5b9bd5';
local colorGray = '#7c7c7c';

-- [[get Main Menu Entry for My Messages]]
anveoPageElementMenu:SETRANGE('Anveo Page Code','');
anveoPageElementMenu:SETRANGE('Action Code','');
anveoPageElementMenu:SETRANGE('Linked Anveo Page','ASLS_NOTIFICATIONS');
anveoPageElementMenu:FINDFIRST();
--[[check if there are unread Notifications]]
ACFNotification:SETRANGE('Status', 5);
if ACFNotification:ISEMPTY() then
--[[no unread messages]]
--[[set the background color to gray and set the symbol to "mail"]]
anveoPageElementMenu:SETVALUE('Background Color', colorGray);
anveoPageElementMenu:SETVALUE('Icon Description', 'mail');
anveoPageElementMenu:MODIFY(false);
else
--[[there are unread messages]]
--[[set the background color to red and set the symbol to "mail_open"]]
anveoPageElementMenu:SETVALUE('Background Color', colorRed);
anveoPageElementMenu:SETVALUE('Icon Description', 'mail_open');
anveoPageElementMenu:MODIFY(false);
end;

Testo

I testi per le voci del menu principale sono definiti nella tabella ACF Multilanguage. Sono identificati dal table number, dai campi PK e dalla language. Il campo contiene il testo visualizzato. Per la tabella ACF Anveo Page Element Menu (in cui sono memorizzati i riquadri del menu principale) questi possono essere trovati e modificati come segue:

local anveoPageElementMenu = Record('ACF Anveo Page Element Menu');
anveoPageElementMenu:SETRANGE('Anveo Page Code','');
anveoPageElementMenu:SETRANGE('Action Code','');
anveoPageElementMenu:SETRANGE('Linked Anveo Page','ASLS_NOTIFICATIONS');
anveoPageElementMenu:FINDFIRST();

--[[Get Multilanguage Entry for currently selected Language and Main Menu entry]]
local multilanguage = Record('ACF Multilanguage');
multilanguage:SETRANGE('PK Table No.', anveoPageElementMenu:GETTABLENO());
multilanguage:SETRANGE('Language', GLOBALLANGUAGECODE());
multilanguage:SETRANGE('PK No. 1', anveoPageElementMenu:GETVALUE('Anveo Page Element Line No.'));
multilanguage:SETRANGE('PK No. 2', anveoPageElementMenu:GETVALUE('Entry No.'));
multilanguage:FINDFIRST();
multilanguage:SETVALUE('Value','Hello World');
multilanguage:MODIFY(false);

Esempio di modifica della mattonella di notifica delle applicazioni Anveo Base Apps

L’esempio per le notifiche è il seguente, compresa la modifica dei testi:

local function changeText(anveoPageElementMenu,text)
--[[Get Multilanguage Entry for currently selected Language and Main Menu entry]]
local multilanguage = Record('ACF Multilanguage');
multilanguage:SETRANGE('PK Table No.', anveoPageElementMenu:GETTABLENO());
multilanguage:SETRANGE('Language', GLOBALLANGUAGECODE());
multilanguage:SETRANGE('PK No. 1', anveoPageElementMenu:GETVALUE('Anveo Page Element Line No.'));
multilanguage:SETRANGE('PK No. 2', anveoPageElementMenu:GETVALUE('Entry No.'));
multilanguage:FINDFIRST();
multilanguage:SETVALUE('Value',text);
multilanguage:MODIFY(false);
end;

local anveoPageElementMenu = Record('ACF Anveo Page Element Menu');
local ACFNotification = Record('ACF Notification');
local colorRed = '#bd3939';
local colorGreen = '#00b050';
local colorBlue = '#5b9bd5';
local colorGray = '#7c7c7c';

-- [[get Main Menu Entry for My Messages]]
anveoPageElementMenu:SETRANGE('Anveo Page Code','');
anveoPageElementMenu:SETRANGE('Action Code','');
anveoPageElementMenu:SETRANGE('Linked Anveo Page','ASLS_NOTIFICATIONS');
anveoPageElementMenu:FINDFIRST();
--[[check if there are unread Notifications]]
local total = ACFNotification:COUNT();
ACFNotification:SETRANGE('Status', 5);
local unread = ACFNotification:COUNT();
if ACFNotification:ISEMPTY() then
--[[no unread messages]]
--[[set the background color to gray and set the symbol to "mail"]]
anveoPageElementMenu:SETVALUE('Background Color', colorGray);
anveoPageElementMenu:SETVALUE('Icon Description', 'mail');
anveoPageElementMenu:MODIFY(false);
--[[change Text accordingly]]
changeText(anveoPageElementMenu,GETTEXT('ASLS_NOTIFICATIONS',total));
else
--[[there are unread messages]]
--[[set the background color to red and set the symbol to "mail_open"]]
anveoPageElementMenu:SETVALUE('Background Color', colorRed);
anveoPageElementMenu:SETVALUE('Icon Description', 'mail_open');
anveoPageElementMenu:MODIFY(false);
--[[change Text accordingly]]
changeText(anveoPageElementMenu,GETTEXT('ASLS_NOTIFICATIONS_UNREAD',total,unread));
end;