diff --git a/Source/Base/uDMBase.pas b/Source/Base/uDMBase.pas index 07664bd..d7761f7 100644 --- a/Source/Base/uDMBase.pas +++ b/Source/Base/uDMBase.pas @@ -4,10 +4,10 @@ interface uses Controls, SyncObjs, PngImageList, JvComponent, JvNavigationPane, TBXSwitcher, - TBXOffice2003Theme, Classes, ImgList, - DataAbstract4_Intf, uDADataTable, JvAppStorage, JvAppRegistryStorage, + TBXOffice2003Theme, Classes, ImgList, SysUtils, + DataAbstract4_Intf, uDADataTable, JvAppStorage, JvAppRegistryStorage, JvComponentBase, JvLogFile, dxPSGlbl, dxPSUtl, dxPrnPg, - dxBkgnd, dxWrap, dxPrnDev, dxPgsDlg, dxPSCore, cxLookAndFeels; + dxBkgnd, dxWrap, dxPrnDev, dxPgsDlg, dxPSCore; type TdmBase = class(TDataModule) @@ -24,11 +24,11 @@ type FEscribirLog : TCriticalSection; procedure IniciarLog; procedure DetenerLog; + procedure InitStyleManager; procedure OnTBXThemeChange(Sender: TObject); procedure LeerConfiguracion; public - procedure InitStyleManager (ThemeID : integer = 0); - procedure EscribirLog(const AMensaje : String); + procedure EscribirLog(const AMensaje : String); procedure SalvarConfiguracion; property OnThemeChange: TNotifyEvent read FOnThemeChange write FOnThemeChange; @@ -43,14 +43,15 @@ implementation uses uDataModuleConexion, Dialogs, TBX, TBXThemes, Forms, Windows, - JclFileUtils, cxControls, SysUtils, uDataModuleConfiguracion; + JclFileUtils, cxControls, uDataModuleConfiguracion, + SHFolder, uSistemaFunc, uAppInfoUtils; { *********************************** TdmBase ************************************ } procedure TdmBase.DAClientDataModuleCreate(Sender: TObject); begin - IniciarLog; + IniciarLog; //<- NO SE USA TBXSwitcher.OnThemeChange := OnTBXThemeChange; TBXSetTheme('Office2003'); @@ -59,44 +60,49 @@ begin end; procedure TdmBase.IniciarLog; +var + ALogFileName : String; begin + inherited; FEscribirLog := TCriticalSection.Create; - JvLogFile.Active := False; - JvLogFile.FileName := ExtractFilePath(Application.ExeName) + 'ClientLog.txt'; - JvLogFile.AutoSave := True; - JvLogFile.Active := True; - JvLogFile.Clear; + ALogFileName := GetSpecialFolderPath(CSIDL_APPDATA); //[Current Users]\Application Data + ALogFileName := ALogFileName + PathDelim + 'Rodax Software' + PathDelim + 'FactuGES' + PathDelim; + + if SysUtils.ForceDirectories(ALogFileName) then + 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; -procedure TdmBase.InitStyleManager(ThemeID : integer = 0); +procedure TdmBase.InitStyleManager; begin - if ThemeID < 2 then + if not USE_THEMES then begin - if not USE_THEMES then + TBXSwitcher.EnableXPStyles := False; + StyleManager.Theme := nptStandard; + end + else begin + TBXSwitcher.EnableXPStyles := True; + with StyleManager do begin - TBXSwitcher.EnableXPStyles := False; - StyleManager.Theme := nptStandard; - end - else begin - TBXSwitcher.EnableXPStyles := True; - with StyleManager do + if CurrentTheme is TTBXOffice2003Theme then begin - if CurrentTheme is TTBXOffice2003Theme then - begin - case GetOffice2003Scheme of - osBlue : Theme := nptXPBlue; - osMetallic : Theme := nptXPSilver; - osGreen : Theme := nptXPOlive; - else - Theme := nptStandard; - end; + case GetOffice2003Scheme of + osBlue : Theme := nptXPBlue; + osMetallic : Theme := nptXPSilver; + osGreen : Theme := nptXPOlive; + else + Theme := nptStandard; end; end; end; - end - else begin - StyleManager.Theme := nptStandard; end; end; @@ -121,7 +127,7 @@ end; procedure TdmBase.DataModuleDestroy(Sender: TObject); begin - DetenerLog; + DetenerLog; //<- NO SE USA end; procedure TdmBase.DetenerLog; diff --git a/Source/Cliente/uPantallaPrincipal.dfm b/Source/Cliente/uPantallaPrincipal.dfm index 99ddc53..bf958ac 100644 --- a/Source/Cliente/uPantallaPrincipal.dfm +++ b/Source/Cliente/uPantallaPrincipal.dfm @@ -558,16 +558,8 @@ object fPantallaPrincipal: TfPantallaPrincipal Left = 160 Top = 182 end - object HostMenu: TJvMainMenu + object HostMenu: TMainMenu 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 Top = 168 object Archivo2_OLD: TMenuItem @@ -715,12 +707,6 @@ object fPantallaPrincipal: TfPantallaPrincipal Action = actMenuInformes end end - object JvXPMenuItemPainter1: TJvXPMenuItemPainter - SelectionFrameBrush.Color = 13811126 - SelectionFramePen.Color = 6956042 - Left = 288 - Top = 168 - end object StatusPanelImageList: TPngImageList PngImages = < item diff --git a/Source/Cliente/uPantallaPrincipal.pas b/Source/Cliente/uPantallaPrincipal.pas index 5aee573..f72e847 100644 --- a/Source/Cliente/uPantallaPrincipal.pas +++ b/Source/Cliente/uPantallaPrincipal.pas @@ -39,8 +39,7 @@ type actConexion: TAction; actAcerca: TAction; pnlBorde: TJvXPContainer; - HostMenu: TJvMainMenu; - JvXPMenuItemPainter1: TJvXPMenuItemPainter; + HostMenu: TMainMenu; Archivo2_OLD: TMenuItem; Ayuda2_OLD: TMenuItem; Cambiarmicontrasea2_OLD: TMenuItem; @@ -205,8 +204,6 @@ var begin ATitulo := AppFactuGES.GetAppFullName; - dmBase.InitStyleManager(JvNavigationPane.ActivePage.Tag); - if Assigned(AppFactuGES.EmpresaActiva) then ATitulo := AppFactuGES.EmpresaActiva.NOMBRE + ' - ' + ATitulo; diff --git a/Source/GUIBase/uViewGridBase.pas b/Source/GUIBase/uViewGridBase.pas index 6ae077e..2f206b6 100644 --- a/Source/GUIBase/uViewGridBase.pas +++ b/Source/GUIBase/uViewGridBase.pas @@ -343,7 +343,7 @@ begin if Assigned(_FocusedView) then 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; if not DirectoryExists(AIniFile) then @@ -441,7 +441,7 @@ begin if Assigned(_FocusedView) then 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; if not DirectoryExists(AIniFile) then