diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b0cb89d2b7..8424f7a7d5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,10 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-03-12 14:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + + harbour/tests/ac_test2.prg + + added achoice() test by Vladislav Lavrecky - many thanks. + 2009-03-12 13:32 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/gttrm/gttrm.c + added some missing xterm key sequences diff --git a/harbour/tests/ac_test2.prg b/harbour/tests/ac_test2.prg new file mode 100644 index 0000000000..d2f80a7cbf --- /dev/null +++ b/harbour/tests/ac_test2.prg @@ -0,0 +1,57 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * ACHOICE() test + * + * Copyright 2009 Vladislav Lavrecky + * www - http://www.harbour-project.org + * + */ + +/* + * Menu Navigation - Right and Left arrows keys, ESC to exit + * After some Right or Left arrows preses + * in Harbour app all menu items are highlighted + * an no way to understand which element is current, + * with clipper app all is ok. + */ +#include "inkey.ch" + +function main() + +local aMenu1 := {"-Visky-"} +local aMenu2 := {"-Vodka-"} +local aMenu3 := {"-Grapa-"} +local lExit := .F. +local nCounter := 1 +local nKeyPressed + +setcolor("W+/N, BG+/B, , , W/N") +cls +@ 2,1 SAY "-Visky- -Vodka- -Grapa-" +do while !lExit + + do case + case nCounter == 1 + achoice(2, 1, 2, 7, aMenu1) + case nCounter == 2 + achoice(2, 9, 2, 15, aMenu2) + case nCounter == 3 + achoice(2, 17, 2, 23, aMenu3) + endcase + + nKeyPressed := lastkey() + if nKeyPressed == K_ESC + lExit := .T. + elseif nKeyPressed == K_RIGHT + nCounter := iif(nCounter == 3, 1, nCounter+1) + elseif nKeyPressed == K_LEFT + nCounter := iif(nCounter == 1, 3, nCounter-1) + endif + +enddo + +return NIL