[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ncurses-bug
Subject:    Re: [CKD][cdk_matrix] Enhancement+(de)bug
From:       Vincenzo Romano <vincenzo.romano () notorand ! it>
Date:       2009-02-09 11:50:54
Message-ID: 3eff28920902090350h3c18540bs2fbb61f225b38885 () mail ! gmail ! com
[Download RAW message or body]

2009/1/29 Vincenzo Romano <vincenzo.romano@notorand.it>:
> On Thursday 06 November 2008 17:15:10 Vincenzo Romano wrote:
>> Il Thursday 06 November 2008 02:51:22 Thomas Dickey ha scritto:
>> > On Wed, Nov 05, 2008 at 07:13:16PM +0100, Vincenzo Romano wrote:
>> > > Il Tuesday 04 November 2008 02:28:19 Thomas Dickey ha scritto:
>> > > > On Tue, Oct 28, 2008 at 07:37:40PM +0100, Vincenzo Romano wrote:
>> > > > > Hi.
>> > > > >
>> > > > > If I have empty title, rowtitles and coltitles, when I ask to
>> > > > > position the CDKMATRIX at TOP,LEFT of a CDKSCREEN, I actually get
>> > > > > two empty lines on top and 3 empty character columnts on left. is
>> > > > > this correct?
>> > > > > How can I position the matrix at [0,0]?
>> > > >
>> > > > I just tried it, and get the same result - looks like a bug...
>> > > >
>> > > > (I was working recently on other fixes, but stopped to finish the
>> > > > ncurses release - will see...)
>> > >
>> > > I'm trying to give a look to the code but it's not easy.
>> > > If you provide me with some hints I can try to fix it.
>> >
>> > I made some changes, which seem to work as requested.
>> >
>> > ...I'm still working on other issues, but my current version seems stable
>> > enough that I can put it out for use.  That's
>> >
>> >     ftp://invisible-island.net/cdk/cdk-5.0-20081105.tgz
>>
>> Hello Thomas.
>> It seems the change you made is working very well now.
>>
>> I've made another tiny change to matrix.c (see attached diff) in order to
>> allow NULL as either coltitles or rowtitles (or both) so we don't need to
>> create arrays of NULL pointers (and to dump the core if you try otherwise)
>> to skip the titles.
>> Maybe you can consider it for the next release.
>>
>> Is there any reason why data arrays (rowtitles, coltitles, columnWidths and
>> columnTypes all start from index 1 and not from 0?
>> This (undocumented) thing has caused major problems until I carefully read
>> the examples.
>>
>> Thanks a lot!
>
> Hello.
>
> I've hunted a bug out of matrix.c as seen in cdk-5.0-20081105.
> The column titles was not redrawn correctly during horizontal scrolling
> because of a missing werase() call.
> Once corrected the scrolling has worked fine.
> I'm submitting here the DIFF file which also contains a small enhancement I
> already suggested some time ago. You can define empty column or row titles by
> simply pass a NULL pointer in the newCDKMatrix() call (at the proper argument
> place) as well as an array of empty strings.
>
> Best regards.
>
> --
> Vincenzo Romano
> NotOrAnd.IT
> Information Technologies
> cel. +39 339 8083886
> tel. +39 0823 454163
> fax. +39 02 700506964
> msn. notorand.it
> skp. notorand.it
> gtk. vincenzo.romano@notorand.it
> <Non quietis maribus nauta peritus>
>


Hi.

I just realized that I missed the diff file!

-- 
Vincenzo Romano
NotOrAnd.IT
Information Technologies
cel. +39 339 8083886
tel. +39 0823 454163
fax. +39 02 700506964
<Non quietis maribus nauta peritus>

["matrix.c.diff" (text/x-patch)]

--- matrix.c.orig	2009-02-09 12:36:20.744245658 +0100
+++ matrix.c	2009-02-09 12:48:38.091936991 +0100
@@ -154,9 +154,9 @@
    /* Determine the maximum row title width */
    for (x = 1; x <= rows; x++)
    {
-      if (!emptyString(rowtitles[x]))
+      if (rowtitles && !emptyString(rowtitles[x]))/*VR*/
 	 have_rowtitles = TRUE;
-      matrix->rowtitle[x] = char2Chtype (rowtitles[x],
+      matrix->rowtitle[x] = char2Chtype (rowtitles?rowtitles[x]:0,/*VR*/
 					 &matrix->rowtitleLen[x],
 					 &matrix->rowtitlePos[x]);
       maxRowTitleWidth = MAXIMUM (maxRowTitleWidth, matrix->rowtitleLen[x]);
@@ -217,9 +217,9 @@
    /* Copy the titles into the structure. */
    for (x = 1; x <= cols; x++)
    {
-      if (!emptyString(coltitles[x]))
+      if (coltitles && !emptyString(coltitles[x]))/*VR*/
 	 have_coltitles = TRUE;
-      matrix->coltitle[x] = char2Chtype (coltitles[x],
+      matrix->coltitle[x] = char2Chtype (coltitles?coltitles[x]:0,/*VR*/
 					 &matrix->coltitleLen[x],
 					 &matrix->coltitlePos[x]);
       matrix->coltitlePos[x] = (BorderOf (matrix) +
@@ -1237,6 +1237,7 @@
    for (x = 1; x <= matrix->vcols; x++)
    {
       if (MATRIX_CELL (matrix, 0, x)) {
+	 werase (MATRIX_CELL (matrix, 0, x));/*VR*/
 	 writeChtype (MATRIX_CELL (matrix, 0, x),
 		      matrix->coltitlePos[matrix->lcol + x - 1], 0,
 		      matrix->coltitle[matrix->lcol + x - 1],


_______________________________________________
Bug-ncurses mailing list
Bug-ncurses@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-ncurses


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic