From 940768d485601964954d6a4a4675389c2bd17985 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 17 May 2002 12:41:18 +0000 Subject: [PATCH] adjust width for drop-downs --- ChangeLog | 1 + tbl_qbe.php3 | 30 +++++++++++++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 879d8f5c07..23f4f7474c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ $Source$ 2002-05-17 Marc Delisle * tbl_change.php3, bug 556296: field size for int + * tbl_qbe.php3, adjust drop-down width, thanks to Mike Beck 2002-05-17 Loïc Chapeaux * db_details_structure.php3, lines 446-458; diff --git a/tbl_qbe.php3 b/tbl_qbe.php3 index 1b28603529..3542632fdb 100755 --- a/tbl_qbe.php3 +++ b/tbl_qbe.php3 @@ -87,8 +87,8 @@ if (!isset($AndOrCol)) { $AndOrCol[$i] = ''; } } +// minimum width $wid = 12; -$widem = $wid . 'em'; $col = $Columns + $Add_Col; if ($col < 0) { $col = 0; @@ -133,6 +133,12 @@ while ($i < $tbl_result_cnt) { while ($j < $fld_results_cnt) { $fld[$k] = mysql_field_name($fld_results, $j); $fld[$k] = PMA_backquote($tbl) . '.' . PMA_backquote($fld[$k]); + + // increase the width if necessary + if (strlen($fld[$k]) > $wid) { + $wid = strlen($fld[$k]); + } //end if + $k++; $j++; } // end while @@ -143,6 +149,8 @@ while ($i < $tbl_result_cnt) { } // end if mysql_free_result($tbl_result); +// largest width found +$realwidth = $wid . 'ex'; /** * Displays the form @@ -164,7 +172,7 @@ for ($x = 0; $x < $col; $x++) { if (!empty($InsCol) && isset($InsCol[$x]) && $InsCol[$x] == 'on') { ?> - - - @@ -241,7 +249,7 @@ for ($x = 0; $x < $col; $x++) { } ?> - - + - + - + - + - + - +