home *** CD-ROM | disk | FTP | other *** search
- //--------------------------------------------------------------------------
- // Object Scripting
- // Copyright (c) 1996, 1997 by Borland International, All Rights Reserved
- //
- // MLIST.SPP: Multi-select List Window. Demonstrates a simple multiple-
- // selection list window. Also shows how to position a popup window in
- // the list.
- //--------------------------------------------------------------------------
- print typeid(module());
-
- Items = {"Smoke", "String and cups", "Pony Express", "Wink", "Flare"};
-
- List = new ListWindow(50, 5, 200, 300, "Multiple Select Lists are cooler",
- TRUE, FALSE, Items);
-
- on List:>Accept()
- {
- declare value;
- iterate (value; .Data) {
- print value;
- }
- pass();
- }
-
- on List:>RightClick(xPos, yPos)
- {
-
- // Create a local menu.
- //
- declare choices = {"one", "two", "three"};
- declare menu = new PopupMenu(xPos, yPos, choices);
-
- switch (menu.Track()) {
- case "one":
- print "Choice one";
- break;
-
- case "two":
- print "Choice two";
- break;
-
- case "three":
- print "Choice three";
- }
- }
-
- on List:>KeyPressed(keyName)
- {
- print("Pressed key: " + keyName);
- }
-
- List.Execute();
-
-