I have tab containing a region. I use this code to add TIWCGJQMenu components to the region, but a vertical scroll bar does not appear when the region is filled.
Basically, the code adds TIWCGJQMenu components that have two TIWCGJQMenuItem components allowing the user to Open or Delete the file selected.
The region properties I think might affect whether or not the VerticalScrollBar is shown:
.Align = alClient;
.ClipRegion = True;
.VerticalScrollBar.Visible := True;
- Code: Select all
procedure TframeCaseFile.LoadCaseFileLinkedDocuments;
var
strFolder, strFilename, strCaption: String;
slLinkedDocuments: TStringList;
itemLinkedDocument: TIWCGJQMenu;
itemDocument: TIWCGJQMenuItem;
itemSubMenu: TIWCGJQMenuItem;
i: Integer;
begin
strFolder := UserSession.GetCaseFileLinkedDocumentsFolder(Self.FCaseFileNumber);
Self.fileUploadLinkedDocument.JQFileUploadOptions.UploadPath := strFolder;
Self.fileUploadLinkedDocument.JQFileUploadOptions.OnUpload.Indicator := Self.FLockIndicator;
ForceDirectories(strFolder);
slLinkedDocuments := TStringList.Create;
S2Snax.GetFileList(strFolder, True, '*.*', slLinkedDocuments);
Self.KillLinkedDocumentsList;
for i := 0 to slLinkedDocuments.Count - 1 do
begin
itemLinkedDocument := TIWCGJQMenu.Create(Self);
itemLInkedDocument.Parent := Self.regionLinkedDocuments;
itemLinkedDocument.Name := FindUniqueName;
itemLinkedDocument.Align := TAlign.alTop;
strFilename := slLinkedDocuments[i];
strCaption := '<html>' +
'<body>' +
'<div id="container" style="width:' + IntToStr(Self.regionLinkedDocuments.Width) + 'px">' +
'<div id="col1" style="width:'+IntToStr(Self.regionLinkedDocuments.Width div 2)+'px;float:left;">' +
ExtractFileName(strFilename) + '<br>' +
'</div>' +
'<div id="col2" style="width:'+IntToStr(Self.regionLinkedDocuments.Width div 4)+'px;float:left;">' +
FormatDateTime('MM/DD/YYYY HH:MM:SS AM/PM', S2Snax.GetFileDate(strFilename)) + '<br>' +
'</div>' +
'<div id="col3" style="width:'+IntToStr(Self.regionLinkedDocuments.Width div 4)+'px;float:left;">' +
S2Snax.RealToString(RoundTo(S2Snax.GetFileSize(strFilename) / 1024,-2)) + ' KB' + '<br>' +
'</div>' +
'</div>' +
'</body>' +
'</html>';
itemDocument := itemLInkedDocument.MenuItems.Add;
itemDocument.Caption := strCaption;
itemSubMenu := itemDocument.SubItems.Add;
itemSubMenu.Caption := 'Open ' + ExtractFilename(strFilename);
itemSubMenu.InternalData := strFilename;
itemSubMenu.OnClick.OnEvent := Self.LinkedDocumentOpenClick;
itemSubMenu := itemDocument.SubItems.Add;
itemSubMenu.Caption := 'Delete ' + ExtractFilename(strFilename);
itemSubMenu.OnClick.OnEvent := Self.LinkedDocumentDeleteClick;
itemSubMenu.InternalData := strFilename;
end;
end;
Am I missing something?
Thanks,
Scott