PowerClient new features

The following are PowerClient-specific new features.

Loading images via URL

Images can also be loaded through an URL address now (not only via a file path). Currently only URLs starting with http and https are supported.

However, not all project types support loading images via URL, only PowerClient- and PowerServer-deployed applications support it.

And not all objects/controls can load images via URL; only the objects/controls listed below can (those not listed below can still load images via file paths):

Object/Control

Property/Function

Usage

DataWindow object > Button control

Filename property

In a painter: In the control's Properties view > General page > Picture File field, enter the URL of the picture file.

In scripts: dw_1.Object.b_1.filename = "http://172.16.5.175/button2.jpg"

DataWindow object > Column control

BitmapName property

In a painter: In the control's Properties view > General tab, select the Display As Picture option and then enter the URL of picture file in the rows provided below.

In scripts: dw_1.setitem(1,2,"http://172.16.5.175/button2.jpg")

DataWindow object > Computed Field control

Expression property

In a painter: In the control's Properties view > General page > Compute Expression field, enter the Bitmap expression function and the URL of the picture file, for example, Bitmap("http://172.16.5.175/computed2.jpg")

In scripts: dw_1.Object.compute_1.Expression = "bitmap('http://172.16.5.175/computed2.jpg')"

DataWindow object > Picture control

Filename property

In a painter: In the control's Properties view > General page > File Name field, enter the URL of the picture file.

In scripts: dw_1.Object.p_1.filename = "http://172.16.5.175/picture2.jpg"

Picture control

PictureName property

In a painter: In the control's Properties view > General page > PictureName field, enter the URL of the picture file.

In scripts: p_1.PictureName = "http://172.16.5.175/tang.jpg"

PictureButton control

PictureName property

In a painter: In the control's Properties view > General page > PictureName field, enter the URL of the picture file.

In scripts: pb_1.PictureName = "http://172.16.5.175/tang.jpg"

PictureHyperlink control

PictureName property

In a painter: In the control's Properties view > General page > PictureName field, enter the URL of the picture file.

In scripts: phl_1.PictureName = "http://172.16.5.175/tang.jpg"

PictureListBox control

AddPicture (picturename) function

In scripts: li_pic = plb_1.AddPicture("http://172.16.5.175/picturelistbox3.jpg")

PictureName[ ] property

In a painter: In the control's Properties view > Pictures tab > Picture Name field, enter the URL of the picture file.

DropdownPictureListBox control

AddPicture (picturename) function

In scripts: li_pic = ddplb_1.AddPicture("http://172.16.5.175/dropdownpicturelistbox2.jpg")

PictureName[ ] property

In a painter: In the control's Properties view > Pictures tab > Picture Name field, enter the URL of the picture file.

Tab control > TabPage

PictureName property

In a painter: In the user object's Properties view > TabPage page > PictureName field, enter the URL of the picture file.

In scripts: tab_1.tabpage_1.PictureName = "http://172.16.5.175/tabpage2.jpg"

Menu object > Submenu item

MenuImage property

In a painter: In the submenu item's Properties view > General page > MenuImage field, enter the URL of the picture file.

In scripts: m_webpicture.m_test.m_test1.MenuImage = "http://172.16.5.175/backgroud.bmp"

ToolbarItemName and ToolbarItemDownName properties

In a painter: In the submenu item's Properties view > Toolbar page > ToolbarItemName field and ToolbarItemDownName field, enter the URL of the picture file.

In scripts: m_webpicture.m_test.m_test1.ToolbarItemName = "http://172.16.5.175/backgroud.bmp"

ListView control

LargePictureName property

In a painter: In the ListView control's Properties view > Large Picture page > LargePictureName field, enter the URL of the picture file.

AddLargePicture (picturename) function

In scripts: lv_1.AddLargePicture("http://172.16.5.175/backgroud.bmp")

SmallPictureName property

In a painter: In the ListView control's Properties view > Small Picture page > SmallPictureName field, enter the URL of the picture file.

AddSmallPicture (picturename) function

In scripts: lv_1.AddSmallPicture("http://172.16.5.175/listview.jpg")

StatePictureName property

In a painter: In the ListView control's Properties view > State page > StatePictureName field, enter the URL of the picture file.

AddStatePicture (picturename) function

In scripts:

integer index

listviewitem lvi_1

lv_1.GetItem(lv_1.SelectedIndex (), lvi_1)

index = lv_1.AddStatePicture("http://172.16.5.175/listview.jpg")

lvi_1.StatePictureIndex = index

lv_1.SetItem(lv_1.SelectedIndex (), lvi_1)

TreeView control

PictureName[ ] property

In a painter: In the TreeView control's Properties view > Pictures page > PictureName field, enter the URL of the picture file.

AddPicture (picturename) function

In scripts:

long ll_tvi

integer li_pic

li_pic = tv_1.AddPicture("http://172.16.5.175/treeview.jpg")

ll_tvi = tv_1.FindItem(RootTreeItem!, 0)

tv_1.InsertItemFirst(ll_tvi, "New", li_pic)

StatePictureName property

In a painter: In the TreeView control's Properties view > State page > StatePictureName field, enter the URL of the picture file.

AddStatePicture (picturename) function

In scripts:

integer index

treeviewitem tv_item1

index = tv_1.AddStatePicture("http://172.16.5.175/treeview.jpg")

tv_item1.StatePictureIndex = index


You can get and set the following settings for pictures loaded via URL:

  • CloudAppSet -- Configures the following settings for pictures loaded via URL in PowerServer/PowerClient-deployed applications: 1) the picture cache directory, 2) whether to delete pictures from the cache when the application is closed, 3) whether to check picture for update. For more information, refer to CloudAppSet.

    CloudAppSet ("picturecachepath", "/picturecache");
    CloudAppSet ("clearpicturecacheonclose", "true");
    CloudAppSet ("checkpictureforupdate", "true");
  • CloudAppGet -- Gets the following settings for pictures loaded via URL in PowerServer/PowerClient-deployed applications, 1) the picture cache directory, 2) whether to delete pictures from the cache when the application is closed, 3) whether to check picture for update. For more information, refer to CloudAppGet.

    CloudAppGet ("picturecachepath", strValue1);
    CloudAppGet ("clearpicturecacheonclose", strValue2);
    CloudAppGet ("checkpictureforupdate", strValue3);
    

Note that

1) The retry interval for picture download is 30 seconds, and the retry times is 3.

2) If pictures cannot be downloaded successfully, a webpicture.log file will be generated in the "Log" folder of the current application directory.

Signing improvements

Supports token-based certificates

You can digitally sign the following executable files using the token-based certificate (in addition to the PFX certificate) when deploying the application:

  • PowerClient/PowerServer-deployed application executable file

  • Cloud app launcher

To configure signing with the token-based certificate, you should set Certificate Type to Token-based in the project painter, and then specify the SignTool location, certificate thumbprint, signature algorithm, and URL of the time stamp server. For more information, refer to the section called “Security page” in Users Guide.

Supports dynamic parameters

When you sign by a script file, you can pass parameters dynamically now.

For example, you can create a cmd file which contains scripts like this:

%1 sign /a /fd sha256 /sha1 %2 /tr %3 /td sha256 %4

And then in the "Use your own signing script" field, input the file path of the cmd file and the parameter values (using Microsoft’s SignCode for example):

"D:\2022R3\test\testparam.cmd" "D:\2022R3\test\signcode.exe" "13731a37233bbd83eeb13e95c7898d1d76a2256c" "http://timestamp.digicert.com" "salesdemo_local.exe"

For more information, refer to the section called “Security page” in Users Guide.

commandline argument saving option (in pbapp.ini)

If the commandline argument is specified on the client, in the URL or desktop shortcut, and if you want to save the argument in pbapp.ini for future access, you can select the "Save the argument(s) in the pbapp.ini file for future access" option in the PowerClient project painter > Startup page > Advanced tab.

By default, the arguments will not be saved to the pbapp.ini file.

Getting the deployment version via CloudAppGet

The CloudAppGet function can get the deployment version (such as 1.01, 1.02 etc.) of the PowerClient/PowerServer-deployed applications.

CloudAppGet ("deploymentversion", strValue4);