Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
fixed table-columns are resized
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
m.meier  
View profile  
 More options Jun 16 2011, 3:23 am
From: "m.meier" <me...@fuh-e.de>
Date: Thu, 16 Jun 2011 00:23:30 -0700 (PDT)
Local: Thurs, Jun 16 2011 3:23 am
Subject: fixed table-columns are resized
Hello,

if i have a html-table like
----------------------------------------------
<TABLE  width=100% >
<TR bgcolor=grey>
<TD width=120px>Column1 120px</TD>
<TD width=120px>Column2 120px</TD>
<TD width=120px>Column3 120px</TD>
<TD>Column4</TD>
</TR>
</TABLE>
----------------------------------------------

all the columns (and not only the last) are resized if the widget ist
smaller then it should be.

To fix this i patched htmltable.c:

...
    /* Allocate pixels to explicit width columns */
#if 20110615
        for (ii = 0; ii < pData->nCol; ii++) {
            if (aReqWidth[ii].eType == CELL_WIDTH_PIXELS) {
                int iReq = MAX(0, aReqWidth[ii].x.iVal - aWidth[ii]);
                aWidth[ii] += iReq;
                iRemaining -= iReq;
            }
        }
#else
    if (iRemaining > 0) {
        for (ii = 0; ii < pData->nCol; ii++) {
            if (aReqWidth[ii].eType == CELL_WIDTH_PIXELS) {
                int iReq = MAX(0, aReqWidth[ii].x.iVal - aWidth[ii]);
                aWidth[ii] += iReq;
                iRemaining -= iReq;
            }
        }
    }
#endif
...
    assert(CELL_WIDTH_AUTO == 0);
    assert(CELL_WIDTH_PIXELS == 1);
    assert(CELL_WIDTH_PERCENT == 2);
    for (jj = 0; iRemaining < 0 && jj < 3; jj++) {
#if 20110615
            /*
------------------------------------------------------------ *
             * Only reduce columns with CELL_WIDTH_AUTO or
CELL_WIDTH_PERCENT
             *
------------------------------------------------------------ */
            if (jj != CELL_WIDTH_AUTO || jj != CELL_WIDTH_PERCENT )
            {
                    continue;
            };
#endif
....

Here some tcl-Code to test:

--------------------------------------------------------------------------- ----
package require Tkhtml

html .h
grid .h -sticky nesw

grid columnconfigure . 0 -weight 1
grid rowconfigure . 0 -weight 1

set data "
<HTML>
<BODY >
<TABLE  width=100% >
<TR bgcolor=grey>
<TD width=120px>Column1 120px</TD>
<TD width=120px>Column2 120px</TD>
<TD width=120px>Column3 120px</TD>
<TD            >Column4</TD>
</TR>
</TABLE>
</BODY></HTML>
"

.h parse -final $data
--------------------------------------------------------------------------- ----

And then resize the html-widget.

Shall i commit this fix to htmltable.c? Where? How?

Matthias


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jemptymethod  
View profile  
 More options Jun 17 2011, 4:53 am
From: jemptymethod <jemptymet...@gmail.com>
Date: Fri, 17 Jun 2011 01:53:48 -0700 (PDT)
Local: Fri, Jun 17 2011 4:53 am
Subject: Re: fixed table-columns are resized
On Jun 16, 3:23 am, "m.meier" <me...@fuh-e.de> wrote:

I'll look into the mechanics of committing the fix, starting this
weekend.  Timing is good for me, I have made some significant initial
strides as to creating an ereader based on Hv3

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »