闪缩更新

This commit is contained in:
sgwp 2024-11-23 14:24:52 +08:00
parent d1b82e4288
commit beb717ff30
4 changed files with 69 additions and 48 deletions

View File

@ -4,7 +4,7 @@ object BaseDataLink: TBaseDataLink
Height = 322 Height = 322
Width = 484 Width = 484
object dxSkinController1: TdxSkinController object dxSkinController1: TdxSkinController
Kind = lfStandard Kind = lfFlat
NativeStyle = False NativeStyle = False
ScrollbarMode = sbmClassic ScrollbarMode = sbmClassic
SkinName = 'WXI' SkinName = 'WXI'
@ -45,7 +45,7 @@ object BaseDataLink: TBaseDataLink
PixelsPerInch = 96 PixelsPerInch = 96
end end
object ThreeLookAndFeelCol: TcxLookAndFeelController object ThreeLookAndFeelCol: TcxLookAndFeelController
Kind = lfStandard Kind = lfFlat
NativeStyle = False NativeStyle = False
ScrollbarMode = sbmClassic ScrollbarMode = sbmClassic
SkinName = 'WXI' SkinName = 'WXI'

View File

@ -3,10 +3,11 @@ unit U_BaseDataLink;
interface interface
uses uses
System.SysUtils, windows, forms, System.Classes, dxCore, cxClasses, System.SysUtils,windows,forms, System.Classes,
cxLookAndFeels, cxContainer, cxEdit, System.ImageList, Vcl.ImgList, dxSkinsDefaultPainters, dxCore, cxClasses,
Vcl.Controls, cxImageList, cxGraphics, cxStyles, dxLayoutLookAndFeels, cxLookAndFeels, dxSkinsForm, cxContainer, cxEdit,
cxLocalization, dxSkinsForm, dxSkinsDefaultPainters; System.ImageList, Vcl.ImgList, Vcl.Controls, cxImageList, cxGraphics, cxStyles,
dxLayoutLookAndFeels,cxLocalization;
type type
TBaseDataLink = class(TDataModule) TBaseDataLink = class(TDataModule)
@ -35,52 +36,66 @@ type
private private
{ Private declarations } { Private declarations }
public public
end; end;
var var
BaseDataLink: TBaseDataLink; BaseDataLink: TBaseDataLink;
implementation implementation
uses uses
U_globalVar, U_FormLayOutDesign; U_globalVar,U_FormLayOutDesign;
{%CLASSGROUP 'Vcl.Controls.TControl'} {%CLASSGROUP 'Vcl.Controls.TControl'}
{$R *.dfm} {$R *.dfm}
procedure TBaseDataLink.DataModuleCreate(Sender: TObject); procedure TBaseDataLink.DataModuleCreate(Sender: TObject);
var var
str: string; str :String;
pathStr: string; pathStr:String;
I: Integer; I: Integer;
thread:Tthread;
begin begin
RootLookAndFeel.NativeStyle := False; thread:=TThread.CreateAnonymousThread(
gFontSize := 0; procedure
if (fileexists(ExtractFilePath(Application.ExeName) + 'devchs.ini') = true) then
begin
cxLocalizer1.FileName := ExtractFilePath(Application.ExeName) + 'devchs.ini';
cxLocalizer1.Active := true;
cxLocalizer1.LanguageIndex := 1;
end;
//
if not isUseSkin() then
begin
dxSkinController1.UseSkins := false;
dxSkinController1.SkinName := '';
end
else
begin
pathStr := ExtractFilePath(Application.ExeName) + '\AllSkins.skinres';
if FileExists(pathStr) then
begin begin
dxSkinsUserSkinLoadFromFile(pathStr, 'WXI'); TThread.Synchronize(nil,
RootLookAndFeel.SkinName := sdxSkinsUserSkinName; procedure
end; begin
RootLookAndFeel.NativeStyle := false;
gFontSize:=0;
if (fileexists(ExtractFilePath(Application.ExeName) + 'devchs.ini') = true)
then
begin
cxLocalizer1.FileName := ExtractFilePath(Application.ExeName) +
'devchs.ini';
cxLocalizer1.Active := true;
cxLocalizer1.LanguageIndex := 1;
end;
//
if not isUseSkin() then
begin
dxSkinController1.UseSkins:=false;
dxSkinController1.SkinName:='';
end
else
begin
pathStr:=ExtractFilePath(Application.ExeName) + '\AllSkins.skinres';
if FileExists(pathStr) then
begin
dxSkinsUserSkinLoadFromFile(pathStr, 'WXI');
RootLookAndFeel.SkinName := sdxSkinsUserSkinName;
end;
end;
end)
end);
thread.FreeOnTerminate := True;
thread.Start;
end; end;
// gGridNativeSet:=isGridNativeSet();
//
end;
end. end.

View File

@ -37,6 +37,7 @@ var
mFontSize:integer; mFontSize:integer;
begin begin
getSystemIni(); getSystemIni();
self.DoubleBuffered:=gIsUseSkin;
if gFontSize<9 then if gFontSize<9 then
begin begin
mFontSize := 12; mFontSize := 12;

View File

@ -6,7 +6,7 @@ uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB,
Data.Win.ADODB, U_WindowFormdesign, cxGraphics, cxControls, cxLookAndFeels, Data.Win.ADODB, U_WindowFormdesign, cxGraphics, cxControls, cxLookAndFeels,
cxLookAndFeelPainters, cxLookAndFeelPainters,
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, cxNavigator, cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, cxNavigator,
dxDateRanges, dxScrollbarAnnotations, cxDBData, cxGridLevel, cxClasses, dxDateRanges, dxScrollbarAnnotations, cxDBData, cxGridLevel, cxClasses,
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
@ -47,22 +47,26 @@ uses
constructor TfrmBaseList.Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0); constructor TfrmBaseList.Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
if ACaption <> '' then
Caption := ACaption; if ACaption <> '' then
Caption := ACaption;
fParameters1 := Parameters1;
fParameters2 := Parameters2;
fParameters3 := Parameters3;
fParameters4 := Parameters4;
fParameters5 := Parameters5;
fParameters10 := Parameters10;
fFormId:= FormID ;
fParameters1 := Parameters1;
fParameters2 := Parameters2;
fParameters3 := Parameters3;
fParameters4 := Parameters4;
fParameters5 := Parameters5;
fParameters10 := Parameters10;
fFormId:= FormID ;
end; end;
procedure TfrmBaseList.FormClose(Sender: TObject; var Action: TCloseAction); procedure TfrmBaseList.FormClose(Sender: TObject; var Action: TCloseAction);
begin begin
if WriteCloseWin(ADOQueryBaseCmd, self.Caption, fFormId, gDllFileName) then if (fFormId>0) and (WriteCloseWin(ADOQueryBaseCmd, self.Caption, fFormId, gDllFileName)) then
begin begin
Sendmessage(application.MainForm.Handle, WM_CloseForm, 4, 0); Sendmessage(application.MainForm.Handle, WM_CloseForm, 4, 0);
end; end;
@ -74,6 +78,7 @@ var
mFontSize:integer; mFontSize:integer;
begin begin
getSystemIni(); getSystemIni();
self.DoubleBuffered:=gIsUseSkin;
if gFontSize<9 then if gFontSize<9 then
begin begin
mFontSize := 12; mFontSize := 12;