From cc30b0f57c4d1404e82515130d3dbff5baa71460 Mon Sep 17 00:00:00 2001 From: Omm Date: Mon, 2 Nov 2015 10:22:46 +0200 Subject: [PATCH] 2015-10-29 03:12 UTC+0100 Viktor Szakats (vszakats users.noreply.github.com) --- ChangeLog.txt | 10 +++++++++- src/rtl/achoice.prg | 5 +++-- tests/achoice6.prg | 23 +++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 tests/achoice6.prg diff --git a/ChangeLog.txt b/ChangeLog.txt index 8a4d5832e0..48f4cd7c32 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -8,7 +8,6 @@ See copyright/license at the end of the file. Encoding: UTF-8 (No BOM) Notation (in 5th position): * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment - */ 2015-10-29 11:52 UTC+0100 Viktor Szakats (vszakats users.noreply.github.com) * src/rtl/gtwin/gtwin.c @@ -30,6 +29,15 @@ ! fixed msvc sanitize warnings (2014-07-16 17:37 UTC+0200 Viktor Szakats) +2015-10-29 03:12 UTC+0100 Viktor Szakats (vszakats users.noreply.github.com) + * src/rtl/achoice.prg + + tests/achoice6.prg + ! fix AChoice() RTE/visual glitch when certain non-integer + values are passed as top/bottom values. + Simplified and slightly corrected version of + patch/example authored by Alexey Myronenko: + https://github.com/harbour/core/pull/113 + 2015-10-28 17:10 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/gtkeycod.c ! fixed typo in CTRL+[UP|DOWN] mapping diff --git a/src/rtl/achoice.prg b/src/rtl/achoice.prg index 24582bb3fa..ae6b84f5c2 100644 --- a/src/rtl/achoice.prg +++ b/src/rtl/achoice.prg @@ -44,9 +44,10 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo LOCAL cKey LOCAL nAux - hb_default( @nTop, 0 ) + nTop := Int( hb_defaultValue( nTop, 0 ) ) + nBottom := Int( hb_defaultValue( nBottom, 0 ) ) + hb_default( @nLeft, 0 ) - hb_default( @nBottom, 0 ) hb_default( @nRight, 0 ) IF nRight > MaxCol() diff --git a/tests/achoice6.prg b/tests/achoice6.prg new file mode 100644 index 0000000000..e2936dea0e --- /dev/null +++ b/tests/achoice6.prg @@ -0,0 +1,23 @@ +#include "inkey.ch" + +/* An RTE and visual glitch while playing arrows + up and down and change y1 or y2 to not integer + value and number of items less/equal then/to + number of rows in window. */ + +PROCEDURE Main() + + LOCAL x1 := 24 + LOCAL x2 := 35 + LOCAL y1 := 7.6 + LOCAL y2 := 9.9 + + hb_keyPut( { K_DOWN, K_DOWN } ) // RTE + + CLS + DispBox( y1, x1, y2 + 1, x2 + 1,, "W+/B,N/BG" ) + AChoice( y1 + 1, x1 + 1, y2, x2, ; + { "menu 1", "menu 2", "menu 3" }, ; + { .T., .F., .T. } ) + + RETURN