big5
void addPicBox()
{
FormWindowControl c;
DocuRef tmpDocuRef;
Image tmpImage;
int i = 1;
int j, maxControl;
container tmpBitmap;
;
element.lock();
maxControl = groupPics.controlCount(); //获取groupPics的控件数量
picCon = connull();
originalView.imageName('');
while select tmpDocuRef index RecIdx
where tmpDocuRef.RefCompanyId == nj_ItemPhotoTable.DataAreaId
&& tmpDocuRef.RefTableId == nj_ItemPhotoTable.TableId
&& tmpDocuRef.RefRecId == nj_ItemPhotoTable.RecId
&& tmpDocuRef.TypeId == 'Photo'
{
tmpBitmap = DocuImgS::find(tmpDocuRef.RecId).Image;
if (connull() == tmpBitmap)
continue;
tmpImage = new Image();
if (i > maxControl)
{
c = groupPics.addControl(FormControlType::Image, "RunTimeControl");
c.labelPosition(1);
c.labelAlignment(2);
c.imagemode(2);
controlCon += [c.id()];
}
else
c = this.control(conpeek(controlCon,i));
c.visible(true);
c.label(strfmt('%1', tmpDocuRef.Nj_PhotoView));// 图片类型(角度、平面、侧面。。。)
tmpImage.setData(tmpBitmap);
c.image(tmpImage);
picCon += [c.id(), tmpDocuRef.RecId];
i++;
}
for (j = i; j<=maxControl; j++)
{
c = this.control(conpeek(controlCon, j));
c.visible(false);
}
this.controlMethodOverload(true);
select tmpDocuRef index RecIdx
where tmpDocuRef.RefCompanyId == nj_ItemPhotoTable.DataAreaId
&& tmpDocuRef.RefTableId == nj_ItemPhotoTable.TableId
&& tmpDocuRef.RefRecId == nj_ItemPhotoTable.RecId
&& tmpDocuRef.TypeId == 'Video';
ButtonVideo.enabled(tmpDocuRef.RecId != 0);
element.unLock();
element.redraw();
}