` Printed Icetips Article

Icetips Article



Par2: Popup menus don't work when there are no records in the list
1998-05-21 -- Russ Eggen
 
The reason this happens is that ABC calls the pop-up on EVENT:NewSelection.
Since no records are there, there is no EVENT:NewSelection to generate.
However, there is a way to make this work:

In your Init() method (priority LAST) add this:
?List{PROP:ALRT,255} = MouseRight    !Alert right-click

Then in the first EVENT:AlertKey embed for ?List control in the
ThisWindow.TakeFieldEvent:
IF KeyCode() = MouseRight AND RECORDS(BRW1.Q) = 0
  POST(EVENT:NewSelection,?List)     !Post the event ABC uses for pop-ups
END

Then in the first EVENT:PreAlertKey embed for the ?List control in the
ThisWindow.TakeFieldEvent:
CYCLE                !Let all right-clicks acts as normal

The main thrust of all this code is alerting the right-click, then checking
to see if the Queue has any records, er... entries .



Printed May 3, 2024, 5:16 pm
This article has been viewed/printed 35110 times.