home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / flyout / module1.bas < prev    next >
BASIC Source File  |  1992-12-28  |  22KB  |  561 lines

  1. Option Explicit
  2.  
  3. '*************************************************************************
  4. '*                                                                       *
  5. '*                            GLOBAL CONSTANTS                           *
  6. '*                                                                       *
  7. '*************************************************************************
  8.  
  9.  
  10. '
  11. ' GetSystemMetrics() codes
  12. '
  13.  
  14. Global Const SM_CXSCREEN = 0
  15. Global Const SM_CYSCREEN = 1
  16. Global Const SM_CXVSCROLL = 2
  17. Global Const SM_CYHSCROLL = 3
  18. Global Const SM_CYCAPTION = 4
  19. Global Const SM_CXBORDER = 5
  20. Global Const SM_CYBORDER = 6
  21. Global Const SM_CXDLGFRAME = 7
  22. Global Const SM_CYDLGFRAME = 8
  23. Global Const SM_CYVTHUMB = 9
  24. Global Const SM_CXHTHUMB = 10
  25. Global Const SM_CXICON = 11
  26. Global Const SM_CYICON = 12
  27. Global Const SM_CXCURSOR = 13
  28. Global Const SM_CYCURSOR = 14
  29. Global Const SM_CYMENU = 15
  30. Global Const SM_CXFULLSCREEN = 16
  31. Global Const SM_CYFULLSCREEN = 17
  32. Global Const SM_CYKANJIWINDOW = 18
  33. Global Const SM_MOUSEPRESENT = 19
  34. Global Const SM_CYVSCROLL = 20
  35. Global Const SM_CXHSCROLL = 21
  36. Global Const SM_DEBUG = 22
  37. Global Const SM_SWAPBUTTON = 23
  38. Global Const SM_RESERVED1 = 24
  39. Global Const SM_RESERVED2 = 25
  40. Global Const SM_RESERVED3 = 26
  41. Global Const SM_RESERVED4 = 27
  42. Global Const SM_CXMIN = 28
  43. Global Const SM_CYMIN = 29
  44. Global Const SM_CXSIZE = 30
  45. Global Const SM_CYSIZE = 31
  46. Global Const SM_CXFRAME = 32
  47. Global Const SM_CYFRAME = 33
  48. Global Const SM_CXMINTRACK = 34
  49. Global Const SM_CYMINTRACK = 35
  50. Global Const SM_CMETRICS = 36
  51.  
  52.  
  53. '
  54. ' API message constants.
  55. '
  56.  
  57. Global Const WM_MOVE = &H3
  58. Global Const WM_MOUSEFIRST = &H200
  59. Global Const WM_MOUSEMOVE = &H200
  60. Global Const WM_LBUTTONDOWN = &H201
  61. Global Const WM_LBUTTONUP = &H202
  62. Global Const WM_LBUTTONDBLCLK = &H203
  63. Global Const WM_RBUTTONDOWN = &H204
  64. Global Const WM_RBUTTONUP = &H205
  65. Global Const WM_RBUTTONDBLCLK = &H206
  66. Global Const WM_MBUTTONDOWN = &H207
  67. Global Const WM_MBUTTONUP = &H208
  68. Global Const WM_MBUTTONDBLCLK = &H209
  69. Global Const WM_MOUSELAST = &H209
  70.  
  71. ' Key State Masks for Mouse Messages
  72. Global Const MK_LBUTTON = &H1
  73. Global Const MK_RBUTTON = &H2
  74. Global Const MK_SHIFT = &H4
  75. Global Const MK_CONTROL = &H8
  76. Global Const MK_MBUTTON = &H10
  77.  
  78.  
  79. '
  80. ' My constants
  81. '
  82.  
  83. Global Const MODELESS = 0                    ' Show forms as modeless.
  84. Global Const MODAL = 1                       ' Show forms as modal.
  85.  
  86. Global Const LEFT_BUTTON = 1                 ' VB's code for left mouse button in MouseDown event.
  87. Global Const RIGHT_BUTTON = 2                ' VB's code for right mouse button in MouseDown event.
  88.  
  89. Global Const MAX_TOOLBOX_ITEMS = 16          ' Maximum number of items allowed in a toolbox.
  90. Global Const MAX_FLYOUT_ITEMS = 16           ' Maximum number of items allowed in a flyout.
  91.  
  92. Global Const WM_USER = &H400                 ' Used in PostMessage() call from flyout to toolbox.
  93.  
  94. Global Const ICON_ARC = 0                    ' Indexes into PictureClip control bitmap for all
  95. Global Const ICON_BOLD = 5                   '  icons.  Bitmap is 5 columns by 20 rows.  The
  96. Global Const ICON_BUTTON = 10                '  first column contains the normal version of
  97. Global Const ICON_CAMERA = 15                '  each icon.  The second column contains the
  98. Global Const ICON_CENTERJUST = 20            '  depressed version of the icon.  Columns 3-5
  99. Global Const ICON_DOUBLEUNDERLINE = 25       '  are not used.
  100. Global Const ICON_HELP = 30
  101. Global Const ICON_ITALIC = 35
  102. Global Const ICON_FULLJUST = 40
  103. Global Const ICON_LEFTJUST = 45
  104. Global Const ICON_LINE = 50
  105. Global Const ICON_MACRO = 55
  106. Global Const ICON_OVAL = 60
  107. Global Const ICON_PRINTER = 65
  108. Global Const ICON_RECTANGLE = 70
  109. Global Const ICON_SMALLCAPS = 75
  110. Global Const ICON_SUMMATION = 80
  111. Global Const ICON_CENTERTAB = 85
  112. Global Const ICON_DECIMALTAB = 90
  113. Global Const ICON_LEFTTAB = 95
  114.  
  115. Global Const ICON_DEPRESSED = 1              ' Add this to the base index of an icon to get the
  116.                                              '  PictureClip control index for the depressed icon.
  117.  
  118. '*************************************************************************
  119. '*                                                                       *
  120. '*                       DATA STRUCTURE DEFINITIONS                      *
  121. '*                                                                       *
  122. '*************************************************************************
  123.  
  124. Type POINTAPI
  125.    X As Integer
  126.    Y As Integer
  127. End Type
  128.  
  129.  
  130. Type tagIcons
  131.    icon_index                 As Integer     ' Index of icon im PictureClip control
  132.    help_str                   As String      ' Help string for this icon
  133. End Type
  134.  
  135.  
  136. Type tagFlyoutData
  137.    num_icons                  As Integer
  138.    num_columns                As Integer
  139.    num_rows                   As Integer
  140. End Type
  141.  
  142.  
  143. Type tagToolBox
  144.    title                      As String      ' Caption for toolbox window
  145.    num_items                  As Integer     ' Number of icons in this toolbox (must be 1..16)
  146.    num_columns                As Integer     ' Number of column in this toolbox (must defined)
  147.    num_rows                   As Integer     ' Number of rows in toolbox (is calculated)
  148.    tool_selected              As Integer     ' Index in icons() of selected tool.
  149.    icons(0 To 15, 0 To 16)    As tagIcons    ' Contains description for all icons in a toolbox
  150.                                              '  as well as the flyout associated with each tool.
  151.                                              '  icons(x,0) is description for toolbox tool icon X
  152.                                              '  icons(x,y) is decsription for icon Y on the
  153.                                              '  flyout menu displayed when tool X is selected.
  154.    flyout_data(0 To 15)       As tagFlyoutData
  155.                                              ' Contains data for every flyout.  The number_icons
  156.                                              '  and num_columns fields must be set.  The num_rows
  157.                                              '  field is calulated.  Each element corresponds to
  158.                                              '  the flyout for the toolbox icon with the same
  159.                                              '  index.  the field number_icons must be in the
  160.                                              '  range 1..16.  The field num_columns must be
  161.                                              '  defined; num_rows is calculated.
  162.    flyout_item_selected       As Integer     ' Index in icons() for the flyout menu icon selected
  163.                                              '  (e.g., icons(tool_selected,flyout_item_selected))
  164. End Type
  165.  
  166.  
  167.  
  168. '*************************************************************************
  169. '*                                                                       *
  170. '*                            GLOBAL VARIABLES                           *
  171. '*                                                                       *
  172. '*************************************************************************
  173.  
  174. Global gToolbox As tagToolBox                 ' The definition for our toolbox.
  175.  
  176.  
  177. '*************************************************************************
  178. '*                                                                       *
  179. '*                    API AND DLL ROUTINE DECLARATIONS                   *
  180. '*                                                                       *
  181. '*************************************************************************
  182.  
  183. Declare Function GetSystemMetrics% Lib "User" (ByVal nIndex%)
  184. Declare Sub dwDWORDto2Integers Lib "dwspydll.dll" (ByVal l&, X%, Y%)
  185. Declare Sub MoveWindow Lib "User" (ByVal hWnd%, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal bRepaint%)
  186. Declare Function SetCapture% Lib "User" (ByVal hWnd%)
  187. Declare Sub ReleaseCapture Lib "User" ()
  188. Declare Function PostMessage% Lib "User" (ByVal hWnd%, ByVal wMsg%, ByVal wParam%, ByVal lParam&)
  189.  
  190. Sub ArrangeFlyout ()
  191.  
  192.    Dim border_width%                   ' Width of the flyout window border
  193.    Dim border_height%                  ' Height of the flyout window border
  194.    Dim caption_height%                 ' Height of the toolbox window caption
  195.    Dim x_pos%                          ' Left position of the flyout window
  196.    Dim y_pos%                          ' Top position of the flyout window
  197.    Dim client_width%                   ' Width of the client area of the flyout window
  198.    Dim client_height%                  ' Height of the client area of the flyout window
  199.    Dim image_height%                   ' Height of the Image control used to a flyout icon
  200.    Dim image_width%                    ' Width of the Image control used to a flyout icon
  201.    Dim row%                            ' Temp var
  202.    Dim column%                         ' Temp var
  203.    Dim temp%                           ' Temp var
  204.  
  205.    
  206.    '
  207.    ' Set the flyout_item_selected field in the Toolbox structure to -1 to indicate
  208.    ' no flyout menu item has been selected.
  209.    '
  210.  
  211.    gToolbox.flyout_item_selected = -1
  212.  
  213.  
  214.    '
  215.    ' Calculate the number of rows in the flyout.
  216.    '
  217.  
  218.    gToolbox.flyout_data(gToolbox.tool_selected).num_rows = (gToolbox.flyout_data(gToolbox.tool_selected).num_icons \ gToolbox.flyout_data(gToolbox.tool_selected).num_columns) - ((gToolbox.flyout_data(gToolbox.tool_selected).num_icons Mod gToolbox.flyout_data(gToolbox.tool_selected).num_columns) > 0)
  219.  
  220.    
  221.    '
  222.    ' Get the size of the flyout window's borders.
  223.    '
  224.    
  225.    caption_height% = GetSystemMetrics%(SM_CYCAPTION)
  226.    border_height% = GetSystemMetrics%(SM_CYBORDER)
  227.    border_width% = GetSystemMetrics%(SM_CXBORDER)
  228.    
  229.    
  230.    '
  231.    ' Get and store the height and width of the Images in the flyout window.
  232.    '
  233.  
  234.    image_height% = frmFlyout!Image1(0).Height
  235.    image_width% = frmFlyout!Image1(0).Width
  236.    
  237.    
  238.    '
  239.    ' Calculate the width and height of the client area of the
  240.    ' flyout window.
  241.    '
  242.  
  243.    client_width% = gToolbox.flyout_data(gToolbox.tool_selected).num_columns * image_width%
  244.    client_height% = gToolbox.flyout_data(gToolbox.tool_selected).num_rows * image_height%
  245.  
  246.    
  247.    '
  248.    ' Calculate the left and top position for the flyout window.
  249.    ' The top of the flyout menu is aligned with the bottom edge of
  250.    ' its tool icon in the toolbox.
  251.    ' The left side of the flyout menu is aligned with the midpoint of
  252.    ' its tool icon in the toolbox.
  253.    '
  254.  
  255.    x_pos% = ((MDIForm1.Left + frmToolbox.Left) \ Screen.TwipsPerPixelX) + border_width% + frmToolbox!Image1(gToolbox.tool_selected).Left + (frmToolbox!Image1(gToolbox.tool_selected).Width \ 2)
  256.    y_pos% = ((MDIForm1.Top + frmToolbox.Top) \ Screen.TwipsPerPixelY) + caption_height% + frmToolbox!Image1(gToolbox.tool_selected).Top + (frmToolbox!Image1(gToolbox.tool_selected).Height * 2)
  257.    
  258.    
  259.    '
  260.    ' Move the flyout window to its initial location and size
  261.    ' it appropriately.
  262.    '
  263.  
  264.    Call MoveWindow(frmFlyout.hWnd, x_pos%, y_pos%, (client_width% + (2 * border_width%)), client_height%, False)
  265.  
  266.    
  267.    '
  268.    ' For every icon in the flyout...
  269.    ' Place its Image in the correct location.
  270.    ' Load the correct icon from the PictureClip control.
  271.    '
  272.  
  273.    temp% = 0
  274.    
  275.    For row% = 0 To (gToolbox.flyout_data(gToolbox.tool_selected).num_rows - 1)
  276.       
  277.       For column% = 0 To (gToolbox.flyout_data(gToolbox.tool_selected).num_columns - 1)
  278.          
  279.          If (temp% < gToolbox.flyout_data(gToolbox.tool_selected).num_icons) Then
  280.             frmFlyout!Image1(temp%).Top = row% * image_height%
  281.             frmFlyout!Image1(temp%).Left = column% * image_width%
  282.             frmFlyout!Image1(temp%).Picture = frmToolbox!PicClip1.GraphicCell(gToolbox.icons(gToolbox.tool_selected, (temp% + 1)).icon_index)
  283.             frmFlyout.Image1(temp%).Visible = True
  284.          End If
  285.          temp% = temp% + 1
  286.       
  287.       Next column%
  288.    
  289.    Next row%
  290.  
  291.  
  292.    '
  293.    ' Make all the unused Images invisible.
  294.    '
  295.  
  296.    If (gToolbox.flyout_data(gToolbox.tool_selected).num_icons < MAX_FLYOUT_ITEMS) Then
  297.       For temp% = gToolbox.flyout_data(gToolbox.tool_selected).num_icons To (MAX_FLYOUT_ITEMS - 1)
  298.          frmFlyout.Image1(temp%).Visible = False
  299.       Next temp%
  300.    End If
  301.  
  302. End Sub
  303.  
  304. Sub ArrangeToolbox ()
  305.  
  306.    Dim border_width%                   ' Width of the flyout window border
  307.    Dim border_height%                  ' Height of the flyout window border
  308.    Dim caption_height%                 ' Height of the toolbox window caption
  309.    Dim client_width%                   ' Width of the client area of the flyout window
  310.    Dim client_height%                  ' Height of the client area of the flyout window
  311.    Dim image_height%                   ' Height of the Image control used to a flyout icon
  312.    Dim image_width%                    ' Width of the Image control used to a flyout icon
  313.    Dim row%                            ' Temp var
  314.    Dim column%                         ' Temp var
  315.    Dim temp%                           ' Temp var
  316.  
  317.  
  318.    '
  319.    ' Set the tool_selected field in the Toolbox structure to -1 to indicate
  320.    ' no tool has been selected.
  321.    '
  322.  
  323.    gToolbox.tool_selected = -1
  324.  
  325.  
  326.    '
  327.    ' Calculate the number of rows in the toolbox.
  328.    '
  329.  
  330.    gToolbox.num_rows = (gToolbox.num_items \ gToolbox.num_columns) - ((gToolbox.num_items Mod gToolbox.num_columns) > 0)
  331.  
  332.    
  333.    '
  334.    ' Get the size of the toolbox window's borders and caption.
  335.    '
  336.  
  337.    caption_height% = GetSystemMetrics%(SM_CYCAPTION)
  338.    border_height% = GetSystemMetrics%(SM_CYBORDER)
  339.    border_width% = GetSystemMetrics%(SM_CXBORDER)
  340.    
  341.    
  342.    '
  343.    ' Calculate the width and height of the client area of the
  344.    ' toolbox window.
  345.    '
  346.  
  347.    client_width% = gToolbox.num_columns * frmToolbox!Image1(0).Width
  348.    client_height% = gToolbox.num_rows * frmToolbox!Image1(0).Height
  349.  
  350.    
  351.    '
  352.    ' For every icon in the toolbox...
  353.    ' Place its Image in the correct location.
  354.    ' Load the correct icon from the PictureClip control.
  355.    ' Make the Image visible.
  356.    '
  357.  
  358.    temp% = 0
  359.    image_height% = frmToolbox!Image1(0).Height
  360.    image_width% = frmToolbox!Image1(0).Width
  361.    
  362.    For row% = 0 To (gToolbox.num_rows - 1)
  363.       
  364.       For column% = 0 To (gToolbox.num_columns - 1)
  365.          
  366.          If (temp% < gToolbox.num_items) Then
  367.             frmToolbox!Image1(temp%).Top = row% * image_height%
  368.             frmToolbox!Image1(temp%).Left = column% * image_width%
  369.             frmToolbox!Image1(temp%).Picture = frmToolbox!PicClip1.GraphicCell(gToolbox.icons(temp%, 0).icon_index)
  370.             frmToolbox.Image1(temp%).Visible = True
  371.          End If
  372.          temp% = temp% + 1
  373.       
  374.       Next column%
  375.    
  376.    Next row%
  377.  
  378.  
  379.    '
  380.    ' Make all the unused Images invisible.
  381.    '
  382.  
  383.    If (gToolbox.num_items < MAX_TOOLBOX_ITEMS) Then
  384.       For temp% = gToolbox.num_items To (MAX_TOOLBOX_ITEMS - 1)
  385.          frmToolbox.Image1(temp%).Visible = False
  386.       Next temp%
  387.    End If
  388.  
  389.    
  390.    '
  391.    ' Move the toolbox window to its initial location and size
  392.    ' it appropriately.
  393.    '
  394.  
  395.    Call MoveWindow(frmToolbox.hWnd, 10, 10, (client_width% + (2 * border_width%)), (client_height% + caption_height%), True)
  396.  
  397. End Sub
  398.  
  399. Sub InitializeToolbox ()
  400.  
  401.    '
  402.    ' Set the title for the toolbox, the number of columns in the
  403.    ' toolbox, and the number of tools in the Toolbox.
  404.    '
  405.  
  406.    gToolbox.title = "Tools"
  407.    gToolbox.num_items = 6
  408.    gToolbox.num_columns = 2
  409.    
  410.    
  411.    '
  412.    ' For each tool in the toolbox, define its icon and help string.
  413.    '
  414.  
  415.    gToolbox.icons(0, 0).icon_index = ICON_CENTERJUST
  416.    gToolbox.icons(0, 0).help_str = "Center justification tool."
  417.    gToolbox.icons(1, 0).icon_index = ICON_DOUBLEUNDERLINE
  418.    gToolbox.icons(1, 0).help_str = "Double underline tool."
  419.    gToolbox.icons(2, 0).icon_index = ICON_ITALIC
  420.    gToolbox.icons(2, 0).help_str = "Italic tool."
  421.    gToolbox.icons(3, 0).icon_index = ICON_FULLJUST
  422.    gToolbox.icons(3, 0).help_str = "Full justification tool."
  423.    gToolbox.icons(4, 0).icon_index = ICON_LEFTJUST
  424.    gToolbox.icons(4, 0).help_str = "Left justification tool."
  425.    gToolbox.icons(5, 0).icon_index = ICON_SMALLCAPS
  426.    gToolbox.icons(5, 0).help_str = "Small caps tool."
  427.  
  428.  
  429.    '
  430.    ' For each tool in the toolbox, define its flyout menu.
  431.    '
  432.    ' Define the number of icons in the flyout and the number
  433.    ' of columns in the flyout.
  434.    '
  435.    ' Define the icons in the flyout and the help string for
  436.    ' each icon.
  437.    '
  438.  
  439.    gToolbox.flyout_data(0).num_icons = 4                     ' Flyout for Tool #0
  440.    gToolbox.flyout_data(0).num_columns = 4
  441.  
  442.    gToolbox.icons(0, 1).icon_index = ICON_ARC
  443.    gToolbox.icons(0, 1).help_str = "Arc command."
  444.    gToolbox.icons(0, 2).icon_index = ICON_BOLD
  445.    gToolbox.icons(0, 2).help_str = "Bold command."
  446.    gToolbox.icons(0, 3).icon_index = ICON_BUTTON
  447.    gToolbox.icons(0, 3).help_str = "Button command."
  448.    gToolbox.icons(0, 4).icon_index = ICON_CAMERA
  449.    gToolbox.icons(0, 4).help_str = "Camera command."
  450.  
  451.  
  452.  
  453.    gToolbox.flyout_data(1).num_icons = 6                     ' Flyout for Tool #1
  454.    gToolbox.flyout_data(1).num_columns = 3
  455.  
  456.    gToolbox.icons(1, 1).icon_index = ICON_LINE
  457.    gToolbox.icons(1, 1).help_str = "Line command."
  458.    gToolbox.icons(1, 2).icon_index = ICON_MACRO
  459.    gToolbox.icons(1, 2).help_str = "Macro command."
  460.    gToolbox.icons(1, 3).icon_index = ICON_OVAL
  461.    gToolbox.icons(1, 3).help_str = "Oval command."
  462.    gToolbox.icons(1, 4).icon_index = ICON_PRINTER
  463.    gToolbox.icons(1, 4).help_str = "Printer command."
  464.    gToolbox.icons(1, 5).icon_index = ICON_RECTANGLE
  465.    gToolbox.icons(1, 5).help_str = "Rectangle command."
  466.    gToolbox.icons(1, 6).icon_index = ICON_SUMMATION
  467.    gToolbox.icons(1, 6).help_str = "Summation command."
  468.  
  469.  
  470.  
  471.    gToolbox.flyout_data(2).num_icons = 3                     ' Flyout for Tool #2
  472.    gToolbox.flyout_data(2).num_columns = 3
  473.  
  474.    gToolbox.icons(2, 1).icon_index = ICON_CENTERTAB
  475.    gToolbox.icons(2, 1).help_str = "Center tab command."
  476.    gToolbox.icons(2, 2).icon_index = ICON_DECIMALTAB
  477.    gToolbox.icons(2, 2).help_str = "Decimal tab command."
  478.    gToolbox.icons(2, 3).icon_index = ICON_LEFTTAB
  479.    gToolbox.icons(2, 3).help_str = "Left tab command."
  480.  
  481.  
  482.  
  483.    gToolbox.flyout_data(3).num_icons = 5                     ' Flyout for Tool #3
  484.    gToolbox.flyout_data(3).num_columns = 5
  485.  
  486.    gToolbox.icons(3, 1).icon_index = ICON_DOUBLEUNDERLINE
  487.    gToolbox.icons(3, 1).help_str = "Double underline command."
  488.    gToolbox.icons(3, 2).icon_index = ICON_HELP
  489.    gToolbox.icons(3, 2).help_str = "Help command."
  490.    gToolbox.icons(3, 3).icon_index = ICON_ITALIC
  491.    gToolbox.icons(3, 3).help_str = "Italic command."
  492.    gToolbox.icons(3, 4).icon_index = ICON_FULLJUST
  493.    gToolbox.icons(3, 4).help_str = "Full justification command."
  494.    gToolbox.icons(3, 5).icon_index = ICON_LEFTJUST
  495.    gToolbox.icons(3, 5).help_str = "Left justification command."
  496.  
  497.  
  498.  
  499.    gToolbox.flyout_data(4).num_icons = 10                    ' Flyout for Tool #4
  500.    gToolbox.flyout_data(4).num_columns = 5
  501.  
  502.    gToolbox.icons(4, 1).icon_index = ICON_ARC
  503.    gToolbox.icons(4, 1).help_str = "Arc command."
  504.    gToolbox.icons(4, 2).icon_index = ICON_BOLD
  505.    gToolbox.icons(4, 2).help_str = "Bold command."
  506.    gToolbox.icons(4, 3).icon_index = ICON_BUTTON
  507.    gToolbox.icons(4, 3).help_str = "Button command."
  508.    gToolbox.icons(4, 4).icon_index = ICON_CAMERA
  509.    gToolbox.icons(4, 4).help_str = "Camera command."
  510.    gToolbox.icons(4, 5).icon_index = ICON_CENTERJUST
  511.    gToolbox.icons(4, 5).help_str = "Center justification command."
  512.    gToolbox.icons(4, 6).icon_index = ICON_DOUBLEUNDERLINE
  513.    gToolbox.icons(4, 6).help_str = "Double underline command."
  514.    gToolbox.icons(4, 7).icon_index = ICON_HELP
  515.    gToolbox.icons(4, 7).help_str = "Help command."
  516.    gToolbox.icons(4, 8).icon_index = ICON_ITALIC
  517.    gToolbox.icons(4, 8).help_str = "Italic command."
  518.    gToolbox.icons(4, 9).icon_index = ICON_FULLJUST
  519.    gToolbox.icons(4, 9).help_str = "Full justification command."
  520.    gToolbox.icons(4, 10).icon_index = ICON_LEFTJUST
  521.    gToolbox.icons(4, 10).help_str = "Left justification command."
  522.  
  523.  
  524.  
  525.    gToolbox.flyout_data(5).num_icons = 10                    ' Flyout for Tool #5
  526.    gToolbox.flyout_data(5).num_columns = 5
  527.  
  528.    gToolbox.icons(5, 1).icon_index = ICON_LINE
  529.    gToolbox.icons(5, 1).help_str = "Line command."
  530.    gToolbox.icons(5, 2).icon_index = ICON_MACRO
  531.    gToolbox.icons(5, 2).help_str = "Macro command."
  532.    gToolbox.icons(5, 3).icon_index = ICON_OVAL
  533.    gToolbox.icons(5, 3).help_str = "Oval command."
  534.    gToolbox.icons(5, 4).icon_index = ICON_PRINTER
  535.    gToolbox.icons(5, 4).help_str = "Printer command."
  536.    gToolbox.icons(5, 5).icon_index = ICON_RECTANGLE
  537.    gToolbox.icons(5, 5).help_str = "Rectangle command."
  538.    gToolbox.icons(5, 6).icon_index = ICON_SMALLCAPS
  539.    gToolbox.icons(5, 6).help_str = "Small caps command."
  540.    gToolbox.icons(5, 7).icon_index = ICON_SUMMATION
  541.    gToolbox.icons(5, 7).help_str = "Summation command."
  542.    gToolbox.icons(5, 8).icon_index = ICON_CENTERTAB
  543.    gToolbox.icons(5, 8).help_str = "Center tab command."
  544.    gToolbox.icons(5, 9).icon_index = ICON_DECIMALTAB
  545.    gToolbox.icons(5, 9).help_str = "Decimal tab command."
  546.    gToolbox.icons(5, 10).icon_index = ICON_LEFTTAB
  547.    gToolbox.icons(5, 10).help_str = "Left tab command."
  548.  
  549. End Sub
  550.  
  551. Sub ProcessFlyoutSelection ()
  552.  
  553.    If (gToolbox.flyout_item_selected > -1) Then
  554.       MsgBox "Selected flyout item: " + gToolbox.icons(gToolbox.tool_selected, (gToolbox.flyout_item_selected + 1)).help_str, 64, "Flyout"
  555.    Else
  556.       MsgBox "No flyout item selected", 64, "Flyout"
  557.    End If
  558.  
  559. End Sub
  560.  
  561.