支持cxcheckbox

This commit is contained in:
sgwp 2024-10-22 10:10:46 +08:00
parent 1e867f1d48
commit e76a145688

View File

@ -273,13 +273,15 @@ var
combox:TcxCombobox;
cxDateEdit:TcxDateEdit;
cxButtonEdit:TcxButtonEdit;
cxCheckBox:TcxCheckBox;
mwidth,i,j,cnt:integer;
mdesignCode :String;
begin
mdesignCode := fDllFileName +'|'+layOut.Parent.name+ '|' + intTostr(formId) + '|' + gridName;
layOut.BeginUpdate; // Postpones updates
try
with AdoTmp do begin close;
sql.Clear;
sql.Add('select A.* ');
@ -293,9 +295,6 @@ begin
exit;
end;
end;
layOut.BeginUpdate; // Postpones updates
try
// Creates a child group within the root group
for i := 0 to layOut.Items.Count - 1 do
begin
@ -360,6 +359,24 @@ begin
ALayoutItem.Parent := ALayoutGroup;
ALayoutItem.Name:= 'item_'+trim(AdoTmp.FieldByName('fieldName').AsString) ;
end
else if trim(AdoTmp.FieldByName('queryControlType').AsString)='checkBox' then
begin
cxCheckBox:= TcxCheckBox.Create(nil);
cxCheckBox.Name:= trim(AdoTmp.FieldByName('fieldName').AsString);
cxCheckBox.AlignWithMargins:=true;
cxCheckBox.Style.Font.Size:=gFontSize;
cxCheckBox.Caption:= trim(AdoTmp.FieldByName('caption').AsString) ;
cxCheckBox.TabOrder:=cnt;
cxCheckBox.Tag:=99;
//
if ALayoutItem=nil then
ALayoutItem := TdxLayoutItem(layOut.CreateItem);
ALayoutItem.Control := cxCheckBox;
ALayoutItem.CaptionOptions.Text:='';//trim(AdoTmp.FieldByName('caption').AsString) ;
ALayoutItem.Parent := ALayoutGroup;
ALayoutItem.Name:= 'item_'+trim(AdoTmp.FieldByName('fieldName').AsString) ;
end
else if trim(AdoTmp.FieldByName('queryControlType').AsString)='date' then
begin
@ -449,6 +466,7 @@ begin
finally
layOut.EndUpdate; // Resumes updates, even if an exception occurs
if layout.Items.VisibleCount=0 then layout.Visible:=false;
end;
end;