From a4528819828207f0371e21f9ffa431a8824afbac Mon Sep 17 00:00:00 2001 From: david Date: Tue, 22 Jun 2010 19:31:10 +0000 Subject: [PATCH] Tarea #82 -> Cambiar colores de la interfaz cuando se cambia la empresa git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@526 f4e31baf-9722-1c47-927c-6f952f962d4b --- Source/Base/uDMBase.pas | 40 +++++++++++++++------------ Source/Cliente/uPantallaPrincipal.pas | 2 ++ 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Source/Base/uDMBase.pas b/Source/Base/uDMBase.pas index c0156925..07664bd5 100644 --- a/Source/Base/uDMBase.pas +++ b/Source/Base/uDMBase.pas @@ -24,11 +24,11 @@ type FEscribirLog : TCriticalSection; procedure IniciarLog; procedure DetenerLog; - procedure InitStyleManager; procedure OnTBXThemeChange(Sender: TObject); procedure LeerConfiguracion; public - procedure EscribirLog(const AMensaje : String); + procedure InitStyleManager (ThemeID : integer = 0); + procedure EscribirLog(const AMensaje : String); procedure SalvarConfiguracion; property OnThemeChange: TNotifyEvent read FOnThemeChange write FOnThemeChange; @@ -69,28 +69,34 @@ begin JvLogFile.Clear; end; -procedure TdmBase.InitStyleManager; +procedure TdmBase.InitStyleManager(ThemeID : integer = 0); begin - if not USE_THEMES then + if ThemeID < 2 then begin - TBXSwitcher.EnableXPStyles := False; - StyleManager.Theme := nptStandard; - end - else begin - TBXSwitcher.EnableXPStyles := True; - with StyleManager do + if not USE_THEMES then begin - if CurrentTheme is TTBXOffice2003Theme then + TBXSwitcher.EnableXPStyles := False; + StyleManager.Theme := nptStandard; + end + else begin + TBXSwitcher.EnableXPStyles := True; + with StyleManager do begin - case GetOffice2003Scheme of - osBlue : Theme := nptXPBlue; - osMetallic : Theme := nptXPSilver; - osGreen : Theme := nptXPOlive; - else - Theme := nptStandard; + if CurrentTheme is TTBXOffice2003Theme then + begin + case GetOffice2003Scheme of + osBlue : Theme := nptXPBlue; + osMetallic : Theme := nptXPSilver; + osGreen : Theme := nptXPOlive; + else + Theme := nptStandard; + end; end; end; end; + end + else begin + StyleManager.Theme := nptStandard; end; end; diff --git a/Source/Cliente/uPantallaPrincipal.pas b/Source/Cliente/uPantallaPrincipal.pas index dad84375..5aee573f 100644 --- a/Source/Cliente/uPantallaPrincipal.pas +++ b/Source/Cliente/uPantallaPrincipal.pas @@ -205,6 +205,8 @@ var begin ATitulo := AppFactuGES.GetAppFullName; + dmBase.InitStyleManager(JvNavigationPane.ActivePage.Tag); + if Assigned(AppFactuGES.EmpresaActiva) then ATitulo := AppFactuGES.EmpresaActiva.NOMBRE + ' - ' + ATitulo;