Рабочий пример для АХ 2012 (Протестировано на R2)
X++:
public static void handleSysSetupFormRunRunPost(XppPrePostArgs _args)
{
#define.DEV('DEV')
#define.UAT('UAT')
#define.PRD('PRD')
int colorDEV = WinAPI::RGBCon2int([230, 240, 255]);
int colorUAT = WinAPI::RGBCon2int([240, 255, 235]);
int colorPRD = WinAPI::RGBCon2int([255, 240, 240]);
int r, g, b;
xSession xSession = new xSession();
SysSQLSystemInfo systemInfo = SysSQLSystemInfo::construct();
//TempStr id = xSession.AOSName(); systemInfo.getLoginServer(); systemInfo.getloginDatabase();
FormDesign design = _args.getThis().design();
FormRun formRun = _args.getThis();
boolean paintBackground = false;
boolean paintStatusBar = true;
TempStr curEnv = #DEV;
int curColor = colorDEV;
//curEnv = (id == '') ? #DEV : (id == '') ? #UAT : #PRD;
if (paintBackground)
{
design.colorScheme(FormColorScheme::RGB);
design.backgroundColor(curColor);
}
if (paintStatusBar)
{
[r,g , b] = WinAPI::RGBint2Con(curColor);
formRun.setStatusBarBackgroundColor(254, r, g, b);
}
if (design.caption())
{
design.caption(curEnv + ' - ' + design.caption());
}
}