phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: etemplate/inc class.uietemplate_gtk.inc.php,1.2,


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: etemplate/inc class.uietemplate_gtk.inc.php,1.2,1.3
Date: Wed, 20 Feb 2002 16:34:55 -0500

Update of /cvsroot/phpgroupware/etemplate/inc
In directory subversions:/tmp/cvs-serv3809

Modified Files:
        class.uietemplate_gtk.inc.php 
Log Message:
horzi. & vertical alignment of widgets, size of Text-fields

Index: class.uietemplate_gtk.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.uietemplate_gtk.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.uietemplate_gtk.inc.php       20 Feb 2002 10:04:22 -0000      1.2
--- class.uietemplate_gtk.inc.php       20 Feb 2002 21:34:52 -0000      1.3
***************
*** 39,42 ****
--- 39,43 ----
                        'template' => True
                );
+               var $font_width=8;
  
                /*!
***************
*** 192,195 ****
--- 193,197 ----
                                        case 'float':
                                        case 'text':
+                                       case 'textarea':
                                                $set['var'] = 
$widget->get_chars(0,-1);
                                                break;
***************
*** 217,221 ****
                                                }
                                                break;
-                                       case 'textarea':
                                        case 'date':
                                }
--- 219,222 ----
***************
*** 309,313 ****
                                {
                                        $height = $this->data[0]["h$row"];
!                                       $class = $this->data[0]["c$row"];
                                }
                                $row_data = array();
--- 310,325 ----
                                {
                                        $height = $this->data[0]["h$row"];
!                                       list($class,$valign) = 
explode(',',$this->data[0]["c$row"]);
!                                       switch($valign)
!                                       {
!                                               case 'top':
!                                                       $valign = 0.0;
!                                                       break;
!                                               case 'bottom':
!                                                       $valign = 1.0;
!                                                       break;
!                                               default:
!                                                       $valign = 0.5;
!                                       }
                                }
                                $row_data = array();
***************
*** 327,331 ****
  
                                        //$row_data[$col] = 
$this->show_cell($cell,$content,$sel_options,$readonlys,$cname,$c,$r,$span);
!                                       $widget = 
$this->show_cell($cell,$content,$sel_options,$readonlys,$cname,$c,$r,$span,$result);
                                        if (($colspan = $span == 'all' ? 
$this->cols-$c : 0+$span) < 1)
                                        {
--- 339,344 ----
  
                                        //$row_data[$col] = 
$this->show_cell($cell,$content,$sel_options,$readonlys,$cname,$c,$r,$span);
!                                       $widget = 
&$this->show_cell($cell,$content,$sel_options,$readonlys,$cname,$c,$r,$span,$result);
! 
                                        if (($colspan = $span == 'all' ? 
$this->cols-$c : 0+$span) < 1)
                                        {
***************
*** 335,339 ****
                                        {
                                                $widget->show();
!                                               $table->attach($widget, $c, 
$c+$colspan, $r, $r+1,GTK_FILL,GTK_FILL,0,0);
                                        }
                                        if ($row_data[$col] == '' && 
$this->rows == 1)
--- 348,368 ----
                                        {
                                                $widget->show();
!                                               if ($align = ($cell['align'] || 
$valign))
!                                               {
!                                                       switch ($cell['align'])
!                                                       {
!                                                               case 'center':
!                                                                       $align 
= 0.5;
!                                                                       break;
!                                                               case 'right':
!                                                                       $align 
= 1.0;
!                                                                       break;
!                                                               default:
!                                                                       $align 
= 0.0;
!                                                       }
!                                                       $align = &new 
GtkAlignment($align,$valign,$cell['type'] == 'hrule' ? 1.0 : 0.0,0.0);
!                                                       $align->add($widget);
!                                               }
!                                               $table->attach($align ? $align 
: $widget, $c, $c+$colspan, $r, $r+1,GTK_FILL,GTK_FILL,0,0);
                                        }
                                        if ($row_data[$col] == '' && 
$this->rows == 1)
***************
*** 449,452 ****
--- 478,485 ----
                                        {
                                                $widget = &new GtkLabel($value);
+                                               if ($cell['align'] != 'center')
+                                               {
+                                                       
$widget->set_justify($cell['align'] == 'right' ? GTK_JUSTIFY_RIGHT : 
GTK_JUSTIFY_LEFT);
+                                               }
                                        }
                                        break;
***************
*** 479,487 ****
                                        }
                                        $widget->set_editable(!$readonly);
                                        break;
                                case 'textarea':        // Multiline Text 
Input, size: [rows][,cols]
                                        //$html .= 
$this->html->textarea($form_name,$value,$options.$this->html->formatOptions($cell['size'],'ROWS,COLS'));
                                        $widget = &new GtkText(null,null);
!                                       //$widget->set_text($value);
                                        $widget->set_editable(!$readonly);
                                        break;
--- 512,524 ----
                                        }
                                        $widget->set_editable(!$readonly);
+                                       if ($len)
+                                       {
+                                               
$widget->set_usize($len*$this->font_width,0);
+                                       }
                                        break;
                                case 'textarea':        // Multiline Text 
Input, size: [rows][,cols]
                                        //$html .= 
$this->html->textarea($form_name,$value,$options.$this->html->formatOptions($cell['size'],'ROWS,COLS'));
                                        $widget = &new GtkText(null,null);
!                                       
$widget->insert_text($value,strlen($value));
                                        $widget->set_editable(!$readonly);
                                        break;
***************
*** 596,606 ****
                                        }
                                        //$html .= 
$this->sbox->getArrayItem($form_name.'[]',$value,$sel_options,$cell['no_lang'],$options,$cell['size']);
!                                       if (!$cell['no_lang'])
                                        {
!                                               reset($sel_options);
!                                               while (list($key,$val) = 
each($sel_options))
                                                {
                                                        $sel_options[$key] = 
lang($val);
                                                }
                                        }
                                        $widget = &new GtkCombo();
--- 633,648 ----
                                        }
                                        //$html .= 
$this->sbox->getArrayItem($form_name.'[]',$value,$sel_options,$cell['no_lang'],$options,$cell['size']);
! 
!                                       reset($sel_options);
!                                       for ($maxlen=0; list($key,$val) = 
each($sel_options); )
                                        {
!                                               if (!$cell['no_lang'])
                                                {
                                                        $sel_options[$key] = 
lang($val);
                                                }
+                                               if (($len = 
strlen($sel_options[$key])) > $maxlen)
+                                               {
+                                                       $maxlen = $len;
+                                               }
                                        }
                                        $widget = &new GtkCombo();
***************
*** 609,612 ****
--- 651,655 ----
                                        $entry->set_text($sel_options[$value]);
                                        $entry->set_editable(False);
+                                       
$entry->set_usize($maxlen*$this->font_width,0);
                                        break;
  /*                            case 'select-percent':
***************
*** 645,648 ****
--- 688,692 ----
                                        //$html .= '<i>unknown type</i>';
                                        $widget = &new GtkLabel('unknown type: 
'.$cell['type']);
+                                       $widget->set_justify(GTK_JUSTIFY_LEFT);
                                        break;
                        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]