Grid -> Guardar la configuración en un fichero XML en vez del registro de Windows.
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@494 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
e40cf73e67
commit
63125630f1
@ -4,6 +4,7 @@ inherited fEditorGridBase: TfEditorGridBase
|
|||||||
Caption = 'fEditorGridBase'
|
Caption = 'fEditorGridBase'
|
||||||
ClientHeight = 444
|
ClientHeight = 444
|
||||||
ClientWidth = 543
|
ClientWidth = 543
|
||||||
|
OnDestroy = CustomEditorDestroy
|
||||||
ExplicitWidth = 551
|
ExplicitWidth = 551
|
||||||
ExplicitHeight = 478
|
ExplicitHeight = 478
|
||||||
PixelsPerInch = 96
|
PixelsPerInch = 96
|
||||||
|
|||||||
@ -70,6 +70,7 @@ type
|
|||||||
procedure actRefrescarUpdate(Sender: TObject);
|
procedure actRefrescarUpdate(Sender: TObject);
|
||||||
procedure actFiltrarExecute(Sender: TObject);
|
procedure actFiltrarExecute(Sender: TObject);
|
||||||
procedure actFiltrarUpdate(Sender: TObject);
|
procedure actFiltrarUpdate(Sender: TObject);
|
||||||
|
procedure CustomEditorDestroy(Sender: TObject);
|
||||||
protected
|
protected
|
||||||
FViewGrid : IViewGridBase;
|
FViewGrid : IViewGridBase;
|
||||||
procedure SetViewGrid(const Value : IViewGridBase); virtual;
|
procedure SetViewGrid(const Value : IViewGridBase); virtual;
|
||||||
@ -154,9 +155,10 @@ procedure TfEditorGridBase.FormShow(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
if Assigned(ViewGrid) then
|
if Assigned(ViewGrid) then
|
||||||
ViewGrid.ShowEmbedded(Self);
|
begin
|
||||||
|
ViewGrid.ShowEmbedded(Self);
|
||||||
|
ViewGrid.RestoreFromIniFile;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfEditorGridBase.actEliminarUpdate(Sender: TObject);
|
procedure TfEditorGridBase.actEliminarUpdate(Sender: TObject);
|
||||||
@ -247,6 +249,13 @@ begin
|
|||||||
actModificar.ShortCut := ShortCut(VK_RETURN, []);
|
actModificar.ShortCut := ShortCut(VK_RETURN, []);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfEditorGridBase.CustomEditorDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
if Assigned(ViewGrid) then
|
||||||
|
ViewGrid.StoreToIniFile;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfEditorGridBase.actAnchoAutoExecute(Sender: TObject);
|
procedure TfEditorGridBase.actAnchoAutoExecute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|||||||
@ -44,6 +44,9 @@ type
|
|||||||
function GetGrid : TcxGrid;
|
function GetGrid : TcxGrid;
|
||||||
property _Grid : TcxGrid read GetGrid;
|
property _Grid : TcxGrid read GetGrid;
|
||||||
|
|
||||||
|
procedure RestoreFromIniFile;
|
||||||
|
procedure StoreToIniFile;
|
||||||
|
|
||||||
procedure StoreToRegistry (const Path : String);
|
procedure StoreToRegistry (const Path : String);
|
||||||
procedure RestoreFromRegistry (const Path : String);
|
procedure RestoreFromRegistry (const Path : String);
|
||||||
|
|
||||||
@ -145,6 +148,9 @@ type
|
|||||||
procedure SaveGridStatus;
|
procedure SaveGridStatus;
|
||||||
procedure RestoreGridStatus;
|
procedure RestoreGridStatus;
|
||||||
|
|
||||||
|
procedure RestoreFromIniFile;
|
||||||
|
procedure StoreToIniFile;
|
||||||
|
|
||||||
procedure GotoFirst;
|
procedure GotoFirst;
|
||||||
procedure GotoLast;
|
procedure GotoLast;
|
||||||
|
|
||||||
@ -392,12 +398,50 @@ begin
|
|||||||
Filter := ViewFiltros.Texto;
|
Filter := ViewFiltros.Texto;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrViewGridBase.RestoreFromIniFile;
|
||||||
|
var
|
||||||
|
AIniFile : String;
|
||||||
|
begin
|
||||||
|
Exit;
|
||||||
|
inherited;
|
||||||
|
if Assigned(_FocusedView) then
|
||||||
|
begin
|
||||||
|
|
||||||
|
AIniFile := GetSpecialFolderPath(CSIDL_COMMON_APPDATA); //[All Users]\Application Data
|
||||||
|
AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim;
|
||||||
|
|
||||||
|
if not DirectoryExists(AIniFile) then
|
||||||
|
ForceDirectories(AIniFile);
|
||||||
|
|
||||||
|
_FocusedView.RestoreFromIniFile(AIniFile + 'grid.xml', True, False, []);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrViewGridBase.RestoreFromRegistry(const Path : String);
|
procedure TfrViewGridBase.RestoreFromRegistry(const Path : String);
|
||||||
begin
|
begin
|
||||||
if Assigned(_FocusedView) then
|
if Assigned(_FocusedView) then
|
||||||
_FocusedView.RestoreFromRegistry(Path + '\\GridSettings\\' + Self.Name, False, False, []);
|
_FocusedView.RestoreFromRegistry(Path + '\\GridSettings\\' + Self.Name, False, False, []);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrViewGridBase.StoreToIniFile;
|
||||||
|
var
|
||||||
|
AIniFile : String;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
Exit;
|
||||||
|
if Assigned(_FocusedView) then
|
||||||
|
begin
|
||||||
|
|
||||||
|
AIniFile := GetSpecialFolderPath(CSIDL_COMMON_APPDATA); //[All Users]\Application Data
|
||||||
|
AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim;
|
||||||
|
|
||||||
|
if not DirectoryExists(AIniFile) then
|
||||||
|
ForceDirectories(AIniFile);
|
||||||
|
|
||||||
|
_FocusedView.StoreToIniFile(AIniFile + 'grid.xml', False, []);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrViewGridBase.StoreToRegistry(const Path : String);
|
procedure TfrViewGridBase.StoreToRegistry(const Path : String);
|
||||||
begin
|
begin
|
||||||
if Assigned(_FocusedView) then
|
if Assigned(_FocusedView) then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user