unit U_FormLayOutDesign; interface uses Windows, SysUtils, Messages, Classes, Controls, StdCtrls, ComCtrls, Forms, ExtCtrls, ComObj, DXCORE, ActiveX, cxMemo, cxButtons, Graphics, IniFiles, Dialogs, Menus, DB, ADODB, cxLabel, BtnEdit, RTComboBox, cxTextEdit, cxMRUEdit, cxDBData, cxGridLevel, cxButtonEdit, cxCurrencyEdit, cxGridTableView, cxGrid, cxGridCustomTableView, cxGraphics, cxCalendar, cxCheckBox, cxGridDBTableView, cxGridDBBandedTableView, cxStyles, cxPc, cxGroupBox, dxLayoutContainer, cxCustomData, cxClasses, cxTimeEdit, cxEdit, cxLookAndFeels, dxLayoutControl, cxLookAndFeelPainters, cxGridCustomView, Buttons, cxDropDownEdit,dxSkinsCore, dxSkinWXI,dxSkinsDefaultPainters; //function saveLayOut(dxLayoutControl1:TdxLayoutControl; ADOCmd: TADOQuery;mdesignCode:string):Boolean; //function readLayOut(dxLayoutControl1:TdxLayoutControl; ADOTmp: TADOQuery;mdesignCode:string):Boolean; //function mustInCheck(dxLayoutControl1:TdxLayoutControl ;textFlag:string='*'):Boolean; procedure SetFormOperRight(app:Tapplication;mParent: TwinControl; mRightCaptions: PWideChar)stdcall;external 'rtCommon.dll' Name 'SetFormOperRight_A'; function getSystemFontSize(ADOTmp: TADOQuery;mStyleCode:PWideChar): Integer;stdcall;external 'rtCommon.dll' Name 'getSystemFontSize_A'; function mustInCheck(app:Tapplication;dxLayoutControl1:TdxLayoutControl;textFlag:PWideChar):boolean;stdcall;external 'rtCommon.dll' Name 'mustInCheck_A'; function isHasDesignRight(ADOTmp: TADOQuery;userId:PWideChar): boolean;stdcall;external 'rtCommon.dll' Name 'isHasDesignRight_A'; function readLayOut(app:Tapplication;dxLayoutControl1:TdxLayoutControl; ADOTmp: TADOQuery;mdesignCode:PWideChar):integer;stdcall;external 'rtCommon.dll' Name 'readLayOut_A'; function saveLayOut(app:Tapplication;dxLayoutControl1:TdxLayoutControl; ADOCmd: TADOQuery;mdesignCode:PWideChar):integer;stdcall;external 'rtCommon.dll' Name 'saveLayOut_A'; procedure layoutDesign(dxLayoutControl1:TdxLayoutControl;ADOTmp: TADOQuery;userId:PWideChar )stdcall;external 'rtCommon.dll' Name 'layoutDesign_A'; implementation //function saveLayOut(dxLayoutControl1:TdxLayoutControl; ADOCmd: TADOQuery;mdesignCode:string):Boolean; //var // LayoutStream: TMemoryStream; //begin // LayoutStream := TMemoryStream.Create; // try // dxLayoutControl1.SaveToStream(LayoutStream); // with ADOCmd do // begin // close; // sql.Clear; // sql.Add('select A.* '); // sql.Add('from SD_Design_FormLayout A'); // sql.Add('where A.designCode=' + quotedStr(mdesignCode)); // open; // // if RecordCount>0 then // begin // edit; // end // else // begin // append; // FieldByName('designCode').value:=mdesignCode; // FieldByName('fileGroup').value:='1'; // FieldByName('height').value:=0; // // end; // TBlobField(FieldByName('fileContent')).LoadFromStream(LayoutStream); // Post; // end; // finally // LayoutStream.Free; // 释放内存流 // end; //end; // //function readLayOut(dxLayoutControl1:TdxLayoutControl; ADOTmp: TADOQuery;mdesignCode:string):Boolean; //var // LayoutStream: TMemoryStream; //begin // LayoutStream := TMemoryStream.Create; // try // dxLayoutControl1.BeginUpdate ; // with ADOTmp do // begin // close; // sql.Clear; // sql.Add('select A.* '); // sql.Add('from SD_Design_FormLayout A'); // sql.Add('where A.designCode=' + quotedStr(mdesignCode)); // open; // // if RecordCount>0 then // begin // TBlobField(FieldByName('fileContent')).SaveToStream(LayoutStream) ; // LayoutStream.Seek(0,soFromBeginning); // dxLayoutControl1.LoadFromStream(LayoutStream); // end; // Close; // end; // finally // dxLayoutControl1.EndUpdate(); // LayoutStream.Free; // 释放内存流 // end; //end; //必须输入控制 // function mustInCheck(dxLayoutControl1:TdxLayoutControl ;textFlag:string='*'):Boolean; // var // i:integer; // j:Integer; // mcatpion:string; // layGroup:TdxLayoutGroup; // begin // result:=false; // for I := 0 to dxLayoutControl1.Items.Count-1 do // begin // // mcatpion:= TdxLayoutItem(dxLayoutControl1.Controls[i].Parent).caption ; // // if pos(textFlag, mcatpion)>=0 then // // begin // // ShowMessage(dxLayoutControl1.Items[i].name); // // end; // // if dxLayoutControl1.Items[i] is TdxLayoutGroup then // begin // layGroup := TdxLayoutGroup( dxLayoutControl1.Items[i]) ; // for j := 0 to layGroup.Count -1 do // begin // // ShowMessage(layGroup.items[j].name); // mcatpion:= TdxLayoutItem(layGroup.items[j]).Caption ; // if pos(textFlag, mcatpion)>0 then // begin // if TdxLayoutItem(layGroup.items[j]).Control is TcxTextEdit then // begin // if Trim(TcxTextEdit(TdxLayoutItem(layGroup.items[j]).Control).Text) ='' then // begin // // // mcatpion:=StringReplace(mcatpion,'[COLOR=#FF0000]*[/COLOR]','',[]); // TcxTextEdit(TdxLayoutItem(layGroup.items[j]).Control).TextHint:='请输入数据!'; // TcxTextEdit(TdxLayoutItem(layGroup.items[j]).Control).SetFocus; // ShowMessage('【'+mcatpion+'】,数据不能为空!'); // // exit ; // end; // continue; // end; // // // if TdxLayoutItem(layGroup.items[j]).Control is TcxButtonEdit then // begin // if Trim(TcxButtonEdit(TdxLayoutItem(layGroup.items[j]).Control).Text) ='' then // begin // // // mcatpion:=StringReplace(mcatpion,'[COLOR=#FF0000]*[/COLOR]','',[]); // // TcxButtonEdit(TdxLayoutItem(layGroup.items[j]).Control).TextHint:='请输入数据!'; // TcxButtonEdit(TdxLayoutItem(layGroup.items[j]).Control).SetFocus; // ShowMessage('【'+mcatpion+'】,数据不能为空!'); // // exit ; // end; // continue; // end; // // end; // end; // // end; // // end; // result:=true; // end; end.