enumerate menu items

You have to use PROP:NextField, here’s a small example. In it I’m enumerating the menu and storing the structure and properties in a queue.

  ThisField   LONG,AUTO
  CODE
  FREE(mQ)
  ThisField = 0
  LOOP
    ThisField = SELF.W{PROP:NextField, ThisField}  !Get the next feq out of the array
    IF ThisField = 0 THEN BREAK.                    !done when the feq is zero again

    CASE SELF.W $ThisField{PROP:Type}
    OF CREATE:MenuBar OROF CREATE:Menu OROF CREATE:Item
      SELF.GetMenuItemProperties(mQ, ThisField)
      IF mQ.pType = CREATE:MenuBar
        SELF.MenuBarFeq = mQ.Feq
      END
      ADD(mQ, -mQ.ParentFeq, -mQ.Feq)
      ...
    END
  END

Cheers,
Larry Sand

Schreibe einen Kommentar