Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
OK, OK... I'm just messing around with the "The best one ever!" thing.
However, I spent some time tweaking my FaceID code to make it the best one ever, for me. My reasons for messing with this at all (since there are MANY FaceID toolbars out there) are simple. 1) I wanted the code to be as light as possible (if you have any suggestions, I'd love to here them). 2) I browse available FaceID's, find one I like, keep browsing and forget if the one I'm looking at now is better than the one I liked before. The following code creates a toolbar that allows for quick and easy navigation and an ID selection history. See a screenshot of the result looks he http://snipurl.com/FaceID Feel free to use and/or modify this code as you see fit. If you make any changes that shorten the code at all, I'd love to see them. -Jeremy Regular code module: -------------------------------------------------------------------------- Option Explicit Option Private Module Public Const Title As String = "ShowMe the FaceId" Public IDToolbar As CommandBar Public btnID(1 To 100) As New FaceIDClass Sub ShowFaceIds() Dim i As Long 'Reset toolbar On Error Resume Next Application.CommandBars(Title).Delete Set IDToolbar = Application.CommandBars.Add(Title) On Error GoTo 0 'Build toolbar With IDToolbar.Controls With .Add(msoControlButton) 'Previous button .FaceId = 3825 .OnAction = "Prev_Click" .Height = 30 End With With .Add(msoControlButton) 'Next button .FaceId = 3826 .OnAction = "Next_Click" End With .Add(msoControlButton).Width = 48 'Spacer With .Add(msoControlButton) 'JumpTo label .Style = msoButtonCaption .Caption = "Viewing" End With With .Add(msoControlComboBox) 'JumpTo dropdown .Caption = "JumpTo" .OnAction = "JumpTo_Change" For i = 1 To 4301 Step 100 .AddItem i & " to " & (i + 99) Next i .ListIndex = 1 End With For i = 1 To 100 'FaceID buttons Set btnID(i).btnFaceID = .Add(msoControlButton) Next i With .Add(msoControlButton) 'Clear Button .Style = msoButtonCaption .Caption = "Clear History" .OnAction = "ClearHistory" .Width = 92 End With .Add(msoControlButton).Height = 30 'Spacer .Add(msoControlButton).Width = 114 'Spacer 'Selection history buttons For i = 1 To 4 .Add(msoControlButton).Height = 30 Next i End With 'Show Toolbar With IDToolbar .Width = 253 .Left = (Application.Width - .Width) / 2 .Top = (Application.Height - .Height) / 2 Call JumpTo_Change .Visible = True End With End Sub Sub JumpTo_Change() Dim IDRng As Double Dim btnIdx As Long, i As Long btnIdx = 6 IDRng = Val(IDToolbar.Controls(5).Text) For i = IDRng To IDRng + 99 With IDToolbar.Controls(btnIdx) .FaceId = i .TooltipText = i End With btnIdx = btnIdx + 1 Next i End Sub Sub Next_Click() With IDToolbar.Controls("JumpTo") If .ListIndex = .ListCount Then Beep Exit Sub End If .ListIndex = .ListIndex + 1 End With Call JumpTo_Change End Sub Sub Prev_Click() With IDToolbar.Controls("JumpTo") If .ListIndex = 1 Then Beep Exit Sub End If .ListIndex = .ListIndex - 1 End With Call JumpTo_Change End Sub Private Sub ClearHistory() Dim i As Long For i = 107 To 112 With IDToolbar.Controls(i) .FaceId = 1 .Caption = "" End With Next i End Sub -------------------------------------------------------------------------- Class module named FaceIDClass -------------------------------------------------------------------------- Option Explicit Public WithEvents btnFaceID As CommandBarButton Private Sub btnFaceID_Click(ByVal Ctrl As Office.CommandBarButton, _ CancelDefault As Boolean) Dim i As Long With Application.CommandBars(Title) For i = .Controls.Count To .Controls.Count - 5 Step -1 With .Controls(i) .Style = msoButtonIconAndCaption If i = 107 Then .FaceId = Ctrl.FaceId .Caption = Ctrl.FaceId ElseIf i = 109 Then .Caption = "" & .Parent.Controls(107).Caption .FaceId = .Parent.Controls(107).FaceId ElseIf i 109 Then .Caption = "" & .Parent.Controls(i - 1).Caption .FaceId = .Parent.Controls(i - 1).FaceId End If End With Next i .Controls(108).Width = 230 - (.Controls(106).Width + _ ..Controls(107).Width) End With End Sub -------------------------------------------------------------------------- |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
mine's MUCH nicer.. <g but your history is cool.
but mine has extraction of pict/mask/merged bmp.... keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Jeremy Gollehon" wrote: http://snipurl.com/FaceID |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
btw.. office 2003 FaceID continues to 10030. <g
keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Jeremy Gollehon" wrote: http://snipurl.com/FaceID |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
Mine counts the number of faceids when it first starts up, so theoretically
compatible with future versions. Plus it has a favorites section, and a variable speed scan mode, you can resize the palette on the fly, and look up faceids by toolbar (again, the toolbars actually in your version of XL). Only took me 3 months to write, but I learned a lot, and what else are long winter night's good for? Doug Glancy "keepitcool" wrote in message ... btw.. office 2003 FaceID continues to 10030. <g keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Jeremy Gollehon" wrote: http://snipurl.com/FaceID |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
Hi keepitcool.
Your's is definitely cool, but a little heavy for me. I don't have a need for the extraction of the pict/mask/merged bmp. Is that for editing the icons? The history and easy flipping between sections is the main reason for my version. Also, thanks for the heads up on the extra faceID's office 2003. -Jeremy keepitcool wrote: mine's MUCH nicer.. <g but your history is cool. but mine has extraction of pict/mask/merged bmp.... keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Jeremy Gollehon" wrote: http://snipurl.com/FaceID |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
Wow Doug,
Have you made that thing publicly available? Sounds pretty impressive. -Jeremy Doug Glancy wrote: Mine counts the number of faceids when it first starts up, so theoretically compatible with future versions. Plus it has a favorites section, and a variable speed scan mode, you can resize the palette on the fly, and look up faceids by toolbar (again, the toolbars actually in your version of XL). Only took me 3 months to write, but I learned a lot, and what else are long winter night's good for? Doug Glancy |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
changing the individual onactions to 1 central handler with a select
case on actioncontrol.parameter might shorten it by a few lines... <g Winter? you must live on the southern hemispere... summer's just starting here keepITcool, Amsterdam < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Doug Glancy" wrote: Mine counts the number of faceids when it first starts up, so theoretically compatible with future versions. Plus it has a favorites section, and a variable speed scan mode, you can resize the palette on the fly, and look up faceids by toolbar (again, the toolbars actually in your version of XL). Only took me 3 months to write, but I learned a lot, and what else are long winter night's good for? Doug Glancy "keepitcool" wrote in message ... btw.. office 2003 FaceID continues to 10030. <g keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Jeremy Gollehon" wrote: http://snipurl.com/FaceID |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
Jeremy,
I'd like to, but I have no web site and it's an add-in. I'd be happy to send it to you though and see what you think. Doug "Jeremy Gollehon" wrote in message ... Wow Doug, Have you made that thing publicly available? Sounds pretty impressive. -Jeremy Doug Glancy wrote: Mine counts the number of faceids when it first starts up, so theoretically compatible with future versions. Plus it has a favorites section, and a variable speed scan mode, you can resize the palette on the fly, and look up faceids by toolbar (again, the toolbars actually in your version of XL). Only took me 3 months to write, but I learned a lot, and what else are long winter night's good for? Doug Glancy |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
I'd love to check it out. Most interested in the "favorites" section.
Just take out the BLAMSPAM. Doug Glancy wrote: Jeremy, I'd like to, but I have no web site and it's an add-in. I'd be happy to send it to you though and see what you think. Doug "Jeremy Gollehon" wrote in message ... Wow Doug, Have you made that thing publicly available? Sounds pretty impressive. -Jeremy Doug Glancy wrote: Mine counts the number of faceids when it first starts up, so theoretically compatible with future versions. Plus it has a favorites section, and a variable speed scan mode, you can resize the palette on the fly, and look up faceids by toolbar (again, the toolbars actually in your version of XL). Only took me 3 months to write, but I learned a lot, and what else are long winter night's good for? Doug Glancy |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
It's been done for a couple of months. I'm in beautiful Portland, OR. I
did learn about actioncontrol while writing it - through this fine newsgroup of course. Doug "keepitcool" wrote in message ... changing the individual onactions to 1 central handler with a select case on actioncontrol.parameter might shorten it by a few lines... <g Winter? you must live on the southern hemispere... summer's just starting here keepITcool, Amsterdam < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Doug Glancy" wrote: Mine counts the number of faceids when it first starts up, so theoretically compatible with future versions. Plus it has a favorites section, and a variable speed scan mode, you can resize the palette on the fly, and look up faceids by toolbar (again, the toolbars actually in your version of XL). Only took me 3 months to write, but I learned a lot, and what else are long winter night's good for? Doug Glancy "keepitcool" wrote in message ... btw.. office 2003 FaceID continues to 10030. <g keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Jeremy Gollehon" wrote: http://snipurl.com/FaceID |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
Jeremy,
I just sent it. It'll be a Yahoo email. Doug "Jeremy Gollehon" wrote in message ... I'd love to check it out. Most interested in the "favorites" section. Just take out the BLAMSPAM. Doug Glancy wrote: Jeremy, I'd like to, but I have no web site and it's an add-in. I'd be happy to send it to you though and see what you think. Doug "Jeremy Gollehon" wrote in message ... Wow Doug, Have you made that thing publicly available? Sounds pretty impressive. -Jeremy Doug Glancy wrote: Mine counts the number of faceids when it first starts up, so theoretically compatible with future versions. Plus it has a favorites section, and a variable speed scan mode, you can resize the palette on the fly, and look up faceids by toolbar (again, the toolbars actually in your version of XL). Only took me 3 months to write, but I learned a lot, and what else are long winter night's good for? Doug Glancy |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
Doug,
i'd like a copy too... email below or rot13 sender keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Doug Glancy" wrote: |
#13
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
I just sent it.
Doug "keepitcool" wrote in message ... Doug, i'd like a copy too... email below or rot13 sender keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Doug Glancy" wrote: |
#14
Posted to microsoft.public.excel.programming
|
|||
|
|||
FaceID Toolbar (The best one ever!)
OK, here's an updated version that should future proof my toolbar against
further additions to the FaceID count. Thanks to KeepITcool for pointing out the problem, and Doug Clancy for pointing my brain in a logical direction on how to tackle the problem. The code's slightly longer now though. :-( -Jeremy Regular code module: -------------------------------------------------------------------------- Option Explicit Option Private Module Public Const Title As String = "ShowMe the FaceId" Public IDToolbar As CommandBar Public btnID(1 To 100) As New FaceIDClass Sub ShowFaceIds() Dim i As Long Dim iFaceCount As Long On Error Resume Next 'Reset toolbar Application.CommandBars(Title).Delete Set IDToolbar = Application.CommandBars.Add(Title) 'Build toolbar With IDToolbar.Controls With .Add(msoControlButton) 'Previous button .FaceId = 3825 .OnAction = "Prev_Click" .Height = 30 End With With .Add(msoControlButton) 'Next button .FaceId = 3826 .OnAction = "Next_Click" End With .Add(msoControlButton).Width = 40 'Spacer With .Add(msoControlButton) 'JumpTo label .Style = msoButtonCaption .Caption = "Viewing" 'Determine the number of available FaceID's i = 4301 Do Until Err < 0 .FaceId = i i = i + 70 Loop Do Until Err = 0 Err = 0 i = i - 1 .FaceId = i Loop iFaceCount = i End With On Error GoTo 0 With .Add(msoControlComboBox) 'JumpTo dropdown .Caption = "JumpTo" .OnAction = "JumpTo_Change" For i = 1 To iFaceCount Step 100 .AddItem i & " to " & (i + 99) Next i .Width = 100 .ListIndex = 1 End With For i = 1 To 100 'FaceID buttons Set btnID(i).btnFaceID = .Add(msoControlButton) Next i With .Add(msoControlButton) 'Clear Button .Style = msoButtonCaption .Caption = "Clear History" .OnAction = "ClearHistory" .Width = 92 End With .Add(msoControlButton).Height = 30 'Spacer .Add(msoControlButton).Width = 114 'Spacer 'Selection history buttons For i = 1 To 4 .Add(msoControlButton).Height = 30 Next i End With 'Show Toolbar With IDToolbar .Width = 253 .Left = (Application.Width - .Width) / 2 .Top = (Application.Height - .Height) / 2 Call JumpTo_Change .Visible = True End With BPToolPak.EndTimer End Sub Sub JumpTo_Change() Dim IDRng As Double Dim btnIdx As Long, i As Long On Error Resume Next btnIdx = 6 IDRng = Val(IDToolbar.Controls(5).Text) For i = IDRng To IDRng + 99 With IDToolbar.Controls(btnIdx) .FaceId = i .TooltipText = i If Err < 0 Then .FaceId = 1 .TooltipText = "N/A" End If End With btnIdx = btnIdx + 1 Next i End Sub Sub Next_Click() With IDToolbar.Controls("JumpTo") If .ListIndex = .ListCount Then Beep Exit Sub End If .ListIndex = .ListIndex + 1 End With Call JumpTo_Change End Sub Sub Prev_Click() With IDToolbar.Controls("JumpTo") If .ListIndex = 1 Then Beep Exit Sub End If .ListIndex = .ListIndex - 1 End With Call JumpTo_Change End Sub Private Sub ClearHistory() Dim i As Long For i = 107 To 112 With IDToolbar.Controls(i) .FaceId = 1 .Caption = "" End With Next i End Sub -------------------------------------------------------------------------- Class module named FaceIDClass -------------------------------------------------------------------------- Option Explicit Public WithEvents btnFaceID As CommandBarButton Private Sub btnFaceID_Click(ByVal Ctrl As Office.CommandBarButton, _ CancelDefault As Boolean) Dim i As Long With Application.CommandBars(Title) For i = .Controls.Count To .Controls.Count - 5 Step -1 With .Controls(i) .Style = msoButtonIconAndCaption If i = 107 Then .FaceId = Ctrl.FaceId .Caption = Ctrl.FaceId ElseIf i = 109 Then .Caption = "" & .Parent.Controls(107).Caption .FaceId = .Parent.Controls(107).FaceId ElseIf i 109 Then .Caption = "" & .Parent.Controls(i - 1).Caption .FaceId = .Parent.Controls(i - 1).FaceId End If End With Next i .Controls(108).Width = 230 - (.Controls(106).Width + ..Controls(107).Width) End With End Sub keepitcool wrote: btw.. office 2003 FaceID continues to 10030. <g keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Jeremy Gollehon" wrote: http://snipurl.com/FaceID |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Button Faceid | Excel Programming | |||
Menu question + FaceId questions | Excel Programming | |||
Faceid 2003. | Excel Programming | |||
CommandBarButton.FaceId=? | Excel Programming | |||
Toolbar icons./ FaceID Bitmaps. | Excel Programming |