Print Page | Close Window

Custom Theme Support Sample

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1996
Printed Date: 16 November 2024 at 5:32pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom Theme Support Sample
Posted By: idolpx
Subject: Custom Theme Support Sample
Date Posted: 20 March 2005 at 11:01pm
Is there a sample that explains how to create custom themes like the MS Money theme shown at the following links in VB6?

http://www.codejock.com/products/commandbars/tour_01.asp
http://www.codejock.com/products/commandbars/tour_02.asp



Replies:
Posted By: Boyd
Date Posted: 21 March 2005 at 7:18am

The MS Money theme cannot be created using the ActiveX version of the controls.  You can switch between the various built-in themes and change the color scheme, but you cannot create a new theme that isn't based on one of the original, built-in themes.



Posted By: ianp
Date Posted: 21 March 2005 at 10:45am

Although the MS Money theme is not built into the ActiveX control, you can (or used to be able to) modify the themes using setspecialcolor.

Using the code in hoanganh's post ( http://forum.codejock.com/forum_posts.asp?TID=403#3522 - http://forum.codejock.com/forum_posts.asp?TID=403#3522 ) I was able to create the office2003 theme on windows 2000 workstations. Since the introduction of the CommandBarsGlobalSettings.ColorManager.SystemTheme methods in 9.6, I have not tried it modifying the themes but I would think it still works.

I would imagine if you experiment with the colors you could recreate the MS Money look to some degree. Let us know how you get on

UPDATE:

Version 9.6 has increased the ability to create custom themed toolbars (or indeed custom themes for just about all CodeJock controls). For more details look up the SetColors method in the Help.

To begin to illustrate a MS Money implementation, here is some code to get you started. It would be great if you could post your progress...


Private Sub Form_Load()
    CommandBars.LoadDesignerBars "C:\Program Files\Codejock Software\ActiveX\Xtreme Suite Pro ActiveX v9.60\samples\CommandBars\Customizable\visio.xcb"
    Call XCBThemeMSMoney
End Sub
Private Sub XCBThemeMSMoney()
With CommandBars
    .VisualTheme = xtpThemeOffice2003
    With .GlobalSettings.ColorManager
        .SetColor XPCOLOR_TOOLBAR_TEXT, 16777215
        .SetColor STDCOLOR_BTNFACE, 11567972
        .SetColor STDCOLOR_BTNFACE, 11567972
        .SetColor STDCOLOR_HIGHLIGHTTEXT, 8380415
        .SetColor XPCOLOR_TOOLBAR_FACE, 11567972
        .SetColor XPCOLOR_TOOLBAR_TEXT, 16777215
        .SetColor STDCOLOR_BTNFACE, 5921626
        .SetColor XPCOLOR_HIGHLIGHT, 5263440
        .SetColor XPCOLOR_HIGHLIGHT_BORDER, 5263440
        .SetColor XPCOLOR_HIGHLIGHT_CHECKED, 5263440
        .SetColor XPCOLOR_HIGHLIGHT_CHECKED_BORDER, 5263440
        .SetColor XPCOLOR_HIGHLIGHT_PUSHED, 5263440
        .SetColor XPCOLOR_HIGHLIGHT_PUSHED_BORDER, 5263440
        .SetColor XPCOLOR_HIGHLIGHT_TEXT, 8380415
        .SetColor XPCOLOR_MENUBAR_FACE, 5921626
        .SetColor XPCOLOR_MENUBAR_TEXT, 16777215
        .SetColor XPCOLOR_MENUBAR_BORDER, 4408131
        .SetColor COLOR_BTNSHADOW, RGB(214, 214, 214)
    End With
    .Options.LunaColors = False
    .Options.ShowTextBelowIcons = True
    .RecalcLayout
End With

End Sub



Posted By: MrCairo
Date Posted: 21 March 2005 at 4:34pm

thanks for the example

mc



Posted By: idolpx
Date Posted: 22 March 2005 at 12:08pm

Yeah... thanks for the sample.  I'll try it out.

The goal is to give my users the ability to change the look and feel of the program.  It would be nice if they could specify an image for the background of the commandbar.  Either a static image or a tiled image.

 



Posted By: ianp
Date Posted: 22 March 2005 at 2:17pm

I'm not sure that tiled images are possible, which is going to make replicating the toolbar element of the MS Money Theme difficult (or impossible), so I would submit a feature request.

Also, I had a look in the samples again and there is a good demo of the customization options in the CommandBars MDISample, take a look.



Posted By: idolpx
Date Posted: 22 March 2005 at 4:17pm

How do they do it in the samples below?

http://www.codejock.com/products/commandbars/tour_01.asp
http://www.codejock.com/products/commandbars/tour_02.asp



Posted By: Devin Dazzle
Date Posted: 23 March 2005 at 7:50am

Those examples are most likely based on the C++ MFC source code.  The ActiveX version does not have all the functionality that the MFC code does (yet?). If you take a look at the development history of the Xtreme Suite controls you will se that each new update brings a lot more functionality.

Hopefully we will se a lot of improvements when version 10 is released (can't wait :)



-------------
Best Regards
Kim Pedersen, vbCode Magician
http://www.vbcodemagician.dk


Posted By: idolpx
Date Posted: 23 March 2005 at 8:16am
Yes...  I hope to see more functionality in the ActiveX controls as well.

If anyone has any other ideas on how to Custom Theme the commandbar and dockingpanes let us know!  :)


Posted By: alfredorcamara
Date Posted: 02 April 2005 at 8:08pm

Private Sub Form_Load()
fnCriarMenu
fnConfiguraCor
End Sub

Function fnCriarMenu()
Dim Control As CommandBarControl
Dim ControlFile As CommandBarPopup, ControlEdit As CommandBarPopup, ControlView As CommandBarPopup
Dim ControlWindow As CommandBarPopup, ControlHelp As CommandBarPopup
'----------------------------------------------------------- ----------------------------------------
'Configurações Iniciais
'----------------------------------------------------------- ----------------------------------------
CommandBarsGlobalSettings.App = App

'----------------------------------------------------------- ----------------------------------------
'Menu de Arquivo
'----------------------------------------------------------- ----------------------------------------
Set ControlFile = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Arquivo", -1, False)
With ControlFile.CommandBar.Controls
    Set Control = .Add(xtpControlButton, ID_ARQUIVO_NOVO, "&Nova", -1, False)
    .Add xtpControlButton, ID_ARQUIVO_CONFIRMAR, "Confirmar", -1, False
    'Separador
    Set Control = .Add(xtpControlButton, ID_ARQUIVO_CUSTOMISE, "Cus&tomizar", -1, False)
    Control.BeginGroup = True
    .Add xtpControlButton, ID_ARQUIVO_GERENCIADOR, "&Gerenciador", -1, False
    'separador
    Set Control = .Add(xtpControlButton, ID_ARQUIVO_PRINTSETUP, "Configurar &Impressora...", -1, False)
    Control.BeginGroup = True
    'Separador
    Set Control = .Add(xtpControlButton, ID_ARQUIVO_FECHAR, "&Fechar", -1, False)
    Control.BeginGroup = True
End With
'Configura Teclas de Atalho
CommandBars.KeyBindings.Add FCONTROL, Asc("N"), ID_ARQUIVO_NOVO
CommandBars.KeyBindings.Add 0, VK_F2, ID_ARQUIVO_CONFIRMAR
CommandBars.KeyBindings.Add FCONTROL, Asc("T"), ID_ARQUIVO_CUSTOMISE
CommandBars.KeyBindings.Add FCONTROL, Asc("G"), ID_ARQUIVO_GERENCIADOR
CommandBars.KeyBindings.Add FCONTROL, Asc("I"), ID_ARQUIVO_PRINTSETUP
CommandBars.KeyBindings.Add 0, VK_ESCAPE, ID_ARQUIVO_FECHAR
'----------------------------------------------------------- ----------------------------------------
'Menu Editar
'----------------------------------------------------------- ----------------------------------------
Set ControlEdit = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Editar", -1, False)
With ControlEdit.CommandBar.Controls
    .Add xtpControlButton, ID_EDIT_UNDO, "&Desfazer", -1, False
    'Separador
    Set Control = .Add(xtpControlButton, ID_EDIT_CUT, "&Recortar", -1, False)
    Control.BeginGroup = True
    .Add xtpControlButton, ID_EDIT_COPY, "&Copiar", -1, False
    .Add xtpControlButton, ID_EDIT_PASTE, "Co&lar", -1, False
End With
'Configura Teclas de Atalho
CommandBars.KeyBindings.Add FCONTROL, Asc("Z"), ID_EDIT_UNDO
CommandBars.KeyBindings.Add FCONTROL, Asc("X"), ID_EDIT_CUT
CommandBars.KeyBindings.Add FCONTROL, Asc("C"), ID_EDIT_COPY
CommandBars.KeyBindings.Add FCONTROL, Asc("V"), ID_EDIT_PASTE
'----------------------------------------------------------- ----------------------------------------
'Menu Ferramentas
'----------------------------------------------------------- ----------------------------------------
Set ControlFerramentas = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Ferramentas", -1, False)
With ControlFerramentas.CommandBar.Controls
    Set Control = .Add(xtpControlPopup, 0, "Microsoft &Office", -1, False)
    Control.CommandBar.Controls.Add xtpControlButton, ID_FERRAMENTAS_OFFICE_EXCEL, "Microsoft Office &Excel", -1, False
    Control.CommandBar.Controls.Add xtpControlButton, ID_FERRAMENTAS_OFFICE_WORD, "Microsoft Office &Word", -1, False
    Control.CommandBar.Controls.Add xtpControlButton, ID_FERRAMENTAS_OFFICE_OUTLOOK, "Microsoft Office &Outlook", -1, False
    Control.CommandBar.Controls.Add xtpControlButton, ID_FERRAMENTAS_OFFICE_POWERPOINT, "Microsoft Office &PowerPoint", -1, False
    Set Control = .Add(xtpControlButton, ID_FERRAMENTAS_CALCULATOR, "&Calculadora", -1, False)
    Control.BeginGroup = True
    .Add xtpControlButton, ID_FERRAMENTAS_NOTEPAD, "&Bloco de notas", -1, False
    .Add xtpControlButton, ID_FERRAMENTAS_WORDPAD, "&WordPad", -1, False
    .Add xtpControlButton, ID_FERRAMENTAS_ChARMAP, "&Mapa de caracteres", -1, False
    Set Control = .Add(xtpControlButton, ID_FERRAMENTAS_EXPLORER, "&Windows Explorer", -1, False)
    .Add xtpControlButton, ID_FERRAMENTAS_IEXPLORER, "&Internet Explorer", -1, False
    Control.BeginGroup = True
End With
'----------------------------------------------------------- ----------------------------------------
'Menu Relatório
'----------------------------------------------------------- ----------------------------------------
Set ControlRelatorio = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Relatórios", -1, False)
With ControlRelatorio.CommandBar.Controls
    .Add xtpControlButton, ID_RELATORIO_ENTREGA, "&Comprovante de Entrega", -1, False
    .Add xtpControlButton, ID_RELATORIO_CONTRATO, "Comprovante com Con&trato", -1, False
    'Separador
    Set Control = .Add(xtpControlButton, ID_RELATORIO_ORCAMENTO, "&Orçamento", -1, False)
    Control.BeginGroup = True
End With
'----------------------------------------------------------- ----------------------------------------
'Menu Ajuda
'----------------------------------------------------------- ----------------------------------------
Set ControlAjuda = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Ajuda", -1, False)
With ControlAjuda.CommandBar.Controls
    .Add xtpControlButton, ID_AJUDA_CONTESTO, "&Contesto", -1, False
    'Separador
    Set Control = .Add(xtpControlButton, ID_AJUDA_SOBRE, "&Sobre...", -1, False)
    Control.BeginGroup = True
End With
'Configura Teclas de Atalho
CommandBars.KeyBindings.Add 0, VK_F1, ID_AJUDA_CONTESTO

'----------------------------------------------------------- ----------------------------------------
'Configurações Finais
'----------------------------------------------------------- ----------------------------------------
CommandBars.EnableCustomization (True)
CommandBars.VisualTheme = xtpThemeOffice2003
End Function

 

Function fnConfiguraCor()
CommandBars.VisualTheme = xtpThemeOfficeXP

'Cor de Fundo do menu
CommandBars.GlobalSettings.ColorManager.SetColor STDCOLOR_BTNFACE, RGB(91, 91, 91)

'Cor do Separador
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_SEPARATOR, RGB(91, 91, 91)

'Barra Esquerda do Menu ativo
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_TOOLBAR_FACE, RGB(70, 70, 70)

'Não sei
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_SPLITTER_FACE, RGB(190, 90, 90)

'Pontos inicial do menu
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_TOOLBAR_GRIPPER, vbWhite

'Cor das opções do menu quando está selecionada
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT, RGB(70, 70, 70)

'Cor da borda das opções do menu quando está selecionada
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_BORDER, RGB(60, 60, 60)

'não sei
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_CHECKED, RGB(255, 223, 127)
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_CHECKED_BORDER, RGB(255, 223, 127)
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_PUSHED_BORDER, RGB(255, 223, 127)
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_PUSHED, RGB(255, 223, 127)

'Cor de fundo do menu quando aberto
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_MENUBAR_FACE, RGB(90, 90, 90)

'Cor da Borda do Menu
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_MENUBAR_BORDER, RGB(60, 60, 60)

'Cor da Sombra do menu
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_3DSHADOW, 0
CommandBars.GlobalSettings.ColorManager.SetColor STDCOLOR_BTNSHADOW, 0

'Modifica Texto
Dim newFont As StdFont
Set newFont = New StdFont
With newFont
   .Bold = False
   .Italic = False
   .Name = "Tahoma"
   .Size = 8
   .Underline = False
   .Strikethrough = False
End With
Set CommandBars.Options.Font = newFont

'Cor do texto do menu principal
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_TOOLBAR_TEXT, vbWhite
'Cor do texto do menu quando aberto
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_MENUBAR_TEXT, vbWhite
'
CommandBars.GlobalSettings.ColorManager.SetColor STDCOLOR_BTNTEXT, vbWhite

'RGB(112, 112, 112) => Cor do texto desabilitado

CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_TEXT, RGB(255, 223, 127)

'Outras Configurações
CommandBars.Options.Animation = xtpAnimateWindowsDefault
CommandBars.Options.LunaColors = False
CommandBars.RecalcLayout

End Function

Obs: Não está completamente pronto, falta terminar algumas coisas. Mas acho que tem como ficar igual ao o Money




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net