Quantcast
Channel: Manufacturing DevBlog
Viewing all articles
Browse latest Browse all 518

Progressive Tooltip with Button

$
0
0

By Xiaodong Liang

Progressive Tooltip provides the expanded help tip with more various information.

image

 

Inventor 2011 has exposed the relevant API. The ControlDefinition.ProgressiveToolTip allows you to customize your button. Although we normally create button in an add-in, the following VBA code is a demo how the workflow could be. I have answered a forum question last year with such code. It adds a button in Part>>3D Model >> Work Features with the progressive tooltip.

Public Sub ProgressiveToolTips()   
   Dim g_FilePath As String
   g_FilePath = "C:\temp\"
 
    ' Create the button definition.
    Dim smallIcon As IPictureDisp
    Set smallIcon = LoadPicture(g_FilePath & "SmallProgTooltip.bmp")
   
    Dim largeIcon As IPictureDisp
    Set largeIcon = LoadPicture(g_FilePath & "LargeProgTooltip.bmp")
   
    Dim buttonDef As ButtonDefinition
    Set buttonDef = ThisApplication.CommandManager.ControlDefinitions.AddButtonDefinition("Sample1", "SampleCommand", kQueryOnlyCmdType, "", "Sample command to show progressive tool tips.", "Sample", smallIcon, largeIcon)
   
    ' Add a control to the Work Feature panel of the Model tab of the Part ribbon.
    Call ThisApplication.UserInterfaceManager.Ribbons.Item("Part").RibbonTabs.Item("id_TabModel").RibbonPanels.Item("id_PanelA_ModelWorkFeatures").CommandControls.AddButton(buttonDef, True)
   
    ' Define the progressive tooltip.  This would typically be done in the
    ' same section of code where the button definition is created but there's
    ' a problem with the beta version where the progressive tooltip can only
    ' be defined on a control has been created.
    With buttonDef.ProgressiveToolTip
        .Description = "The short description."
        .ExpandedDescription = "This is the long expaned version of the description that could have a more complete description to accompany the picture."
        Dim progImage As IPictureDisp
        Set progImage = LoadPicture(g_FilePath & "koala.jpg")
         .Image = progImage
        .IsProgressive = True
        .Title = "Sample1"
      
    End With
End Sub

 

image


Viewing all articles
Browse latest Browse all 518

Trending Articles