Arreglos estéticos

git-svn-id: https://192.168.0.254/svn/Proyectos.Noviseda_FactuGES2/trunk@49 f33bb606-9f5c-448d-9c99-757f00063c96
This commit is contained in:
David Arranz 2010-01-22 18:23:50 +00:00
parent 6f4279d737
commit 39eea68a00
7 changed files with 111 additions and 49 deletions

Binary file not shown.

View File

@ -146,28 +146,14 @@ object dmBase: TdmBase
Bitmap = {} Bitmap = {}
end end
object StyleManager: TJvNavPaneStyleManager object StyleManager: TJvNavPaneStyleManager
Colors.ButtonColorFrom = clWhite Colors.ButtonSeparatorColor = 2987520
Colors.ButtonColorTo = 12435133
Colors.ButtonHotColorFrom = 13009540
Colors.ButtonHotColorTo = 13009540
Colors.ButtonSelectedColorFrom = 14602190
Colors.ButtonSelectedColorTo = 14602190
Colors.SplitterColorFrom = 13026246
Colors.SplitterColorTo = 9211532
Colors.DividerColorFrom = 15725551
Colors.DividerColorTo = 13026246
Colors.HeaderColorFrom = 8684164
Colors.HeaderColorTo = 8684164
Colors.FrameColor = 8684676
Colors.ToolPanelHeaderColorFrom = clWhite
Colors.ToolPanelHeaderColorTo = 12435133
Fonts.NavPanelFont.Charset = DEFAULT_CHARSET Fonts.NavPanelFont.Charset = DEFAULT_CHARSET
Fonts.NavPanelFont.Color = clWindowText Fonts.NavPanelFont.Color = clWindowText
Fonts.NavPanelFont.Height = -13 Fonts.NavPanelFont.Height = -13
Fonts.NavPanelFont.Name = 'Tahoma' Fonts.NavPanelFont.Name = 'Tahoma'
Fonts.NavPanelFont.Style = [] Fonts.NavPanelFont.Style = []
Fonts.NavPanelHotTrackFont.Charset = DEFAULT_CHARSET Fonts.NavPanelHotTrackFont.Charset = DEFAULT_CHARSET
Fonts.NavPanelHotTrackFont.Color = clWindow Fonts.NavPanelHotTrackFont.Color = clWindowText
Fonts.NavPanelHotTrackFont.Height = -13 Fonts.NavPanelHotTrackFont.Height = -13
Fonts.NavPanelHotTrackFont.Name = 'Tahoma' Fonts.NavPanelHotTrackFont.Name = 'Tahoma'
Fonts.NavPanelHotTrackFont.Style = [] Fonts.NavPanelHotTrackFont.Style = []

View File

@ -112,10 +112,10 @@ end;
procedure TdmBase.OnTBXThemeChange(Sender: TObject); procedure TdmBase.OnTBXThemeChange(Sender: TObject);
begin begin
InitStyleManager; { InitStyleManager;
if Assigned(FOnThemeChange) then if Assigned(FOnThemeChange) then
FOnThemeChange(Sender); FOnThemeChange(Sender);}
end; end;
procedure TdmBase.SalvarConfiguracion; procedure TdmBase.SalvarConfiguracion;

View File

@ -14,7 +14,7 @@ implementation
uses uses
ComCtrls, Classes, Math, SpTBXDkPanels, StrUtils, SysUtils, ComCtrls, Classes, Math, SpTBXDkPanels, StrUtils, SysUtils,
ExtCtrls, Graphics, Dialogs, SpTBXControls; ExtCtrls, Graphics, Dialogs, JvLinkLabel, JvLabel, StdCtrls;
procedure PopulateNavPagePane(AParentControl : TWinControl; procedure PopulateNavPagePane(AParentControl : TWinControl;
@ -28,9 +28,40 @@ begin
for ItemIndex := 0 to (AMenuItem.Count - 1) do for ItemIndex := 0 to (AMenuItem.Count - 1) do
begin begin
if ((not AMenuItem[ItemIndex].IsLine) // que no sea una línea separadora if ((not AMenuItem[ItemIndex].IsLine) // que no sea una línea separadora
and (AMenuItem[ItemIndex].Count = 0)) // y que no sea el padre de un submenú and (AMenuItem[ItemIndex].Count = 0) // que no sea el padre de un submenú
and (AMenuItem[ItemIndex].Visible)) // y que sea visible
then then
with TSpTBXLabel.Create(Application) do with TJvLabel.Create(AParentControl) do
begin
Parent := AParentControl;//APanel;
ParentFont := True;
Align := alTop;
Tag := AMenuItem[ItemIndex].Tag;
Caption := AMenuItem[ItemIndex].Caption;
Action := AMenuItem[ItemIndex].Action;
HotTrack := True;
HotTrackFont.Style := [fsUnderline];
Images := AImageList;
ImageIndex := AMenuItem[ItemIndex].ImageIndex;
Height := AImageList.Height;
Margins.Top := 0;
Margins.Bottom := 6;
Margins.Left := 10;
Margins.Right := 10;
AlignWithMargins := True;
AutoSize := True;
Layout := tlCenter;
Transparent := True;
AHeight := AHeight + Margins.Top + Margins.Bottom + Height;
end;
{ with TSpTBXLabel.Create(Application) do
begin begin
Parent := AParentControl;//APanel; Parent := AParentControl;//APanel;
Align := alTop; Align := alTop;
@ -38,6 +69,7 @@ begin
Tag := AMenuItem[ItemIndex].Tag; Tag := AMenuItem[ItemIndex].Tag;
Caption := AMenuItem[ItemIndex].Caption; Caption := AMenuItem[ItemIndex].Caption;
Action := AMenuItem[ItemIndex].Action; Action := AMenuItem[ItemIndex].Action;
Images := AImageList; Images := AImageList;
ImageIndex := AMenuItem[ItemIndex].ImageIndex; ImageIndex := AMenuItem[ItemIndex].ImageIndex;
if ItemIndex = 0 then if ItemIndex = 0 then
@ -47,10 +79,12 @@ begin
Margins.Bottom := 6; Margins.Bottom := 6;
Margins.Left := 10; Margins.Left := 10;
Margins.Right := 10; Margins.Right := 10;
AlignWithMargins := True;
Height := 18; Height := 18;
Color := clRed;
Invalidate; Invalidate;
AHeight := AHeight + Margins.Top + Margins.Bottom + Height; AHeight := AHeight + Margins.Top + Margins.Bottom + Height;
end; end;}
end; end;
AParentControl.Height := AHeight; AParentControl.Height := AHeight;
end; end;

View File

@ -47,7 +47,7 @@ implementation
uses uses
Dialogs, uModuleController, uAcercaDe, uNavPaneUtils, Dialogs, uModuleController, uAcercaDe, uNavPaneUtils,
uMainMenuController, uClienteUtils, Menus, uDMBase, uMainMenuController, uClienteUtils, Menus, uDMBase,
uFactuGES_App, uBizEmpresas, JvPageList; uFactuGES_App, uBizEmpresas, JvPageList, Graphics;
{ TNavPaneController } { TNavPaneController }
@ -64,6 +64,11 @@ begin
Enabled := false; Enabled := false;
Cursor := crDefault; Cursor := crDefault;
StyleManager := dmBase.StyleManager; StyleManager := dmBase.StyleManager;
Margins.Top := 0;
Margins.Bottom := 6;
Margins.Left := 0;
Margins.Right := 0;
AlignWithMargins := True;
end; end;
end; end;
@ -164,7 +169,8 @@ begin
PopulateNavPagePane(ASeccion, TMenuItem(AListaSecciones.Objects[ASeccionCount]), PopulateNavPagePane(ASeccion, TMenuItem(AListaSecciones.Objects[ASeccionCount]),
FLargeImages, dmBase.StyleManager); FLargeImages, dmBase.StyleManager);
ASeccion.Height := ASeccion.Height + ADivisor.Height;
ASeccion.Height := ASeccion.Height + ADivisor.Margins.Top + ADivisor.Margins.Bottom + ADivisor.Height;
end; end;
{$IFDEF MULTIEMPRESA} {$IFDEF MULTIEMPRESA}

View File

@ -2,8 +2,8 @@ object fPantallaPrincipal: TfPantallaPrincipal
Left = 358 Left = 358
Top = 250 Top = 250
Caption = 'Pantalla principal' Caption = 'Pantalla principal'
ClientHeight = 553 ClientHeight = 551
ClientWidth = 886 ClientWidth = 884
Color = clWindow Color = clWindow
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
@ -25,8 +25,8 @@ object fPantallaPrincipal: TfPantallaPrincipal
AlignWithMargins = True AlignWithMargins = True
Left = 5 Left = 5
Top = 5 Top = 5
Width = 876 Width = 874
Height = 533 Height = 531
Margins.Left = 5 Margins.Left = 5
Margins.Top = 5 Margins.Top = 5
Margins.Right = 5 Margins.Right = 5
@ -36,11 +36,13 @@ object fPantallaPrincipal: TfPantallaPrincipal
TabOrder = 0 TabOrder = 0
ShowCaption = False ShowCaption = False
ShowCaptionWhenDocked = False ShowCaptionWhenDocked = False
ExplicitTop = 28
ExplicitHeight = 508
object JvSyncSplitter1: TJvSyncSplitter object JvSyncSplitter1: TJvSyncSplitter
Left = 210 Left = 210
Top = 0 Top = 0
Width = 5 Width = 5
Height = 533 Height = 531
ResizeStyle = rsPattern ResizeStyle = rsPattern
ExplicitTop = 5 ExplicitTop = 5
ExplicitHeight = 570 ExplicitHeight = 570
@ -49,7 +51,7 @@ object fPantallaPrincipal: TfPantallaPrincipal
Left = 0 Left = 0
Top = 0 Top = 0
Width = 210 Width = 210
Height = 533 Height = 531
ActivePage = pagInicio ActivePage = pagInicio
Align = alLeft Align = alLeft
AutoHeaders = True AutoHeaders = True
@ -65,6 +67,7 @@ object fPantallaPrincipal: TfPantallaPrincipal
Colors.ButtonHotColorTo = 13009540 Colors.ButtonHotColorTo = 13009540
Colors.ButtonSelectedColorFrom = 14602190 Colors.ButtonSelectedColorFrom = 14602190
Colors.ButtonSelectedColorTo = 14602190 Colors.ButtonSelectedColorTo = 14602190
Colors.ButtonSeparatorColor = 2987520
Colors.SplitterColorFrom = 13026246 Colors.SplitterColorFrom = 13026246
Colors.SplitterColorTo = 9211532 Colors.SplitterColorTo = 9211532
Colors.DividerColorFrom = 15725551 Colors.DividerColorFrom = 15725551
@ -84,17 +87,18 @@ object fPantallaPrincipal: TfPantallaPrincipal
NavPanelFont.Name = 'Tahoma' NavPanelFont.Name = 'Tahoma'
NavPanelFont.Style = [] NavPanelFont.Style = []
NavPanelHotTrackFont.Charset = DEFAULT_CHARSET NavPanelHotTrackFont.Charset = DEFAULT_CHARSET
NavPanelHotTrackFont.Color = clWindow NavPanelHotTrackFont.Color = clWindowText
NavPanelHotTrackFont.Height = -13 NavPanelHotTrackFont.Height = -13
NavPanelHotTrackFont.Name = 'Tahoma' NavPanelHotTrackFont.Name = 'Tahoma'
NavPanelHotTrackFont.Style = [] NavPanelHotTrackFont.Style = []
SmallImages = ModulesSmallImageList SmallImages = ModulesSmallImageList
OnChange = JvNavigationPaneChange OnChange = JvNavigationPaneChange
ExplicitHeight = 508
object pagInicio: TJvNavPanelPage object pagInicio: TJvNavPanelPage
Left = 0 Left = 0
Top = 0 Top = 0
Width = 208 Width = 208
Height = 460 Height = 458
Background.Stretch = False Background.Stretch = False
Background.Proportional = False Background.Proportional = False
Background.Center = False Background.Center = False
@ -102,15 +106,17 @@ object fPantallaPrincipal: TfPantallaPrincipal
Background.Transparent = False Background.Transparent = False
Caption = 'Inicio' Caption = 'Inicio'
ImageIndex = 0 ImageIndex = 0
ExplicitHeight = 435
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Top = 374 Top = 372
Width = 208 Width = 208
Height = 86 Height = 86
Align = alBottom Align = alBottom
Color = clWindow Color = clWindow
ParentBackground = False ParentBackground = False
TabOrder = 1 TabOrder = 1
ExplicitTop = 349
object Label1: TLabel object Label1: TLabel
Left = 38 Left = 38
Top = 29 Top = 29
@ -157,22 +163,24 @@ object fPantallaPrincipal: TfPantallaPrincipal
object pnlBorde: TJvXPContainer object pnlBorde: TJvXPContainer
Left = 215 Left = 215
Top = 0 Top = 0
Width = 661 Width = 659
Height = 533 Height = 531
BoundColor = clActiveCaption BoundColor = clActiveCaption
BoundLines = [blLeft, blTop, blRight, blBottom] BoundLines = [blLeft, blTop, blRight, blBottom]
Caption = 'pnlBorde' Caption = 'pnlBorde'
Align = alClient Align = alClient
ExplicitHeight = 508
object pnlMain: TSpTBXDockablePanel object pnlMain: TSpTBXDockablePanel
Left = 1 Left = 1
Top = 1 Top = 1
Width = 659 Width = 657
Height = 531 Height = 529
Color = clWindow Color = clWindow
Align = alClient Align = alClient
TabOrder = 0 TabOrder = 0
ShowCaption = False ShowCaption = False
ShowCaptionWhenDocked = False ShowCaptionWhenDocked = False
ExplicitHeight = 506
object lblBienvenido: TLabel object lblBienvenido: TLabel
Left = 8 Left = 8
Top = 8 Top = 8
@ -209,8 +217,8 @@ object fPantallaPrincipal: TfPantallaPrincipal
end end
object SpTBXStatusBar1: TSpTBXStatusBar object SpTBXStatusBar1: TSpTBXStatusBar
Left = 0 Left = 0
Top = 543 Top = 541
Width = 886 Width = 884
Height = 10 Height = 10
object SpTBXLabelItem1: TSpTBXLabelItem object SpTBXLabelItem1: TSpTBXLabelItem
Images = StatusPanelImageList Images = StatusPanelImageList
@ -615,11 +623,13 @@ object fPantallaPrincipal: TfPantallaPrincipal
Caption = 'Empresa' Caption = 'Empresa'
object Listadeempresas1_OLD: TMenuItem object Listadeempresas1_OLD: TMenuItem
Caption = 'Selecci'#243'n de empresas' Caption = 'Selecci'#243'n de empresas'
Visible = False
OnClick = Listadeempresas1_OLDClick OnClick = Listadeempresas1_OLDClick
end end
object N1_OLD: TMenuItem object N1_OLD: TMenuItem
Tag = 100 Tag = 100
Caption = '-' Caption = '-'
Visible = False
end end
object Informacindeempresa1: TMenuItem object Informacindeempresa1: TMenuItem
Tag = 10 Tag = 10

View File

@ -9,7 +9,8 @@ uses
JvXPCore, JvXPContainer, pngimage, ExtCtrls, StdCtrls, SpTBXItem, JvXPCore, JvXPContainer, pngimage, ExtCtrls, StdCtrls, SpTBXItem,
JvPageList, JvExControls, JvExExtCtrls, JvSplitter, JvSyncSplitter, JvPageList, JvExControls, JvExExtCtrls, JvSplitter, JvSyncSplitter,
SpTBXDkPanels, uCustomEditor, uHostManager, uGUIBase, SpTBXDkPanels, uCustomEditor, uHostManager, uGUIBase,
Dialogs, jpeg, TB2Dock, TB2Item; Dialogs, jpeg, TB2Dock, TB2Item, TntStdCtrls, SpTBXEditors, TB2Toolbar,
JvLinkLabel, JvLabel, SpTBXControls;
type type
IMainForm = interface(IHostForm) IMainForm = interface(IHostForm)
@ -128,6 +129,7 @@ type
procedure InicializarUI; procedure InicializarUI;
procedure OnThemeChange(Sender: TObject); procedure OnThemeChange(Sender: TObject);
procedure ExecuteActionMenu(Sender : TObject); procedure ExecuteActionMenu(Sender : TObject);
procedure InitStyleManager;
//procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND; //procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;
protected protected
function GetWorkPanel : TWinControl; function GetWorkPanel : TWinControl;
@ -150,7 +152,7 @@ uses
uSplash, uAcercaDe, UxTheme, Themes, uMenuUtils, uBizEmpresas, uSplash, uAcercaDe, UxTheme, Themes, uMenuUtils, uBizEmpresas,
uFactuGES_App, uDMBase, uDataModuleConexion, uFactuGES_App, uDMBase, uDataModuleConexion,
uModuleController, uMainMenuController, uNavPaneController, uModuleController, uMainMenuController, uNavPaneController,
uDialogUtils, cxControls, SpTBXSkins; uDialogUtils, cxControls, SpTBXSkins, SpTBXDefaultSkins;
{$R *.dfm} {$R *.dfm}
@ -182,15 +184,19 @@ begin
Application.Title := AppFactuGES.AppName + ' ' + AppFactuGES.AppVersion; Application.Title := AppFactuGES.AppName + ' ' + AppFactuGES.AppVersion;
Caption := Application.Title; Caption := Application.Title;
JvNavigationPane.StyleManager := dmBase.StyleManager;
dmBase.OnThemeChange := Self.OnThemeChange;
Self.OnThemeChange(Self); // Forzar el refresco de los colores del tema activo
actLogin.Execute; actLogin.Execute;
end; end;
procedure TfPantallaPrincipal.FormShow(Sender: TObject); procedure TfPantallaPrincipal.FormShow(Sender: TObject);
begin begin
// Set skin type to sknTBX
SkinManager.SetSkin('Office 2003');
dmBase.OnThemeChange := Self.OnThemeChange;
JvNavigationPane.StyleManager := dmBase.StyleManager;
InitStyleManager;
InicializarUI; InicializarUI;
end; end;
@ -330,9 +336,6 @@ var
begin begin
ShowHourglassCursor; ShowHourglassCursor;
try try
// Set skin type to sknTBX
SkinManager.ChangeControlSkinType(Self, sknSkin);
for i := 0 to AppFactuGES.ModuleManager.ModulesCount - 1 do for i := 0 to AppFactuGES.ModuleManager.ModulesCount - 1 do
MainMenuController.RegisterModule(AppFactuGES.ModuleManager.Modules[i]); MainMenuController.RegisterModule(AppFactuGES.ModuleManager.Modules[i]);
@ -624,4 +627,27 @@ begin
AppFactuGES.EmpresasController.Ver(AppFactuGES.EmpresaActiva); AppFactuGES.EmpresasController.Ver(AppFactuGES.EmpresaActiva);
end; end;
procedure TfPantallaPrincipal.InitStyleManager;
begin
if not SkinManager.IsXPThemesEnabled then
dmBase.StyleManager.Theme := nptStandard
else begin
//TBXSwitcher.EnableXPStyles := True;
with dmBase.StyleManager do
begin
if SkinManager.CurrentSkin is TSpTBXOffice2003Skin then
begin
case SpGetLunaScheme of
lusBlue : Theme := nptXPBlue;
lusMetallic : Theme := nptXPSilver;
lusGreen : Theme := nptXPOlive;
else
Theme := nptStandard;
end;
end;
end;
end;
end;
end. end.