Cambios necesarios para que no haya problemas con windows 7
git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_FactuGES/trunk@52 93f398dd-4eb6-7a46-baf6-13f46f578da2
This commit is contained in:
parent
38e48889ef
commit
a9204dcafa
@ -4,10 +4,10 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Controls, SyncObjs, PngImageList, JvComponent, JvNavigationPane, TBXSwitcher,
|
Controls, SyncObjs, PngImageList, JvComponent, JvNavigationPane, TBXSwitcher,
|
||||||
TBXOffice2003Theme, Classes, ImgList,
|
TBXOffice2003Theme, Classes, ImgList, SysUtils,
|
||||||
DataAbstract4_Intf, uDADataTable, JvAppStorage, JvAppRegistryStorage,
|
DataAbstract4_Intf, uDADataTable, JvAppStorage, JvAppRegistryStorage,
|
||||||
JvComponentBase, JvLogFile, dxPSGlbl, dxPSUtl, dxPrnPg,
|
JvComponentBase, JvLogFile, dxPSGlbl, dxPSUtl, dxPrnPg,
|
||||||
dxBkgnd, dxWrap, dxPrnDev, dxPgsDlg, dxPSCore, cxLookAndFeels;
|
dxBkgnd, dxWrap, dxPrnDev, dxPgsDlg, dxPSCore;
|
||||||
|
|
||||||
type
|
type
|
||||||
TdmBase = class(TDataModule)
|
TdmBase = class(TDataModule)
|
||||||
@ -24,11 +24,11 @@ type
|
|||||||
FEscribirLog : TCriticalSection;
|
FEscribirLog : TCriticalSection;
|
||||||
procedure IniciarLog;
|
procedure IniciarLog;
|
||||||
procedure DetenerLog;
|
procedure DetenerLog;
|
||||||
|
procedure InitStyleManager;
|
||||||
procedure OnTBXThemeChange(Sender: TObject);
|
procedure OnTBXThemeChange(Sender: TObject);
|
||||||
procedure LeerConfiguracion;
|
procedure LeerConfiguracion;
|
||||||
public
|
public
|
||||||
procedure InitStyleManager (ThemeID : integer = 0);
|
procedure EscribirLog(const AMensaje : String);
|
||||||
procedure EscribirLog(const AMensaje : String);
|
|
||||||
procedure SalvarConfiguracion;
|
procedure SalvarConfiguracion;
|
||||||
property OnThemeChange: TNotifyEvent read FOnThemeChange write
|
property OnThemeChange: TNotifyEvent read FOnThemeChange write
|
||||||
FOnThemeChange;
|
FOnThemeChange;
|
||||||
@ -43,14 +43,15 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
uDataModuleConexion, Dialogs, TBX, TBXThemes, Forms, Windows,
|
uDataModuleConexion, Dialogs, TBX, TBXThemes, Forms, Windows,
|
||||||
JclFileUtils, cxControls, SysUtils, uDataModuleConfiguracion;
|
JclFileUtils, cxControls, uDataModuleConfiguracion,
|
||||||
|
SHFolder, uSistemaFunc, uAppInfoUtils;
|
||||||
|
|
||||||
{
|
{
|
||||||
*********************************** TdmBase ************************************
|
*********************************** TdmBase ************************************
|
||||||
}
|
}
|
||||||
procedure TdmBase.DAClientDataModuleCreate(Sender: TObject);
|
procedure TdmBase.DAClientDataModuleCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
IniciarLog;
|
IniciarLog; //<- NO SE USA
|
||||||
|
|
||||||
TBXSwitcher.OnThemeChange := OnTBXThemeChange;
|
TBXSwitcher.OnThemeChange := OnTBXThemeChange;
|
||||||
TBXSetTheme('Office2003');
|
TBXSetTheme('Office2003');
|
||||||
@ -59,44 +60,49 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TdmBase.IniciarLog;
|
procedure TdmBase.IniciarLog;
|
||||||
|
var
|
||||||
|
ALogFileName : String;
|
||||||
begin
|
begin
|
||||||
|
inherited;
|
||||||
FEscribirLog := TCriticalSection.Create;
|
FEscribirLog := TCriticalSection.Create;
|
||||||
|
|
||||||
JvLogFile.Active := False;
|
ALogFileName := GetSpecialFolderPath(CSIDL_APPDATA); //[Current Users]\Application Data
|
||||||
JvLogFile.FileName := ExtractFilePath(Application.ExeName) + 'ClientLog.txt';
|
ALogFileName := ALogFileName + PathDelim + 'Rodax Software' + PathDelim + 'FactuGES' + PathDelim;
|
||||||
JvLogFile.AutoSave := True;
|
|
||||||
JvLogFile.Active := True;
|
if SysUtils.ForceDirectories(ALogFileName) then
|
||||||
JvLogFile.Clear;
|
begin
|
||||||
|
JvLogFile.Active := False;
|
||||||
|
JvLogFile.FileName := ALogFileName + 'ClientLog.txt';
|
||||||
|
JvLogFile.AutoSave := True;
|
||||||
|
JvLogFile.Active := True;
|
||||||
|
JvLogFile.Clear;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
raise Exception.Create('Error al crear directorio para Log: ' + IntToStr(GetLastError));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TdmBase.InitStyleManager(ThemeID : integer = 0);
|
procedure TdmBase.InitStyleManager;
|
||||||
begin
|
begin
|
||||||
if ThemeID < 2 then
|
if not USE_THEMES then
|
||||||
begin
|
begin
|
||||||
if not USE_THEMES then
|
TBXSwitcher.EnableXPStyles := False;
|
||||||
|
StyleManager.Theme := nptStandard;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
TBXSwitcher.EnableXPStyles := True;
|
||||||
|
with StyleManager do
|
||||||
begin
|
begin
|
||||||
TBXSwitcher.EnableXPStyles := False;
|
if CurrentTheme is TTBXOffice2003Theme then
|
||||||
StyleManager.Theme := nptStandard;
|
|
||||||
end
|
|
||||||
else begin
|
|
||||||
TBXSwitcher.EnableXPStyles := True;
|
|
||||||
with StyleManager do
|
|
||||||
begin
|
begin
|
||||||
if CurrentTheme is TTBXOffice2003Theme then
|
case GetOffice2003Scheme of
|
||||||
begin
|
osBlue : Theme := nptXPBlue;
|
||||||
case GetOffice2003Scheme of
|
osMetallic : Theme := nptXPSilver;
|
||||||
osBlue : Theme := nptXPBlue;
|
osGreen : Theme := nptXPOlive;
|
||||||
osMetallic : Theme := nptXPSilver;
|
else
|
||||||
osGreen : Theme := nptXPOlive;
|
Theme := nptStandard;
|
||||||
else
|
|
||||||
Theme := nptStandard;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end
|
|
||||||
else begin
|
|
||||||
StyleManager.Theme := nptStandard;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -121,7 +127,7 @@ end;
|
|||||||
|
|
||||||
procedure TdmBase.DataModuleDestroy(Sender: TObject);
|
procedure TdmBase.DataModuleDestroy(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
DetenerLog;
|
DetenerLog; //<- NO SE USA
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TdmBase.DetenerLog;
|
procedure TdmBase.DetenerLog;
|
||||||
|
|||||||
@ -558,16 +558,8 @@ object fPantallaPrincipal: TfPantallaPrincipal
|
|||||||
Left = 160
|
Left = 160
|
||||||
Top = 182
|
Top = 182
|
||||||
end
|
end
|
||||||
object HostMenu: TJvMainMenu
|
object HostMenu: TMainMenu
|
||||||
Images = ModulesSmallImageList
|
Images = ModulesSmallImageList
|
||||||
Style = msItemPainter
|
|
||||||
ImageMargin.Left = 0
|
|
||||||
ImageMargin.Top = 0
|
|
||||||
ImageMargin.Right = 0
|
|
||||||
ImageMargin.Bottom = 0
|
|
||||||
ImageSize.Height = 0
|
|
||||||
ImageSize.Width = 0
|
|
||||||
ItemPainter = JvXPMenuItemPainter1
|
|
||||||
Left = 248
|
Left = 248
|
||||||
Top = 168
|
Top = 168
|
||||||
object Archivo2_OLD: TMenuItem
|
object Archivo2_OLD: TMenuItem
|
||||||
@ -715,12 +707,6 @@ object fPantallaPrincipal: TfPantallaPrincipal
|
|||||||
Action = actMenuInformes
|
Action = actMenuInformes
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object JvXPMenuItemPainter1: TJvXPMenuItemPainter
|
|
||||||
SelectionFrameBrush.Color = 13811126
|
|
||||||
SelectionFramePen.Color = 6956042
|
|
||||||
Left = 288
|
|
||||||
Top = 168
|
|
||||||
end
|
|
||||||
object StatusPanelImageList: TPngImageList
|
object StatusPanelImageList: TPngImageList
|
||||||
PngImages = <
|
PngImages = <
|
||||||
item
|
item
|
||||||
|
|||||||
@ -39,8 +39,7 @@ type
|
|||||||
actConexion: TAction;
|
actConexion: TAction;
|
||||||
actAcerca: TAction;
|
actAcerca: TAction;
|
||||||
pnlBorde: TJvXPContainer;
|
pnlBorde: TJvXPContainer;
|
||||||
HostMenu: TJvMainMenu;
|
HostMenu: TMainMenu;
|
||||||
JvXPMenuItemPainter1: TJvXPMenuItemPainter;
|
|
||||||
Archivo2_OLD: TMenuItem;
|
Archivo2_OLD: TMenuItem;
|
||||||
Ayuda2_OLD: TMenuItem;
|
Ayuda2_OLD: TMenuItem;
|
||||||
Cambiarmicontrasea2_OLD: TMenuItem;
|
Cambiarmicontrasea2_OLD: TMenuItem;
|
||||||
@ -205,8 +204,6 @@ var
|
|||||||
begin
|
begin
|
||||||
ATitulo := AppFactuGES.GetAppFullName;
|
ATitulo := AppFactuGES.GetAppFullName;
|
||||||
|
|
||||||
dmBase.InitStyleManager(JvNavigationPane.ActivePage.Tag);
|
|
||||||
|
|
||||||
if Assigned(AppFactuGES.EmpresaActiva) then
|
if Assigned(AppFactuGES.EmpresaActiva) then
|
||||||
ATitulo := AppFactuGES.EmpresaActiva.NOMBRE + ' - ' + ATitulo;
|
ATitulo := AppFactuGES.EmpresaActiva.NOMBRE + ' - ' + ATitulo;
|
||||||
|
|
||||||
|
|||||||
@ -343,7 +343,7 @@ begin
|
|||||||
if Assigned(_FocusedView) then
|
if Assigned(_FocusedView) then
|
||||||
begin
|
begin
|
||||||
|
|
||||||
AIniFile := GetSpecialFolderPath(CSIDL_COMMON_APPDATA); //[All Users]\Application Data
|
AIniFile := GetSpecialFolderPath(CSIDL_APPDATA); //[All Users]\Application Data
|
||||||
AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim;
|
AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim;
|
||||||
|
|
||||||
if not DirectoryExists(AIniFile) then
|
if not DirectoryExists(AIniFile) then
|
||||||
@ -441,7 +441,7 @@ begin
|
|||||||
if Assigned(_FocusedView) then
|
if Assigned(_FocusedView) then
|
||||||
begin
|
begin
|
||||||
|
|
||||||
AIniFile := GetSpecialFolderPath(CSIDL_COMMON_APPDATA); //[All Users]\Application Data
|
AIniFile := GetSpecialFolderPath(CSIDL_APPDATA); //[All Users]\Application Data
|
||||||
AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim;
|
AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim;
|
||||||
|
|
||||||
if not DirectoryExists(AIniFile) then
|
if not DirectoryExists(AIniFile) then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user