''$INCLUDE:'colorall.bi'
CONST AliceBlue
= &HFFF0F8FF~&
' _RGB32(240,248,255) CONST Almond
= &HFFEFDECD~&
'_RGB32(239,222,205) CONST AntiqueBrass
= &HFFCD9575~&
'_RGB32(205,149,117) CONST AntiqueWhite
= &HFFFAEBD7~&
' _RGB32(250,235,215) CONST Apricot
= &HFFFDD9B5~&
'_RGB32(253,217,181) CONST Aqua
= &HFF00FFFF~&
' _RGB32(0,255,255) CONST Aquamarine
= &HFF7FFFD4~&
' _RGB32(127,255,212) CONST Asparagus
= &HFF87A96B~&
'_RGB32(135,169,107) CONST AtomicTangerine
= &HFFFFA474~&
'_RGB32(255,164,116) CONST Azure
= &HFFF0FFFF~&
' _RGB32(240,255,255) CONST BananaMania
= &HFFFAE7B5~&
'_RGB32(250,231,181) CONST Beaver
= &HFF9F8170~&
'_RGB32(159,129,112) CONST Beige
= &HFFF5F5DC~&
' _RGB32(245,245,220) CONST Bisque
= &HFFFFE4C4~&
' _RGB32(255,228,196) CONST Bittersweet
= &HFFFD7C6E~&
'_RGB32(253,124,110) CONST Black
= &HFF000000~&
' _RGB32(0,0,0) CONST BlanchedAlmond
= &HFFFFEBCD~&
' _RGB32(255,235,205) CONST BlizzardBlue
= &HFFACE5EE~&
'_RGB32(172,229,238) CONST Blue
= &HFF0000FF~&
' _RGB32(0,0,255) CONST BlueBell
= &HFFA2A2D0~&
'_RGB32(162,162,208) CONST BlueGray
= &HFF6699CC~&
'_RGB32(102,153,204) CONST BlueGreen
= &HFF0D98BA~&
'_RGB32(13,152,186) CONST BlueViolet
= &HFF8A2BE2~&
' _RGB32(138,43,226) CONST Blush
= &HFFDE5D83~&
'_RGB32(222,93,131) CONST BrickRed
= &HFFCB4154~&
'_RGB32(203,65,84) CONST Brown
= &HFFA52A2A~&
' _RGB32(165,42,42) CONST BurlyWood
= &HFFDEB887~&
' _RGB32(222,184,135) CONST BurntOrange
= &HFFFF7F49~&
'_RGB32(255,127,73) CONST BurntSienna
= &HFFEA7E5D~&
'_RGB32(234,126,93) CONST CadetBlue
= &HFF5F9EA0~&
' _RGB32(95,158,160) CONST Canary
= &HFFFFFF99~&
'_RGB32(255,255,153) CONST CaribbeanGreen
= &HFF1CD3A2~&
'_RGB32(28,211,162) CONST CarnationPink
= &HFFFFAACC~&
'_RGB32(255,170,204) CONST Cerise
= &HFFDD4492~&
'_RGB32(221,68,146) CONST Cerulean
= &HFF1DACD6~&
'_RGB32(29,172,214) CONST ChartReuse
= &HFF7FFF00~&
' _RGB32(127,255,0) CONST Chestnut
= &HFFBC5D58~&
'_RGB32(188,93,88) CONST Chocolate
= &HFFD2691E~&
' _RGB32(210,105,30) CONST Copper
= &HFFDD9475~&
'_RGB32(221,148,117) CONST Coral
= &HFFFF7F50~&
' _RGB32(255,127,80) CONST Cornflower
= &HFF9ACEEB~&
'_RGB32(154,206,235) CONST CornflowerBlue
= &HFF6495ED~&
' _RGB32(100,149,237) CONST Cornsilk
= &HFFFFF8DC~&
' _RGB32(255,248,220) CONST CottonCandy
= &HFFFFBCD9~&
'_RGB32(255,188,217) CONST CrayolaAquamarine
= &HFF78DBE2~&
'_RGB32(120,219,226) CONST CrayolaBlue
= &HFF1F75FE~&
'_RGB32(31,117,254) CONST CrayolaBlueViolet
= &HFF7366BD~&
'_RGB32(115,102,189) CONST CrayolaBrown
= &HFFB4674D~&
'_RGB32(180,103,77) CONST CrayolaCadetBlue
= &HFFB0B7C6~&
'_RGB32(176,183,198) CONST CrayolaForestGreen
= &HFF6DAE81~&
'_RGB32(109,174,129) CONST CrayolaGold
= &HFFE7C697~&
'_RGB32(231,198,151) CONST CrayolaGoldenrod
= &HFFFCD975~&
'_RGB32(252,217,117) CONST CrayolaGray
= &HFF95918C~&
'_RGB32(149,145,140) CONST CrayolaGreen
= &HFF1CAC78~&
'_RGB32(28,172,120) CONST CrayolaGreenYellow
= &HFFF0E891~&
'_RGB32(240,232,145) CONST CrayolaIndigo
= &HFF5D76CB~&
'_RGB32(93,118,203) CONST CrayolaLavender
= &HFFFCB4D5~&
'_RGB32(252,180,213) CONST CrayolaMagenta
= &HFFF664AF~&
'_RGB32(246,100,175) CONST CrayolaMaroon
= &HFFC8385A~&
'_RGB32(200,56,90) CONST CrayolaMidnightBlue
= &HFF1A4876~&
'_RGB32(26,72,118) CONST CrayolaOrange
= &HFFFF7538~&
'_RGB32(255,117,56) CONST CrayolaOrangeRed
= &HFFFF2B2B~&
'_RGB32(255,43,43) CONST CrayolaOrchid
= &HFFE6A8D7~&
'_RGB32(230,168,215) CONST CrayolaPlum
= &HFF8E4585~&
'_RGB32(142,69,133) CONST CrayolaRed
= &HFFEE204D~&
'_RGB32(238,32,77) CONST CrayolaSalmon
= &HFFFF9BAA~&
'_RGB32(255,155,170) CONST CrayolaSeaGreen
= &HFF9FE2BF~&
'_RGB32(159,226,191) CONST CrayolaSilver
= &HFFCDC5C2~&
'_RGB32(205,197,194) CONST CrayolaSkyBlue
= &HFF80DAEB~&
'_RGB32(128,218,235) CONST CrayolaSpringGreen
= &HFFECEABE~&
'_RGB32(236,234,190) CONST CrayolaTann
= &HFFFAA76C~&
'_RGB32(250,167,108) CONST CrayolaThistle
= &HFFEBC7DF~&
'_RGB32(235,199,223) CONST CrayolaViolet
= &HFF926EAE~&
'_RGB32(146,110,174) CONST CrayolaYellow
= &HFFFCE883~&
'_RGB32(252,232,131) CONST CrayolaYellowGreen
= &HFFC5E384~&
'_RGB32(197,227,132) CONST Crimson
= &HFFDC143C~&
' _RGB32(220,20,60) CONST Cyan
= &HFF00FFFF~&
' _RGB32(0,255,255) CONST Dandelion
= &HFFFDDB6D~&
'_RGB32(253,219,109) CONST DarkBlue
= &HFF00008B~&
' _RGB32(0,0,139) CONST DarkCyan
= &HFF008B8B~&
' _RGB32(0,139,139) CONST DarkGoldenRod
= &HFFB8860B~&
' _RGB32(184,134,11) CONST DarkGray
= &HFFA9A9A9~&
' _RGB32(169,169,169) CONST DarkGreen
= &HFF006400~&
' _RGB32(0,100,0) CONST DarkKhaki
= &HFFBDB76B~&
' _RGB32(189,183,107) CONST DarkMagenta
= &HFF8B008B~&
' _RGB32(139,0,139) CONST DarkOliveGreen
= &HFF556B2F~&
' _RGB32(85,107,47) CONST DarkOrange
= &HFFFF8C00~&
' _RGB32(255,140,0) CONST DarkOrchid
= &HFF9932CC~&
' _RGB32(153,50,204) CONST DarkRed
= &HFF8B0000~&
' _RGB32(139,0,0) CONST DarkSalmon
= &HFFE9967A~&
' _RGB32(233,150,122) CONST DarkSeaGreen
= &HFF8FBC8F~&
' _RGB32(143,188,143) CONST DarkSlateBlue
= &HFF483D8B~&
' _RGB32(72,61,139) CONST DarkSlateGray
= &HFF2F4F4F~&
' _RGB32(47,79,79) CONST DarkTurquoise
= &HFF00CED1~&
' _RGB32(0,206,209) CONST DarkViolet
= &HFF9400D3~&
' _RGB32(148,0,211) CONST DeepPink
= &HFFFF1493~&
' _RGB32(255,20,147) CONST DeepSkyBlue
= &HFF00BFFF~&
' _RGB32(0,191,255) CONST Denim
= &HFF2B6CC4~&
'_RGB32(43,108,196) CONST DesertSand
= &HFFEFCDB8~&
'_RGB32(239,205,184) CONST DimGray
= &HFF696969~&
' _RGB32(105,105,105) CONST DodgerBlue
= &HFF1E90FF~&
' _RGB32(30,144,255) CONST Eggplant
= &HFF6E5160~&
'_RGB32(110,81,96) CONST ElectricLime
= &HFFCEFF1D~&
'_RGB32(206,255,29) CONST Fern
= &HFF71BC78~&
'_RGB32(113,188,120) CONST FireBrick
= &HFFB22222~&
' _RGB32(178,34,34) CONST Floralwhite
= &HFFFFFAF0~&
' _RGB32(255,250,240) CONST ForestGreen
= &HFF228B22~&
' _RGB32(34,139,34) CONST Fuchsia
= &HFFC364C5~&
'_RGB32(195,100,197) CONST FuzzyWuzzy
= &HFFCC6666~&
'_RGB32(204,102,102) CONST Gainsboro
= &HFFDCDCDC~&
' _RGB32(220,220,220) CONST GhostWhite
= &HFFF8F8FF~&
' _RGB32(248,248,255) CONST Gold
= &HFFFFD700~&
' _RGB32(255,215,0) CONST GoldenRod
= &HFFDAA520~&
' _RGB32(218,165,32) CONST GrannySmithApple
= &HFFA8E4A0~&
'_RGB32(168,228,160) CONST Gray
= &HFF808080~&
' _RGB32(128,128,128) CONST Green
= &HFF008000~&
' _RGB32(0,128,0) CONST GreenBlue
= &HFF1164B4~&
'_RGB32(17,100,180) CONST GreenYellow
= &HFFADFF2F~&
' _RGB32(173,255,47) CONST HoneyDew
= &HFFF0FFF0~&
' _RGB32(240,255,240) CONST HotMagenta
= &HFFFF1DCE~&
'_RGB32(255,29,206) CONST HotPink
= &HFFFF69B4~&
' _RGB32(255,105,180) CONST Inchworm
= &HFFB2EC5D~&
'_RGB32(178,236,93) CONST IndianRed
= &HFFCD5C5C~&
' _RGB32(205,92,92) CONST Indigo
= &HFF4B0082~&
' _RGB32(75,0,130) CONST Ivory
= &HFFFFFFF0~&
' _RGB32(255,255,240) CONST JazzberryJam
= &HFFCA3767~&
'_RGB32(202,55,103) CONST JungleGreen
= &HFF3BB08F~&
'_RGB32(59,176,143) CONST Khaki
= &HFFF0E68C~&
' _RGB32(240,230,140) CONST LaserLemon
= &HFFFEFE22~&
'_RGB32(254,254,34) CONST Lavender
= &HFFE6E6FA~&
' _RGB32(230,230,250) CONST LavenderBlush
= &HFFFFF0F5~&
' _RGB32(255,240,245) CONST LawnGreen
= &HFF7CFC00~&
' _RGB32(124,252,0) CONST LemonChiffon
= &HFFFFFACD~&
' _RGB32(255,250,205) CONST LemonYellow
= &HFFFFF44F~&
'_RGB32(255,244,79) CONST LightBlue
= &HFFADD8E6~&
' _RGB32(173,216,230) CONST LightCoral
= &HFFF08080~&
' _RGB32(240,128,128) CONST LightCyan
= &HFFE0FFFF~&
' _RGB32(224,255,255) CONST LightGoldenRodYellow
= &HFFFAFAD2~&
' _RGB32(250,250,210) CONST LightGray
= &HFFD3D3D3~&
' _RGB32(211,211,211) CONST LightGreen
= &HFF90EE90~&
' _RGB32(144,238,144) CONST LightPink
= &HFFFFB6C1~&
' _RGB32(255,182,193) CONST LightSalmon
= &HFFFFA07A~&
' _RGB32(255,160,122) CONST LightSeaGreen
= &HFF20B2AA~&
' _RGB32(32,178,170) CONST LightSkyBlue
= &HFF87CEFA~&
' _RGB32(135,206,250) CONST LightSlateGray
= &HFF778899~&
' _RGB32(119,136,153) CONST LightSteelBlue
= &HFFB0C4DE~&
' _RGB32(176,196,222) CONST LightYellow
= &HFFFFFFE0~&
' _RGB32(255,255,224) CONST Lime
= &HFF00FF00~&
' _RGB32(0,255,0) CONST LimeGreen
= &HFF32CD32~&
' _RGB32(50,205,50) CONST Linen
= &HFFFAF0E6~&
' _RGB32(250,240,230) CONST MacaroniAndCheese
= &HFFFFBD88~&
'_RGB32(255,189,136) CONST Magenta
= &HFFFF00FF~&
' _RGB32(255,0,255) CONST MagicMint
= &HFFAAF0D1~&
'_RGB32(170,240,209) CONST Mahogany
= &HFFCD4A4C~&
'_RGB32(205,74,76) CONST Maize
= &HFFEDD19C~&
'_RGB32(237,209,156) CONST Manatee
= &HFF979AAA~&
'_RGB32(151,154,170) CONST MangoTango
= &HFFFF8243~&
'_RGB32(255,130,67) CONST Maroon
= &HFF800000~&
' _RGB32(128,0,0) CONST Mauvelous
= &HFFEF98AA~&
'_RGB32(239,152,170) CONST MediumAquamarine
= &HFF66CDAA~&
' _RGB32(102,205,170) CONST MediumBlue
= &HFF0000CD~&
' _RGB32(0,0,205) CONST MediumOrchid
= &HFFBA55D3~&
' _RGB32(186,85,211) CONST MediumPurple
= &HFF9370DB~&
' _RGB32(147,112,219) CONST MediumSeaGreen
= &HFF3CB371~&
' _RGB32(60,179,113) CONST MediumSlateBlue
= &HFF7B68EE~&
' _RGB32(123,104,238) CONST MediumSpringGreen
= &HFF00FA9A~&
' _RGB32(0,250,154) CONST MediumTurquoise
= &HFF48D1CC~&
' _RGB32(72,209,204) CONST MediumVioletRed
= &HFFC71585~&
' _RGB32(199,21,133) CONST Melon
= &HFFFDBCB4~&
'_RGB32(253,188,180) CONST MidnightBlue
= &HFF191970~&
' _RGB32(25,25,112) CONST MintCream
= &HFFF5FFFA~&
' _RGB32(245,255,250) CONST MistyRose
= &HFFFFE4E1~&
' _RGB32(255,228,225) CONST Moccasin
= &HFFFFE4B5~&
' _RGB32(255,228,181) CONST MountainMeadow
= &HFF30BA8F~&
'_RGB32(48,186,143) CONST Mulberry
= &HFFC54B8C~&
'_RGB32(197,75,140) CONST NavajoWhite
= &HFFFFDEAD~&
' _RGB32(255,222,173) CONST Navy
= &HFF000080~&
' _RGB32(0,0,128) CONST NavyBlue
= &HFF1974D2~&
'_RGB32(25,116,210) CONST NeonCarrot
= &HFFFFA343~&
'_RGB32(255,163,67) CONST OldLace
= &HFFFDF5E6~&
' _RGB32(253,245,230) CONST Olive
= &HFF808000~&
' _RGB32(128,128,0) CONST OliveDrab
= &HFF6B8E23~&
' _RGB32(107,142,35) CONST OliveGreen
= &HFFBAB86C~&
'_RGB32(186,184,108) CONST Orange
= &HFFFFA500~&
' _RGB32(255,165,0) CONST OrangeRed
= &HFFFF4500~&
' _RGB32(255,69,0) CONST OrangeYellow
= &HFFF8D568~&
'_RGB32(248,213,104) CONST Orchid
= &HFFDA70D6~&
' _RGB32(218,112,214) CONST OuterSpace
= &HFF414A4C~&
'_RGB32(65,74,76) CONST OutrageousOrange
= &HFFFF6E4A~&
'_RGB32(255,110,74) CONST PacificBlue
= &HFF1CA9C9~&
'_RGB32(28,169,201) CONST PaleGoldenRod
= &HFFEEE8AA~&
' _RGB32(238,232,170) CONST PaleGreen
= &HFF98FB98~&
' _RGB32(152,251,152) CONST PaleTurquoise
= &HFFAFEEEE~&
' _RGB32(175,238,238) CONST PaleVioletRed
= &HFFDB7093~&
' _RGB32(219,112,147) CONST PapayaWhip
= &HFFFFEFD5~&
' _RGB32(255,239,213) CONST Peach
= &HFFFFCFAB~&
'_RGB32(255,207,171) CONST PeachPuff
= &HFFFFDAB9~&
' _RGB32(255,218,185) CONST Periwinkle
= &HFFC5D0E6~&
'_RGB32(197,208,230) CONST Peru
= &HFFCD853F~&
' _RGB32(205,133,63) CONST PiggyPink
= &HFFFDDDE6~&
'_RGB32(253,221,230) CONST PineGreen
= &HFF158078~&
'_RGB32(21,128,120) CONST Pink
= &HFFFFC0CB~&
' _RGB32(255,192,203) CONST PinkFlamingo
= &HFFFC74FD~&
'_RGB32(252,116,253) CONST PinkSherbet
= &HFFF78FA7~&
'_RGB32(247,143,167) CONST Plum
= &HFFDDA0DD~&
' _RGB32(221,160,221) CONST PowderBlue
= &HFFB0E0E6~&
' _RGB32(176,224,230) CONST Purple
= &HFF800080~&
' _RGB32(128,0,128) CONST PurpleHeart
= &HFF7442C8~&
'_RGB32(116,66,200) CONST PurpleMountainsMajesty
= &HFF9D81BA~&
'_RGB32(157,129,186) CONST PurplePizzazz
= &HFFFE4EDA~&
'_RGB32(254,78,218) CONST RadicalRed
= &HFFFF496C~&
'_RGB32(255,73,108) CONST RawSienna
= &HFFD68A59~&
'_RGB32(214,138,89) CONST RawUmber
= &HFF714B23~&
'_RGB32(113,75,35) CONST RazzleDazzleRose
= &HFFFF48D0~&
'_RGB32(255,72,208) CONST Razzmatazz
= &HFFE3256B~&
'_RGB32(227,37,107) CONST Red
= &HFFFF0000~&
' _RGB32(255,0,0) CONST RedOrange
= &HFFFF5349~&
'_RGB32(255,83,73) CONST RedViolet
= &HFFC0448F~&
'_RGB32(192,68,143) CONST RobinsEggBlue
= &HFF1FCECB~&
'_RGB32(31,206,203) CONST RosyBrown
= &HFFBC8F8F~&
' _RGB32(188,143,143) CONST RoyalBlue
= &HFF4169E1~&
' _RGB32(65,105,225) CONST RoyalPurple
= &HFF7851A9~&
'_RGB32(120,81,169) CONST SaddleBrown
= &HFF8B4513~&
' _RGB32(139,69,19) CONST Salmon
= &HFFFA8072~&
' _RGB32(250,128,114) CONST SandyBrown
= &HFFF4A460~&
' _RGB32(244,164,96) CONST Scarlet
= &HFFFC2847~&
'_RGB32(252,40,71) CONST ScreaminGreen
= &HFF76FF7A~&
'_RGB32(118,255,122) CONST SeaGreen
= &HFF2E8B57~&
' _RGB32(46,139,87) CONST SeaShell
= &HFFFFF5EE~&
' _RGB32(255,245,238) CONST Sepia
= &HFFA5694F~&
'_RGB32(165,105,79) CONST Shadow
= &HFF8A795D~&
'_RGB32(138,121,93) CONST Shamrock
= &HFF45CEA2~&
'_RGB32(69,206,162) CONST ShockingPink
= &HFFFB7EFD~&
'_RGB32(251,126,253) CONST Sienna
= &HFFA0522D~&
' _RGB32(160,82,45) CONST Silver
= &HFFC0C0C0~&
' _RGB32(192,192,192) CONST SkyBlue
= &HFF87CEEB~&
' _RGB32(135,206,235) CONST SlateBlue
= &HFF6A5ACD~&
' _RGB32(106,90,205) CONST SlateGray
= &HFF708090~&
' _RGB32(112,128,144) CONST Snow
= &HFFFFFAFA~&
' _RGB32(255,250,250) CONST SpringGreen
= &HFF00FF7F~&
' _RGB32(0,255,127) CONST SteelBlue
= &HFF4682B4~&
' _RGB32(70,130,180) CONST Sunglow
= &HFFFFCF48~&
'_RGB32(255,207,72) CONST SunsetOrange
= &HFFFD5E53~&
'_RGB32(253,94,83) CONST Tann
= &HFFD2B48C~&
' _RGB32(210,180,140) CONST Teal
= &HFF008080~&
' _RGB32(0,128,128) CONST TealBlue
= &HFF18A7B5~&
'_RGB32(24,167,181) CONST Thistle
= &HFFD8BFD8~&
' _RGB32(216,191,216) CONST TickleMePink
= &HFFFC89AC~&
'_RGB32(252,137,172) CONST Timberwolf
= &HFFDBD7D2~&
'_RGB32(219,215,210) CONST Tomato
= &HFFFF6347~&
' _RGB32(255,99,71) CONST TropicalRainForest
= &HFF17806D~&
'_RGB32(23,128,109) CONST Tumbleweed
= &HFFDEAA88~&
'_RGB32(222,170,136) CONST Turquoise
= &HFF40E0D0~&
' _RGB32(64,224,208) CONST TurquoiseBlue
= &HFF77DDE7~&
'_RGB32(119,221,231) CONST UnmellowYellow
= &HFFFFFF66~&
'_RGB32(255,255,102) CONST Violet
= &HFFEE82EE~&
' _RGB32(238,130,238) CONST VioletBlue
= &HFF324AB2~&
'_RGB32(50,74,178) CONST VioletRed
= &HFFF75394~&
'_RGB32(247,83,148) CONST VividTangerine
= &HFFFFA089~&
'_RGB32(255,160,137) CONST VividViolet
= &HFF8F509D~&
'_RGB32(143,80,157) CONST Wheat
= &HFFF5DEB3~&
' _RGB32(245,222,179) CONST White
= &HFFFFFFFF~&
' _RGB32(255,255,255) CONST Whitesmoke
= &HFFF5F5F5~&
' _RGB32(245,245,245) CONST WildBlueYonder
= &HFFA2ADD0~&
'_RGB32(162,173,208) CONST WildStrawberry
= &HFFFF43A4~&
'_RGB32(255,67,164) CONST WildWatermelon
= &HFFFC6C85~&
'_RGB32(252,108,133) CONST Wisteria
= &HFFCDA4DE~&
'_RGB32(205,164,222) CONST Yellow
= &HFFFFFF00~&
' _RGB32(255,255,0) CONST YellowGreen
= &HFF9ACD32~&
' _RGB32(154,205,50) CONST YellowOrange
= &HFFFFAE42~&
'_RGB32(255,174,66)
CONST LightMagenta
= 13~%%
CONST BrightWhite
= 15~%%
CONST LightMagenta
= 13~%%
CONST BrightWhite
= 15~%%
''$INCLUDE:'LinkedList.BI
CONST True
= -1, False
= 0 CONST Left
= 1, Right
= 2, Middle
= 3, Center
= 3 CONST None
= 0, Alpha
= 1, Numeric
= 2, NoCase
= 4, Reverse
= 8 CONST LeftClick
= 1, RightClick
= 2, LeftDown
= 4, RightDown
= 8, Hover
= 16
'Before here goes BI file content
'After here goes working program
MainMenu = GetMenuHandle
SetMenuSize MainMenu, 200, 150
SetMenuPosition MainMenu, 100, 100
SetMenuFrame MainMenu, True, Red, Yellow
SetMenuVisible MainMenu, True
SetMenuCaption MainMenu, True, "Name", Black, White, True
SetMenuListProperties MainMenu, Black, 0, Center 'Right 'Left
SetMenuHighLightColor MainMenu, Red
AddMenuItem MainMenu, n$
DATA Steve
,Pete
,Bob
,Joe
,Fred
DATA Sam
,One
,Two
,Three
,Four
DATA Five
,Six
,Seven
,Eight
,Nine
DATA These
,are
,all
,my
,names
SecondMenu = GetMenuHandle
SetMenuSize SecondMenu, 100, 150
SetMenuPosition SecondMenu, 300, 100
SetMenuFrame SecondMenu, True, Red, Yellow
SetMenuVisible SecondMenu, True
SetMenuCaption SecondMenu, True, "Age", Black, White, True
SetMenuListProperties SecondMenu, Black, 0, Left
SetMenuHighLightColor SecondMenu, Red
AddMenuItem SecondMenu, n$
sortmode = 0: linked = -1: menuon = 1
HideMenuScrollBar MainMenu
LinkMenus MainMenu, SecondMenu
DisableItem MainMenu, 5
ScrollDelay = .25
PRINT "Press <S> to show the menu." PRINT "Press <N> for No Sort order." PRINT "Press <A> for Alphabetic Sort order." PRINT "Press <#> for Numeric Sort order." PRINT "Press <C> to toggle case sorting." PRINT "Press <R> to toggle reverse sorting." PRINT "Press <L> to link the menus." PRINT "Press <U> to unlink the menus." PRINT "Press <TAB> to swap between menus." LOCATE 6, 15:
PRINT "MENU ASSOCIATED WITH KEYBOARD: "; menuon
MouseScroll = 0
CASE ASC("L"), ASC("l"): LinkMenus MainMenu
, SecondMenu: linked
= -1 CASE ASC("U"), ASC("u"): UnLinkMenus MainMenu
, SecondMenu: linked
= 0 CASE ASC("N"), ASC("n"): sortmode
= None: changed
= -1: reversed
= 0: kase
= 0 CASE ASC("A"), ASC("a"): sortmode
= Alpha: changed
= -1 CASE ASC("#"), ASC("3"): sortmode
= Numeric: changed
= -1 CASE 9: menuon
= menuon
+ 1:
IF menuon
= 3 THEN menuon
= 1 MenuDisplaySort menuon, sortmode
changed = 0
DisplayMenus
CheckMenus MouseStatus, MenuSelected, OptionSelected
IF MouseStatus
<> 0 AND MenuSelected
<> 0 THEN PRINT "You LEFT CLICKED Option #"; OptionSelected;
" in Menu #"; MenuSelected
PRINT "Which was: "; GetListItem
(MenuSelected
, OptionSelected
) PRINT "Since our lists are linked, we get the following items:"; GetListItem
(1, OptionSelected
), GetListItem
(2, OptionSelected
) PRINT "Since our lists are unlinked, we get the following items:"; GetListItem
(MenuSelected
, OptionSelected
) _DELAY 2 'give it time to pop up PRINT "You RIGHT CLICKED Option #"; OptionSelected;
" in Menu #"; MenuSelected
PRINT "Which was: "; GetListItem
(MenuSelected
, OptionSelected
) PRINT "Since our lists are linked, we get the following items:"; GetListItem
(1, OptionSelected
), GetListItem
(2, OptionSelected
) PRINT "Since our lists are unlinked, we get the following items:"; GetListItem
(MenuSelected
, OptionSelected
) _DELAY 2 'give it time to pop up IF MouseStatus
AND LeftDown
THEN LOCATE 35, 1:
PRINT "LEFT MOUSE DOWN over Option #"; OptionSelected;
" in Menu #"; MenuSelected
IF MouseStatus
AND RightDown
THEN LOCATE 35, 1:
PRINT "RIGHT MOUSE DOWN over Option #"; OptionSelected;
" in Menu #"; MenuSelected
IF MouseStatus
AND Hover
THEN LOCATE 36, 1:
PRINT "HOVERING over Option #"; OptionSelected;
" in Menu #"; MenuSelected;
''$INCLUDE:'LinkedList.BM'
'And here goes the BM routines
SUB LinkMenus
(handle1
, handle2
) IF handle1
= handle2
THEN EXIT SUB 'Why the heck are we linking one list to itself?! IF Menu
(handle1
).Valid
AND Menu
(handle2
).Valid
THEN LinkMax = LinkedTo(0).one 'I'm using the very first entry into my array to store the number of link entries I have
'First check to see if the two menus are already linked
found = 0
IF handle1
= LinkedTo
(i
).one
OR handle1
= LinkedTo
(i
).another
THEN found
= found
+ 1 IF handle2
= LinkedTo
(i
).one
OR handle2
= LinkedTo
(i
).another
THEN found
= found
+ 1 IF handle1
= 0 AND handle2
= 0 AND openspot
= 0 THEN openspot
= i
'we found a spot where a link was freed before; let's use it MenuDisplaySort handle1, None: MenuDisplaySort handle2, None 'unsort the lists to begin with.
Menu(handle1).TopEntry = 1: Menu(handle2).TopEntry = 1 'and then reset them to their topmost position
LinkedTo(openspot).one = handle1
LinkedTo(openspot).another = handle2
LinkMax = LinkMax + 1: LinkedTo(0).one = LinkMax
LinkedTo(LinkMax).one = handle1
LinkedTo(LinkMax).another = handle2
SUB UnLinkMenus
(handle1
, handle2
) IF handle1
= 0 OR handle2
= 0 THEN ERROR 5:
EXIT SUB 'no list should be linked to 0. 0 is nothing... Can't free a link to nothing. IF handle1
= handle2
THEN EXIT SUB 'We can't unlink a list from itself! IF Menu
(handle1
).Valid
AND Menu
(handle2
).Valid
THEN FOR i
= 1 TO LinkedTo
(0).one
IF handle1
= LinkedTo
(i
).one
OR handle1
= LinkedTo
(i
).another
THEN found
= found
+ 1 IF handle2
= LinkedTo
(i
).one
OR handle2
= LinkedTo
(i
).another
THEN found
= found
+ 1 IF found
= 2 THEN LinkedTo
(i
).one
= 0: LinkedTo
(i
).another
= 0 'unlink them!
SUB DisableItem
(handle
, item
) IF Menu
(handle
).Valid
THEN MenuListDisabled
(item
, handle
) = -1 ELSE ERROR 5
SUB EnableItem
(handle
, item
)
SUB ShowMenuScrollBar
(Handle
)
SUB HideMenuScrollBar
(Handle
)
SUB AddMenuItem
(Handle
, Item$
) Menu(Handle).Entries = Menu(Handle).Entries + 1
MenuList(Menu(Handle).Entries, Handle) = Item$
MenuDisplayOrder(Menu(Handle).Entries, Handle) = Menu(Handle).Entries
Menu(Handle).ListColor = ListColor
Menu(Handle).ListBackground = ListBackground
Menu(Handle).ListJustify = ListJustify
Menu(Handle).HighLightColor = HighLightColor
Menu(Handle).Header = Header
Menu(Handle).Caption = Caption
Menu(Handle).CC = CaptionColor
Menu(Handle).CBG = CaptionBackground
Menu(Handle).Frame = HaveFrame
Menu(Handle).BorderColor = FrameColor
Menu(Handle).BackgroundColor = FrameBackGround
SUB SetMenuPosition
(Handle
, Left
, Top
) 'some basic error checking
IF Top
< 0 THEN ERROR 5:
EXIT SUB 'Let's try and keep the menu on the screen, why don't we Menu(Handle).Left = Left
Menu(Handle).Top = Top
ERROR 5 'toss a generic error if the handle is bad 'I can add a custom error pop up routine later with appropiate messages
SUB SetMenuVisible
(Handle
, Visible
)
'some basic error checking
Menu(Handle).Height = Height
ERROR 5 'toss a generic error if the handle is bad 'I can add a custom error pop up routine later with appropiate messages
MenusActive = MenusActive + 1
found = MenusActive
GetMenuHandle& = found
Menu(found).Valid = -1 'and let's make this a valid handle
MenuSelected = 0: OptionSelected = 0
IF startnum
= 0 THEN startnum
= i
ProcessMenu i, startnum, MouseStatus, MenuSelected, OptionSelected
FOR Whichone
= 1 TO MenusActive
IF Menu
(Whichone
).Visible
THEN 'Get the starting limits of where menu/list text can appear
x1
= Menu
(Whichone
).Left: x2
= x1
+ Menu
(Whichone
).
Width y1 = Menu(Whichone).Top: y2 = Menu(Whichone).Top + Menu(Whichone).Height
caption$
= LTRIM$(RTRIM$(Menu
(Whichone
).Caption
)) 'strip unneeded spaces from the caption (WhichOnef any)
'clear the background
LINE (Menu
(Whichone
).Left
, Menu
(Whichone
).Top
)-STEP(Menu
(Whichone
).
Width, Menu
(Whichone
).Height
), Menu
(Whichone
).BackgroundColor
, BF
'draw the frame; adjust text limits
LINE (Menu
(Whichone
).Left
, Menu
(Whichone
).Top
)-STEP(Menu
(Whichone
).
Width, Menu
(Whichone
).Height
), Menu
(Whichone
).BorderColor
, B
x1 = x1 + 1: y1 = y1 + 1
x2 = x2 - 1: y2 = y2 - 1
temp = x2 - x1 + 1
LINE (ex1
, ey1
)-(ex2
, ey2
), Red
, BF
LINE (ex1
, ey1
)-(ex2
, ey2
), Black
LINE (ex1
, ey2
)-(ex2
, ey1
), Black
caption$
= LEFT$(caption$
, LEN(caption$
) - 1) COLOR Menu
(Whichone
).CC
, Menu
(Whichone
).CBG
LINE (x1
, y1
)-(x2
, y1
), Menu
(Whichone
).BorderColor
y1 = y1 + 2
END IF 'end header creation
IF Menu
(Whichone
).Entries
> 0 THEN 'We have items in our list to display! IF Menu
(Whichone
).TopEntry
< 1 THEN Menu
(Whichone
).TopEntry
= 1 'check to make certain we're displaying from the first entry on at least IF Menu
(Whichone
).TopEntry
> Menu
(Whichone
).Entries
THEN Menu
(Whichone
).TopEntry
= Menu
(Whichone
).Entries
IF limitfound
> Menu
(Whichone
).Entries
THEN limitfound = Menu(Whichone).Entries
scrollneeded = -1
printlimit = printlimit - 1
COLOR Menu
(Whichone
).ListColor
, Menu
(Whichone
).ListBackground
IF Menu
(Whichone
).ScrollBarHidden
= -1 THEN scrollneeded
= 0
r
= _RED32(Menu
(Whichone
).BackgroundColor
) g
= _GREEN32(Menu
(Whichone
).BackgroundColor
) b
= _BLUE32(Menu
(Whichone
).BackgroundColor
)
CC = MenuDisplayOrder(Menu(Whichone).TopEntry + j - 1, Whichone) 'currentchoice
graybox = 0
IF MenuListDisabled
(CC
, Whichone
) THEN graybox
= -1 FOR ii
= 1 TO LinkedTo
(0).one
IF Whichone
= LinkedTo
(ii
).one
AND MenuListDisabled
(CC
, LinkedTo
(ii
).another
) THEN graybox
= -1 IF Whichone
= LinkedTo
(ii
).another
AND MenuListDisabled
(CC
, LinkedTo
(ii
).one
) THEN graybox
= -1 t$
= LEFT$(t$
, printlimit
) CC = MenuDisplayOrder(Menu(Whichone).TopEntry + j - 1, Whichone) 'currentchoice
graybox = 0
t$
= RTRIM$(LTRIM$(MenuList
(MenuDisplayOrder
(Menu
(Whichone
).TopEntry
+ j
- 1, Whichone
), Whichone
))) IF MenuListDisabled
(CC
, Whichone
) THEN graybox
= -1 FOR ii
= 1 TO LinkedTo
(0).one
IF Whichone
= LinkedTo
(ii
).one
AND MenuListDisabled
(CC
, LinkedTo
(ii
).another
) THEN graybox
= -1 IF Whichone
= LinkedTo
(ii
).another
AND MenuListDisabled
(CC
, LinkedTo
(ii
).one
) THEN graybox
= -1
CC = MenuDisplayOrder(Menu(Whichone).TopEntry + j - 1, Whichone) 'currentchoice
graybox = 0
t$
= LTRIM$(MenuList
(MenuDisplayOrder
(Menu
(Whichone
).TopEntry
+ j
- 1, Whichone
), Whichone
)) IF MenuListDisabled
(CC
, Whichone
) THEN graybox
= -1 FOR ii
= 1 TO LinkedTo
(0).one
IF Whichone
= LinkedTo
(ii
).one
AND MenuListDisabled
(CC
, LinkedTo
(ii
).another
) THEN graybox
= -1 IF Whichone
= LinkedTo
(ii
).another
AND MenuListDisabled
(CC
, LinkedTo
(ii
).one
) THEN graybox
= -1 CC = MenuDisplayOrder(Menu(Whichone).TopEntry + j - 1, Whichone) 'currentchoice
graybox = 0
IF MenuListDisabled
(CC
, Whichone
) THEN graybox
= -1 FOR ii
= 1 TO LinkedTo
(0).one
IF Whichone
= LinkedTo
(ii
).one
AND MenuListDisabled
(CC
, LinkedTo
(ii
).another
) THEN graybox
= -1 IF Whichone
= LinkedTo
(ii
).another
AND MenuListDisabled
(CC
, LinkedTo
(ii
).one
) THEN graybox
= -1 t$
= LEFT$(t$
, printlimit
) Menu(Whichone).ListJustify = Left 'If it's not specified for some reason, let's make it left justified as default
END IF 'end of displaying items IF scrollneeded
THEN 'then we need a vertical scroll bar LINE (barx1
, y1
)-(barx2
, y2
), LightGray
, BF
IF ScrollDelay
< 0 THEN ScrollDelay
= 0
'Get the starting limits of where menu/list text can appear
x1
= Menu
(WhichOne
).Left: x2
= x1
+ Menu
(WhichOne
).
Width y1 = Menu(WhichOne).Top: y2 = Menu(WhichOne).Top + Menu(WhichOne).Height
OldMouse = MB: OldMouse2 = MB2
ElapsedTimer
= TIMER(0.01) ScrollAble = -1
ScrollAble = 0
LINE (Menu
(WhichOne
).Left
, Menu
(WhichOne
).Top
)-STEP(Menu
(WhichOne
).
Width, Menu
(WhichOne
).Height
), Menu
(WhichOne
).BorderColor
, B
x1 = x1 + 1: y1 = y1 + 1
x2 = x2 - 1: y2 = y2 - 1
temp = x2 - x1 + 1
IF Menu
(WhichOne
).Frame
THEN y1
= y1
+ 2 END IF 'end header creation
IF Menu
(WhichOne
).Entries
> 0 THEN 'We have items in our list to display! IF Menu
(WhichOne
).TopEntry
< 1 THEN Menu
(WhichOne
).TopEntry
= 1 'check to make certain we're displaying from the first entry on at least IF Menu
(WhichOne
).TopEntry
> Menu
(WhichOne
).Entries
THEN Menu
(WhichOne
).TopEntry
= Menu
(WhichOne
).Entries
IF limitfound
> Menu
(WhichOne
).Entries
THEN limitfound = Menu(WhichOne).Entries
scrollneeded = -1
printlimit = printlimit - 1
END IF 'end of displaying items
IF Menu
(WhichOne
).ScrollBarHidden
= -1 THEN scrollneeded
= 0
IF scrollneeded
THEN 'then we need a vertical scroll bar
SELECT CASE MY
'let's determine which line we clicked the mouse on CASE IS < ey1
'do nothing as it's too far up the screen to be a click in this box CASE IS > y2
'do nothing again as it's too far down the screen to be a click in this box CASE ey1
TO ey2
'we've clicked on the line where the EXIT button might exist
SELECT CASE MY
'let's determine which line we clicked the mouse on CASE IS < ey1
'do nothing as it's too far up the screen to be a click in this box CASE IS > y2
'do nothing again as it's too far down the screen to be a click in this box CASE ey1
TO ey2
'we've clicked on the line where the EXIT button might exist IF MX
>= ex1
AND MX
<= ex2
THEN Menu
(WhichOne
).Visible
= False
'If the exit button is available, and we click it, it closes the menu/list done = 0
IF MX
>= x1
AND MX
<= p2
THEN 'highlight the choice the user is over
Menu(WhichOne).TopEntry = Menu(WhichOne).TopEntry + MouseScroll
IF Menu
(WhichOne
).TopEntry
< 1 THEN Menu
(WhichOne
).TopEntry
= 1 IF Menu
(WhichOne
).TopEntry
> Menu
(WhichOne
).Entries
- limitfound
+ 1 THEN Menu
(WhichOne
).TopEntry
= Menu
(WhichOne
).Entries
- limitfound
+ 1 FOR i
= 1 TO LinkedTo
(0).one
IF WhichOne
= LinkedTo
(i
).one
THEN Menu
(LinkedTo
(i
).another
).TopEntry
= Menu
(WhichOne
).TopEntry
IF WhichOne
= LinkedTo
(i
).another
THEN Menu
(LinkedTo
(i
).one
).TopEntry
= Menu
(WhichOne
).TopEntry
IF ScrollAble
THEN Menu
(WhichOne
).TopEntry
= Menu
(WhichOne
).TopEntry
- 1 IF Menu
(WhichOne
).TopEntry
< 1 THEN Menu
(WhichOne
).TopEntry
= 1 done = -1
FOR i
= 1 TO LinkedTo
(0).one
IF WhichOne
= LinkedTo
(i
).one
THEN Menu
(LinkedTo
(i
).another
).TopEntry
= Menu
(WhichOne
).TopEntry
IF WhichOne
= LinkedTo
(i
).another
THEN Menu
(LinkedTo
(i
).one
).TopEntry
= Menu
(WhichOne
).TopEntry
IF ScrollAble
THEN Menu
(WhichOne
).TopEntry
= Menu
(WhichOne
).TopEntry
+ 1 IF Menu
(WhichOne
).TopEntry
> Menu
(WhichOne
).Entries
- limitfound
+ 1 THEN Menu
(WhichOne
).TopEntry
= Menu
(WhichOne
).Entries
- limitfound
+ 1 done = -1
FOR i
= 1 TO LinkedTo
(0).one
IF WhichOne
= LinkedTo
(i
).one
THEN Menu
(LinkedTo
(i
).another
).TopEntry
= Menu
(WhichOne
).TopEntry
IF WhichOne
= LinkedTo
(i
).another
THEN Menu
(LinkedTo
(i
).one
).TopEntry
= Menu
(WhichOne
).TopEntry
MenuLimit = Menu(WhichOne).Entries - limitfound + 2
Menu(WhichOne).TopEntry = (MenuLimit - (ylimit - yPOS) / ylimit * MenuLimit)
IF Menu
(WhichOne
).TopEntry
>= MenuLimit
THEN Menu
(WhichOne
).TopEntry
= MenuLimit
- 1 done = -1
FOR i
= 1 TO LinkedTo
(0).one
IF WhichOne
= LinkedTo
(i
).one
THEN Menu
(LinkedTo
(i
).another
).TopEntry
= Menu
(WhichOne
).TopEntry
IF WhichOne
= LinkedTo
(i
).another
THEN Menu
(LinkedTo
(i
).one
).TopEntry
= Menu
(WhichOne
).TopEntry
IF NOT done
THEN 'if we've processed a scrollbar event, we're finished MenuSelected = WhichOne
OptionSelected
= MenuDisplayOrder
((MY
- y1
+ 1) \
_FONTHEIGHT + Menu
(WhichOne
).TopEntry
, WhichOne
) invalidate = 0
IF MenuListDisabled
(OptionSelected
, WhichOne
) THEN invalidate
= -1 FOR ii
= 1 TO LinkedTo
(0).one
IF WhichOne
= LinkedTo
(ii
).one
AND MenuListDisabled
(OptionSelected
, LinkedTo
(ii
).another
) THEN invalidate
= -1 IF WhichOne
= LinkedTo
(ii
).another
AND MenuListDisabled
(OptionSelected
, LinkedTo
(ii
).one
) THEN invalidate
= -1 IF barx1
<> 0 AND MX
> barx1
THEN invalidate
= -1 IF invalidate
THEN MenuSelected
= 0: OptionSelected
= 0
MouseStatus = 0
MouseStatus
= MouseStatus
OR -Click
'leftclick MouseStatus
= MouseStatus
OR Click2
* -2 'rightclick MouseStatus
= MouseStatus
OR (MenuSelected
<> 0) * 16 'If we're over the menu, we're hovering
gap = Menu(handle).Entries
gap = 10 * gap \ 13
i = 0
swapped = 0
SWAP MenuDisplayOrder
(i
, handle
), MenuDisplayOrder
(i
+ gap
, handle
) FOR ii
= 1 TO LinkedTo
(0).one
IF handle
= LinkedTo
(ii
).one
THEN SWAP MenuDisplayOrder
(i
, LinkedTo
(ii
).another
), MenuDisplayOrder
(i
+ gap
, LinkedTo
(ii
).another
) IF handle
= LinkedTo
(ii
).another
THEN SWAP MenuDisplayOrder
(i
, LinkedTo
(ii
).one
), MenuDisplayOrder
(i
+ gap
, LinkedTo
(ii
).one
) swapped = -1
i = i + 1
gap = 10 * gap \ 13
i = 0
swapped = 0
t$
= LTRIM$(RTRIM$(MenuList
(MenuDisplayOrder
(i
, handle
), handle
))) t1$
= LTRIM$(RTRIM$(MenuList
(MenuDisplayOrder
(i
+ gap
, handle
), handle
))) SWAP MenuDisplayOrder
(i
, handle
), MenuDisplayOrder
(i
+ gap
, handle
) FOR ii
= 1 TO LinkedTo
(0).one
IF handle
= LinkedTo
(ii
).one
THEN SWAP MenuDisplayOrder
(i
, LinkedTo
(ii
).another
), MenuDisplayOrder
(i
+ gap
, LinkedTo
(ii
).another
) IF handle
= LinkedTo
(ii
).another
THEN SWAP MenuDisplayOrder
(i
, LinkedTo
(ii
).one
), MenuDisplayOrder
(i
+ gap
, LinkedTo
(ii
).one
) swapped = -1
i = i + 1
FOR i
= 1 TO Menu
(handle
).Entries \
2 SWAP MenuDisplayOrder
(i
, handle
), MenuDisplayOrder
(Menu
(handle
).Entries
- i
+ 1, handle
) FOR ii
= 1 TO LinkedTo
(0).one
IF handle
= LinkedTo
(ii
).one
THEN SWAP MenuDisplayOrder
(i
, LinkedTo
(ii
).another
), MenuDisplayOrder
(Menu
(handle
).Entries
- i
+ 1, LinkedTo
(ii
).another
) IF handle
= LinkedTo
(ii
).another
THEN SWAP MenuDisplayOrder
(i
, LinkedTo
(ii
).one
), MenuDisplayOrder
(Menu
(handle
).Entries
- i
+ 1, LinkedTo
(ii
).one
) gap = 10 * gap \ 13
i = 0
swapped = 0
IF VAL(MenuList
(MenuDisplayOrder
(i
, handle
), handle
)) > VAL(MenuList
(MenuDisplayOrder
(i
+ gap
, handle
), handle
)) THEN SWAP MenuDisplayOrder
(i
, handle
), MenuDisplayOrder
(i
+ gap
, handle
) FOR ii
= 1 TO LinkedTo
(0).one
IF handle
= LinkedTo
(ii
).one
THEN SWAP MenuDisplayOrder
(i
, LinkedTo
(ii
).another
), MenuDisplayOrder
(i
+ gap
, LinkedTo
(ii
).another
) IF handle
= LinkedTo
(ii
).another
THEN SWAP MenuDisplayOrder
(i
, LinkedTo
(ii
).one
), MenuDisplayOrder
(i
+ gap
, LinkedTo
(ii
).one
) swapped = -1
i = i + 1
FOR i
= 1 TO Menu
(handle
).Entries \
2 SWAP MenuDisplayOrder
(i
, handle
), MenuDisplayOrder
(Menu
(handle
).Entries
- i
+ 1, handle
) FOR ii
= 1 TO LinkedTo
(0).one
IF handle
= LinkedTo
(ii
).one
THEN SWAP MenuDisplayOrder
(i
, LinkedTo
(ii
).another
), MenuDisplayOrder
(Menu
(handle
).Entries
- i
+ 1, LinkedTo
(ii
).another
) IF handle
= LinkedTo
(ii
).another
THEN SWAP MenuDisplayOrder
(i
, LinkedTo
(ii
).one
), MenuDisplayOrder
(Menu
(handle
).Entries
- i
+ 1, LinkedTo
(ii
).one
) FOR i
= 1 TO Menu
(handle
).Entries
MenuDisplayOrder(i, handle) = i
FOR ii
= 1 TO LinkedTo
(0).one
IF handle
= LinkedTo
(ii
).one
THEN MenuDisplayOrder
(i
, LinkedTo
(ii
).another
) = i
IF handle
= LinkedTo
(ii
).another
THEN MenuDisplayOrder
(i
, LinkedTo
(ii
).one
) = i