* contrib/hbamf/tests/tstendin.prg
* contrib/hbblat/blatcls.prg
* contrib/hbct/tests/ctwtest.prg
* contrib/hbct/tests/token2.prg
* contrib/hbhttpd/readme.txt
* contrib/hbhttpd/widgets.prg
* contrib/hbmisc/fileread.prg
* contrib/hbmisc/hbedit.prg
* contrib/hbmysql/diff-en.txt
* contrib/hbmysql/diff-es.txt
* contrib/hbmysql/tests/dbf2mysq.prg
* contrib/hbmysql/tmysql.prg
* contrib/hbmysql/tsqlbrw.prg
* contrib/hbnetio/tests/netiot03.prg
* contrib/hbnetio/tests/netiotst.prg
* contrib/hbnf/doc/en/fttext.txt
* contrib/hbodbc/browodbc.prg
* contrib/hbodbc/tests/odbcdemo.prg
* contrib/hbodbc/todbc.prg
* contrib/hbtip/ftpcli.prg
* contrib/hbwin/tests/olesrv1.prg
* contrib/rddads/ads.ch
* contrib/rddsql/readme.txt
* contrib/sddodbc/tests/test2.prg
* contrib/xhb/dbf2txt.c
* contrib/xhb/hbcompat.ch
* contrib/xhb/hblog.prg
* contrib/xhb/html.ch
* contrib/xhb/tfile.prg
* contrib/xhb/tframe.prg
* contrib/xhb/ttable.prg
* ChangeLog
* doc/en/dbdelim.txt
* doc/en/dbsdf.txt
* doc/en/rdddb.txt
* doc/en/terminal.txt
* extras/gtwvw/tests/wvt2wvw.ch
* extras/httpsrv/cookie.prg
* extras/httpsrv/modules/tableservletdb.prg
* extras/rddado/adordd.ch
* extras/rddado/adordd.prg
* include/assert.ch
* include/hbsix.ch
* src/debug/dbgbrwsr.prg
* src/debug/dbgtinp.prg
* src/rdd/*.prg
* src/rtl/*.prg
* tests/*.prg
* tests/rddtest/rddtst.prg
* tests/usrrdd/exarr.prg
* tests/usrrdd/exfcm.prg
* utils/hbtest/hbtest.prg
* more minor
133 lines
3.0 KiB
Plaintext
133 lines
3.0 KiB
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* Harbour Project source code:
|
|
* ACHOICE() test
|
|
*
|
|
* Copyright 2009 Vladislav Lavrecky <lavr / at / ldz.lv>
|
|
* www - http://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"
|
|
#include "achoice.ch"
|
|
|
|
MEMVAR p_lHiLiTest
|
|
|
|
PROCEDURE Main()
|
|
|
|
// NIL, empty, numeric, and "not handled" - items
|
|
// must be inaccesible and invisible
|
|
LOCAL aMenu1 := { " --Visky--", "", "not handled" }
|
|
LOCAL aMenu2 := { " --Vodka--", " --Water--", NIL, "not handled" }
|
|
LOCAL aMenu3 := { " --Grapa--", 33, "not handled" }
|
|
|
|
// for AC_NOITEM mode test
|
|
LOCAL aMenu4 := { "", "not handled" }
|
|
|
|
|
|
LOCAL lExit := .F.
|
|
LOCAL nCounter := 1
|
|
LOCAL nKeyPressed
|
|
|
|
// set to True for items (de)highlighting
|
|
// algoritm in clipper
|
|
PUBLIC p_lHiLiTest := .F.
|
|
|
|
|
|
SetColor( "W+/N, BG+/B, , , W/N" )
|
|
cls
|
|
@ 2, 1 SAY " --Visky-- --Vodka-- --Grapa--"
|
|
@ 3, 14 SAY "--Water--"
|
|
DO WHILE ! lExit
|
|
|
|
DO CASE
|
|
CASE nCounter == 1
|
|
AChoice( 2, 1, 3, 11, aMenu1 )
|
|
CASE nCounter == 2
|
|
AChoice( 2, 13, 3, 23, aMenu2, .T., "cUF" )
|
|
CASE nCounter == 3
|
|
AChoice( 2, 25, 3, 35, aMenu3, .T. )
|
|
CASE nCounter == 4
|
|
// User function cUF2() fill screen with exclamation marks
|
|
// in clipper it does not get called in AC_NOITEM mode
|
|
AChoice( 2, 37, 3, 47, aMenu4, .T., "cUF2" )
|
|
|
|
ENDCASE
|
|
|
|
nKeyPressed := LastKey()
|
|
IF nKeyPressed == K_ESC
|
|
lExit := .T.
|
|
ELSEIF nKeyPressed == K_RIGHT
|
|
nCounter := iif( nCounter == 4, 1, nCounter + 1 )
|
|
ELSEIF nKeyPressed == K_LEFT
|
|
nCounter := iif( nCounter == 1, 4, nCounter - 1 )
|
|
ENDIF
|
|
|
|
ENDDO
|
|
|
|
RETURN
|
|
|
|
// Test for current and previous items
|
|
// highliting-dehighliting algoritm
|
|
|
|
FUNCTION cUF( nMode, nCurElement, nRowPos )
|
|
|
|
LOCAL nRetVal := AC_CONT
|
|
LOCAL nKey := LastKey()
|
|
|
|
HB_SYMBOL_UNUSED( nCurElement )
|
|
HB_SYMBOL_UNUSED( nRowPos )
|
|
|
|
IF p_lHiLiTest
|
|
DispBox( 0, 0, MaxRow(), MaxCol(), Replicate( "#", 9 ), "GR+/G" )
|
|
ENDIF
|
|
|
|
IF nMode == AC_NOITEM
|
|
nRetVal := AC_ABORT
|
|
ELSEIF nMode == AC_EXCEPT
|
|
DO CASE
|
|
CASE nKey == K_ENTER
|
|
nRetVal := AC_SELECT
|
|
OTHERWISE
|
|
nRetVal := AC_ABORT
|
|
ENDCASE
|
|
ENDIF
|
|
|
|
RETURN nRetVal
|
|
|
|
// test for AC_NOITEM mode
|
|
// Clipper in AC_NOITEM mode do not call User Function
|
|
|
|
FUNCTION cUF2( nMode, nCurElement, nRowPos )
|
|
|
|
LOCAL nRetVal := AC_CONT
|
|
LOCAL nKey := LastKey()
|
|
|
|
HB_SYMBOL_UNUSED( nCurElement )
|
|
HB_SYMBOL_UNUSED( nRowPos )
|
|
|
|
DispBox( 0, 0, MaxRow(), MaxCol(), Replicate( "!", 9 ), "GR+/G" )
|
|
|
|
IF nMode == AC_NOITEM
|
|
nRetVal := AC_ABORT
|
|
ELSEIF nMode == AC_EXCEPT
|
|
DO CASE
|
|
CASE nKey == K_ENTER
|
|
nRetVal := AC_SELECT
|
|
OTHERWISE
|
|
nRetVal := AC_ABORT
|
|
ENDCASE
|
|
ENDIF
|
|
|
|
RETURN nRetVal
|