Aggiunta possibilita' di testata su piu' righe separate da \n
git-svn-id: svn://10.65.10.50/trunk@4572 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									89a64e25e7
								
							
						
					
					
						commit
						2782535535
					
				@ -299,6 +299,7 @@ TSpreadsheet::TSpreadsheet(
 | 
			
		||||
{
 | 
			
		||||
  int m_width[MAX_COL], v_width[MAX_COL];
 | 
			
		||||
  int fixed_columns = 1;                               // Number of fixed columns
 | 
			
		||||
  int lines_in_header = 1;                             // Number of header lines
 | 
			
		||||
  
 | 
			
		||||
  TControl::_fld = o;
 | 
			
		||||
  sheet_mask().set_sheet(o);
 | 
			
		||||
@ -319,20 +320,35 @@ TSpreadsheet::TSpreadsheet(
 | 
			
		||||
    const TOperable_field & f = (TOperable_field &) _mask.field(cid);            // Field on mask
 | 
			
		||||
 | 
			
		||||
    TString testa(h);
 | 
			
		||||
 | 
			
		||||
    char* t = testa.get_buffer();
 | 
			
		||||
    for (int c = 0; t[c]; c++)
 | 
			
		||||
    {
 | 
			
		||||
      if (t[c] == '\\' && (t[c+1] == 'n' || t[c+1] == 'r'))
 | 
			
		||||
      {
 | 
			
		||||
        t[c] = '\n';
 | 
			
		||||
        strcpy(t+c+1, t+c+2);
 | 
			
		||||
        lines_in_header = 2;
 | 
			
		||||
      }  
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const int at = testa.find('@');
 | 
			
		||||
    const int m = f.size();                 // Memory width
 | 
			
		||||
    int v = m;                               // Video width
 | 
			
		||||
    if (at >= 0)
 | 
			
		||||
    {
 | 
			
		||||
      const TString& wi = testa.mid(at+1);
 | 
			
		||||
      v = atoi(wi);
 | 
			
		||||
      v = atoi(wi) ;
 | 
			
		||||
      if (v == 0)   
 | 
			
		||||
        v = m;
 | 
			
		||||
      if (f.has_query_button())
 | 
			
		||||
        v++;
 | 
			
		||||
      if (wi.find('F') >= 0) 
 | 
			
		||||
      {
 | 
			
		||||
        fixed_columns++;
 | 
			
		||||
        f_width += v+1;
 | 
			
		||||
        f_width += v;
 | 
			
		||||
      }  
 | 
			
		||||
      testa.cut(at);
 | 
			
		||||
      v = max(at, v+(f.has_query_button() ? 1 : 0));
 | 
			
		||||
    } 
 | 
			
		||||
    else 
 | 
			
		||||
    {                                                     
 | 
			
		||||
@ -372,7 +388,7 @@ TSpreadsheet::TSpreadsheet(
 | 
			
		||||
  listdef->app_data = (long)this;
 | 
			
		||||
  XI_LIST_DEF* l = listdef->v.list;
 | 
			
		||||
  l->width = rct.right - rct.left;
 | 
			
		||||
  l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font());
 | 
			
		||||
  l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header;
 | 
			
		||||
  l->sizable_columns = TRUE;
 | 
			
		||||
  l->movable_columns = TRUE;
 | 
			
		||||
  l->scroll_bar = TRUE;                                  
 | 
			
		||||
@ -2663,15 +2679,17 @@ void TSheet_field::set_lines_record(TRecord_array & r_a)
 | 
			
		||||
// Certified: ...under debug..
 | 
			
		||||
TRectype * TSheet_field::putkey(const TRelation& r)
 | 
			
		||||
{
 | 
			
		||||
  if (_sheetfile) {
 | 
			
		||||
  if (_sheetfile) 
 | 
			
		||||
  {
 | 
			
		||||
    // *******
 | 
			
		||||
    // costruisce la chiave per il record array 
 | 
			
		||||
    _sheetfile->zero();
 | 
			
		||||
    _file_k_names.restart();
 | 
			
		||||
    _file_k_ids.restart();
 | 
			
		||||
    TString dbfieldname;
 | 
			
		||||
    while ((dbfieldname=_file_k_names.get())!="") {
 | 
			
		||||
      TMask_field & f= mask().field(atoi(_file_k_ids.get()));
 | 
			
		||||
    for (TString16 dbfieldname = _file_k_names.get(0); 
 | 
			
		||||
         dbfieldname.not_empty(); 
 | 
			
		||||
         dbfieldname = _file_k_names.get()) 
 | 
			
		||||
    {
 | 
			
		||||
      TMask_field& f= mask().field(_file_k_ids.get_int());
 | 
			
		||||
      ((TLoadable_field&)f).autoload(r);
 | 
			
		||||
      _sheetfile->put(dbfieldname, f.get()); 
 | 
			
		||||
    } 
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user