Author Topic: View command with relative positioning  (Read 6411 times)

Benjamin Dasari

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 95
    • View Profile
View command with relative positioning
« on: October 02, 2019, 03:07:39 PM »
Purpose:
Using the 'view' command with relative positioning.

NOTE::
The usual 'offset' option does not work with view command, instead we use the 'getCoords' function. Make sure this function is loaded before the call.

Liquid UI Code:
----------------------------------------------------------------------------------------------------------------------------------------------
Script File Name: SAPLCOIH.E0101.sjs       // IW32 Initial screen
----------------------------------------------------------------------------------------------------------------------------------------------
// User Interface
box("F[Order]+[5,0]","F[Order]+[28,120]","Testing View");
pushbutton("F[Order]+[2,0]","View WITH relative positioning","?",{"size":[2,24],"process":viewTest,"using":{"PTYPE":"WITHREL"}});
pushbutton("F[Order]+[2,30]","View W/O relative positioning","?",{"size":[2,24],"process":viewTest,"using":{"PTYPE":"WITHOUTREL"}});

if(z_iw32_scr == "WITHREL"){
   //Below relative positioning does not work, instead use the one that is uncommented
   //view("F[Order]+[6,1]","F[Order]+[27,118]","http://www.guixt.com/");
   view(getCoords("F[Order]", [6,1]), getCoords("F[Order]", [27,118]), "http://www.guixt.com/");
} else if(z_iw32_scr == "WITHOUTREL"){   
   view([9,2],[30,118],"http://www.guixt.com/");
}


// Related Functions
function viewTest(param){
   onscreen "SAPLCOIH.0101"
      set("V[z_iw32_scr]",param.PTYPE);
      enter('?');
}

function getCoords(field, offset){
   return [<field>.pos[0] + offset[0], <field>.pos[1] + offset[1]];
}


See attachments for code samples!

« Last Edit: October 02, 2019, 05:56:05 PM by Benjamin Dasari »