PowerBuilder Function Get Toolbar Index gf_get_toolbar_indexes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Function Name : gf_get_toolbar_indexes // Argument Name : am_source, Arg Type : Menu, Pass By : Value // ai_index[], Arg Type : Integer, Pass By : Reference // Return Type : Integer /////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Arguments: // am_Source The menu whose indexes are wanted. // ai_Index[] Array to hold all unique toolbar indexes found. // // Returns: integer // The number of indexes found or -1 if an error occurs. // // Description: Get all the toolbar indexes for the menu associated // with a window. /////////////////////////////////////////////////////////////////////////////////////////////////////////////// Integer li_Limit Integer li_Cnt Integer li_ToolbarItembarindex Boolean lb_Found // Check if this item has a toolbar If Len(am_Source.ToolbarItemName) > 0 Then If am_Source.ToolbarItemBarIndex > 0 Then // Check if it has already been added to the array li_Limit = UpperBound(ai_Index) lb_Found = False For li_Cnt = 1 To li_Limit If ai_Index[li_Cnt] = am_Source.ToolbarItemBarIndex Then lb_Found = True Next // If not in array, add it If Not lb_Found Then ai_Index[li_Limit + 1] = am_Source.ToolbarItemBarIndex End If End If // Search through the rest of the menu li_Limit = UpperBound (am_Source.Item) For li_Cnt = 1 To li_Limit f_get_toolbar_indexes(am_Source.Item[li_Cnt], ai_Index) Next Return UpperBound(ai_Index) |
Good Luck!