// Copyright (C) 2024 Robert J.A. Wagner; Am Kiefernwald 49b; D-64297 Darmstadt - All Rights Reserved 
import { supply_DefaultContact, hoNotUSER, hoNotCLERK } from "./lib/contact.mjs";


export default class toApp {
    formContact() {
        let formContact = XRW.mkForm({ FID: 'formContact', ynCreateFolder: 'N', folder: this.folder, ynCreateRender: 'Y', renderType: 'Form', pageX: 25, anchor: 'grForm' });
        formContact.setFEG("User", supply_DefaultContact());
        formContact.setSection("S1",
            { FEG_Prefix: "User", FEG_Title: "Kontakt", ynVolatile: 'Y' },
        );
        return formContact;
    }
    formMyFormDemo() {
        let formMyFormDemo = XRW.mkForm({ FID: 'formMyFormDemo', ynCreateFolder: 'N', folder: this.folder, ynCreateRender: 'Y', renderType: 'Form', pageX: 25, minPixelPerPoint: 20, anchor: 'grForm' });
        formMyFormDemo.setFEG('User',
            { FE_Prefix: 'GenericString', FGM_Key: 'USR_LastName', FGM_Format: "dX1,W11,Vitem", FE_Title: 'Nachname', ynfOptional, SEautoValue: '$profile()' },
            { FE_Prefix: 'GenericString', FGM_Key: 'USR_FirstName', FGM_Format: "dX1,W11,Vitem,N,dY1", FE_Title: 'Vorname', ynfOptional, SEautoValue: '$profile()' },
        );
        formMyFormDemo.setSection("S1", { FEG_Prefix: "User", FEG_Title: "Demo", ynVolatile: 'Y' });
        return formMyFormDemo;
    }

    async Start() {
        this.folder = XRW.mkFolder();
        // this.formContact();
        this.formMyFormDemo();
        await XRW.windowResizeCallBack();
    }
}
globalThis.oApp = new toApp();
