diff --git a/harbour/source/rtl/achoice.prg b/harbour/source/rtl/achoice.prg index 528cc5161c..55d53b7e07 100644 --- a/harbour/source/rtl/achoice.prg +++ b/harbour/source/rtl/achoice.prg @@ -55,23 +55,23 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo DEFAULT nTop TO 0 // The topmost row of the window DEFAULT nLeft TO 0 // The leftmost column of the window - DEFAULT nBottom TO MaxRow() + 1 // The bottommost row of the window - DEFAULT nRight TO MaxCol() + 1 // The rightmost column of the window + DEFAULT nBottom TO MaxRow() // The bottommost row of the window + DEFAULT nRight TO MaxCol() // The rightmost column of the window DEFAULT acItems TO {} // The items from which to choose DEFAULT xSelect TO .T. // Array or logical, what is selectable DEFAULT nPos TO 1 // The number of the selected item DEFAULT nHiLiteRow TO 0 // The row to be highlighted - IF nRight == 79 .and. nLeft ==0 - nNumCols := 80 - ELSE - nNumCols := nRight - nLeft + 1 + nNumCols := nRight - nLeft + 1 + IF nRight > MaxCol() + nRight := MaxCol() ENDIF - IF nRight > MaxCol() - nRight-- + IF nBottom > MaxRow() + nBorrom := MaxRow() ENDIF + nNumRows := nBottom - nTop + 1 @@ -507,16 +507,9 @@ STATIC PROCEDURE DispPage( acItems, alSelect, nTop, nLeft, nRight, nNumRows, nPo LOCAL nIndex // Array index LOCAL nSaveRow := Row() // Position at start of routine LOCAL nSaveCol := Col() // Position at start of routine - LOCAL nRightPos := 0 Default nRowsClr to nNumRows - IF nRight == 79 .and. nLeft == 0 - nRightPos := 80 - ELSE - nRightPos := nRight - nLeft + 1 - ENDIF - DispBegin() FOR nCntr := 1 TO Min( nNumRows, nRowsClr )