Public Sub init_panels()
Dim panel_name As String
Dim nCurLang As Long
panel_name = "Woodman Panel"
panel_installed = False
For i = 1 To CommandBars.Count
If CommandBars(i).Name = panel_name Then
panel_installed = True
Exit For
End If
Next
If Not panel_installed Then
Application.FrameWork.CommandBars.Add panel_name
Application.FrameWork.CommandBars(panel_name).Enabled = True
Application.FrameWork.CommandBars(panel_name).Visible = True
t_m = "Panel by Woodman"
ad_m = True
t_f = "Fonts collection"
ad_f = True
t_mi = "Mini info"
ad_mi = True
t_s13 = "Save old version"
ad_s13 = True
t_sdxf = "Save to DXF"
ad_sdxf = True
t_col_trans = "Make transparent"
ad_col_trans = True
t_col_def = "Make default color"
ad_col_def = True
For Each c In Application.FrameWork.CommandBars(panel_name).Controls
Select Case c.Caption
Case t_m: ad_m = False
Case t_f: ad_f = False
Case t_mi: ad_mi = False
Case t_s13: ad_s13 = False
Case t_sdxf: ad_sdxf = False
Case t_col_trans: ad_col_trans = False
Case t_col_def: ad_col_def = False
End Select
Next c
If ad_m Then
Set b = Application.FrameWork.CommandBars(panel_name).Controls.AddCustomButton("2cc24a3e-fe24-4708-9a74-9c75406eebcd", "woodman.woodman_panel.tools_panel")
b.Caption = t_m
b.ToolTipText = "Macros Panel by Woodman"
End If
If ad_f Then
Set b = Application.FrameWork.CommandBars(panel_name).Controls.AddCustomButton("2cc24a3e-fe24-4708-9a74-9c75406eebcd", "woodman.woodman_panel.tools_font_collect")
b.Caption = t_f
b.ToolTipText = "Font Collection"
End If
If ad_mi Then
Set b = Application.FrameWork.CommandBars(panel_name).Controls.AddCustomButton("2cc24a3e-fe24-4708-9a74-9c75406eebcd", "woodman.woodman_panel.tools_info_mini")
b.Caption = t_mi
b.ToolTipText = "Mini info panel"
End If
If ad_s13 Then
Set b = Application.FrameWork.CommandBars(panel_name).Controls.AddCustomButton("2cc24a3e-fe24-4708-9a74-9c75406eebcd", "woodman.woodman_panel.save_13v")
b.Caption = t_s13
b.ToolTipText = "Save current file to oldest version"
End If
If ad_sdxf Then
Set b = Application.FrameWork.CommandBars(panel_name).Controls.AddCustomButton("2cc24a3e-fe24-4708-9a74-9c75406eebcd", "woodman.woodman_panel.Save_dxf")
b.Caption = t_sdxf
b.ToolTipText = "Save to DXF with the same name"
End If
If ad_col_trans Then
Set b = Application.FrameWork.CommandBars(panel_name).Controls.AddCustomButton("2cc24a3e-fe24-4708-9a74-9c75406eebcd", "woodman.woodman_panel.set_color_transparent")
b.Caption = t_col_trans
b.ToolTipText = "Make picture transparent an locked"
End If
If ad_col_def Then
Set b = Application.FrameWork.CommandBars(panel_name).Controls.AddCustomButton("2cc24a3e-fe24-4708-9a74-9c75406eebcd", "woodman.woodman_panel.set_color_def")
b.Caption = t_col_def
b.ToolTipText = "Make default fill and contour"
End If
End If
On Error GoTo 0
End Sub