diff --git a/public10/ThreeFun/Fun/U_RTFun.pas b/public10/ThreeFun/Fun/U_RTFun.pas index 7bf5783..aade1f0 100644 --- a/public10/ThreeFun/Fun/U_RTFun.pas +++ b/public10/ThreeFun/Fun/U_RTFun.pas @@ -237,7 +237,7 @@ var implementation uses - U_DataLink; + U_DataLink,U_globalVar; /// ///////////////////////////////////////// @@ -2639,13 +2639,19 @@ var mGridName: string; mfromName: string; mcxGridDbColumn1: TcxGridDbColumn; + mDir:stromg' i: integer; begin - // mFileName := ExtractFilePath(application.ExeName) + 'Layout\' + filePack + '\' + Trim(fileName) + '.dbg'; - // 从布局文件中恢复 - //if FileExists(mFileName) then - // cxGrid.RestoreFromIniFile(mFileName, false, false); - //mfromName:=GetParentForm(TControl(cxGrid.GetParentComponent),true).Name; + if gGridNativeSet then + begin + mDir:= ExtractFilePath(application.ExeName) + 'Layout\' + filePack ; + mFileName := mDir + '\' + Trim(fileName) + '.dbg'; + //从布局文件中恢复 + if FileExists(mFileName) then + cxGrid.RestoreFromIniFile(mFileName, false, false); + exit; + end ; + mGridName := cxGrid.GetParentComponent.Name + '.' + cxGrid.name; try @@ -2721,10 +2727,15 @@ var mcxGridDbColumn1: TcxGridDbBandedColumn; i: integer; begin - mFileName := ExtractFilePath(application.ExeName) + 'Layout\' + filePack + '\' + Trim(fileName) + '.dbg'; - // 从布局文件中恢复 - //if FileExists(mFileName) then - // cxGrid.RestoreFromIniFile(mFileName); + if gGridNativeSet then + begin + mFileName := ExtractFilePath(application.ExeName) + 'Layout\' + filePack + '\' + Trim(fileName) + '.dbg'; + // 从布局文件中恢复 + if FileExists(mFileName) then + cxGrid.RestoreFromIniFile(mFileName); + + exit; + end; mGridName := cxGrid.GetParentComponent.Name + '.' + cxGrid.name; @@ -2827,14 +2838,22 @@ var mADOCmd: TADOQuery; mGridName: string; mfromName: string; + mDir:string; i: integer; mcurdate: Tdatetime; begin - { mFileName := ExtractFilePath(application.ExeName) + 'Layout\' + filePack + '\' + Trim(fileName) + '.dbg'; + mDir:= ExtractFilePath(application.ExeName) + 'Layout\' ; + if not DirectoryExists( mDir) then + begin + CreateDir(pwidechar(mDir)); + end; + // mFileName := mDir + '\' + Trim(fileName) + '.dbg'; + mFileName := ExtractFilePath(application.ExeName) + 'Layout\' + filePack + '\' + Trim(fileName) + '.dbg'; + if not DirectoryExists(ExtractFileDir(mFileName)) then CreateDir(ExtractFileDir(mFileName)); // 保存为布局文件 - cxGrid.StoreToIniFile(mFileName); } + cxGrid.StoreToIniFile(mFileName); mfromName := GetParentForm(TControl(cxGrid.GetParentComponent), true).Name; mGridName := cxGrid.GetParentComponent.Name + '.' + cxGrid.name; diff --git a/public10/design/U_FormLayOutDesign.pas b/public10/design/U_FormLayOutDesign.pas index aeaa2ff..9b54c08 100644 --- a/public10/design/U_FormLayOutDesign.pas +++ b/public10/design/U_FormLayOutDesign.pas @@ -545,7 +545,15 @@ begin begin Result := Result + ',@' + mControl.Name + '=' + quotedStr(Trim(TcxComboBox(mControl).Text)) ; - end; + end + else if mControl is TcxCheckBox then + begin + if TcxCheckBox(mControl).Checked then + Result := Result + ',@' + mControl.Name + '=1' + else + Result := Result + ',@' + mControl.Name + '=0' ; + + end end; end; if Trim(Result) <> '' then