Aggiunto il ricalcolo della larghezza colonna per sezioni COLUMNWISE
nel caso venmga cambiato il font. Piccole risistemazioni funzionali. git-svn-id: svn://10.65.10.50/trunk@2350 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									fe032b05e3
								
							
						
					
					
						commit
						44a11fd33c
					
				@ -205,12 +205,16 @@ bool TForm_EC_editor::recalculate_positions(const char* name, int size)
 | 
				
			|||||||
        for (word i = 0; i < sec->fields() ; i++)
 | 
					        for (word i = 0; i < sec->fields() ; i++)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          TForm_item& fi = sec->field(i);
 | 
					          TForm_item& fi = sec->field(i);
 | 
				
			||||||
          if (fi.x() > 0 && (prm.ratio != 1.0))
 | 
					          short value = sec->columnwise() ? fi.y() : fi.x();
 | 
				
			||||||
 | 
					          if (value > 0 && (prm.ratio != 1.0))
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            real x_pos;
 | 
					            real x_pos;
 | 
				
			||||||
            x_pos = fi.x() * prm.ratio;
 | 
					            x_pos = value * prm.ratio;
 | 
				
			||||||
            x_pos.round();
 | 
					            x_pos.round();
 | 
				
			||||||
            fi.x() = (short)x_pos.integer();
 | 
					            if (sec->columnwise())
 | 
				
			||||||
 | 
					              fi.y() = (short)x_pos.integer();
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					              fi.x() = (short)x_pos.integer();
 | 
				
			||||||
            fi.set_dirty();
 | 
					            fi.set_dirty();
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -264,7 +268,7 @@ bool TForm_EC_editor::edit(char s, pagetype p)
 | 
				
			|||||||
    // carica i dati relativi ai flags (memorizzati in HEADER LAST)
 | 
					    // carica i dati relativi ai flags (memorizzati in HEADER LAST)
 | 
				
			||||||
    if (form().exist('H', last_page))
 | 
					    if (form().exist('H', last_page))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      TForm_item& flags = form().section('H',last_page).find_field(PEC_FLAGS);
 | 
					      TForm_item& flags = form().find_field('H',last_page,PEC_FLAGS);
 | 
				
			||||||
      TToken_string tt(flags.prompt());
 | 
					      TToken_string tt(flags.prompt());
 | 
				
			||||||
      if (tt.get(0) != NULL)
 | 
					      if (tt.get(0) != NULL)
 | 
				
			||||||
        m.set(F_SVALUTA,tt.get(0));
 | 
					        m.set(F_SVALUTA,tt.get(0));
 | 
				
			||||||
@ -274,7 +278,7 @@ bool TForm_EC_editor::edit(char s, pagetype p)
 | 
				
			|||||||
    // carica i dati relativi allo sfondo (memorizzati in GRAPHICS ODD)
 | 
					    // carica i dati relativi allo sfondo (memorizzati in GRAPHICS ODD)
 | 
				
			||||||
    if (form().exist('G', odd_page))
 | 
					    if (form().exist('G', odd_page))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      TForm_item& pict = form().section('G',odd_page).find_field(PEC_PICTURE);
 | 
					      TForm_item& pict = form().find_field('G',odd_page,PEC_PICTURE);
 | 
				
			||||||
      m.set(F_BACKGROUND,pict.prompt());
 | 
					      m.set(F_BACKGROUND,pict.prompt());
 | 
				
			||||||
      m.set(F_BACKWIDTH,pict.width());
 | 
					      m.set(F_BACKWIDTH,pict.width());
 | 
				
			||||||
      m.set(F_BACKHEIGHT,pict.height());
 | 
					      m.set(F_BACKHEIGHT,pict.height());
 | 
				
			||||||
@ -296,7 +300,7 @@ bool TForm_EC_editor::edit(char s, pagetype p)
 | 
				
			|||||||
      else if (k==K_F5) local_dirty = edit_formato_numero();
 | 
					      else if (k==K_F5) local_dirty = edit_formato_numero();
 | 
				
			||||||
      else if (k!= K_ESC && k!=K_ENTER)
 | 
					      else if (k!= K_ESC && k!=K_ENTER)
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        if (k==K_F6) { s = 'H'; caption = "Testa"; }
 | 
					        if (k==K_F6) { s = 'H'; caption = "Testata"; }
 | 
				
			||||||
        else if (k==K_F7) { s = 'B'; caption = "Corpo"; }
 | 
					        else if (k==K_F7) { s = 'B'; caption = "Corpo"; }
 | 
				
			||||||
        else if (k==K_F8) { s = 'F'; caption = "Piede"; }
 | 
					        else if (k==K_F8) { s = 'F'; caption = "Piede"; }
 | 
				
			||||||
        local_dirty = TRUE;
 | 
					        local_dirty = TRUE;
 | 
				
			||||||
@ -321,13 +325,13 @@ bool TForm_EC_editor::edit(char s, pagetype p)
 | 
				
			|||||||
        if (local_dirty)
 | 
					        if (local_dirty)
 | 
				
			||||||
          local_dirty = form().section(s,odd_page).edit(caption);
 | 
					          local_dirty = form().section(s,odd_page).edit(caption);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      if (local_dirty) dirty=TRUE;
 | 
					      if (local_dirty || m.dirty()!=0) dirty=TRUE;
 | 
				
			||||||
      if (k==K_ESC || k==K_ENTER)
 | 
					      if (k==K_ESC || k==K_ENTER)
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    } // End of while
 | 
					    } // End of while
 | 
				
			||||||
  }   // End if
 | 
					  }   // End if
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  if (m.dirty() != 0)
 | 
					  if (m.dirty() != 0 || dirty)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    form().fontname() = m.get(F_SFONT);
 | 
					    form().fontname() = m.get(F_SFONT);
 | 
				
			||||||
    form().fontsize() = m.get_int(F_SSIZE);
 | 
					    form().fontsize() = m.get_int(F_SSIZE);
 | 
				
			||||||
@ -338,7 +342,7 @@ bool TForm_EC_editor::edit(char s, pagetype p)
 | 
				
			|||||||
    form().ipy() = m.get_int(F_SIPY);
 | 
					    form().ipy() = m.get_int(F_SIPY);
 | 
				
			||||||
    if (form().exist('H', last_page))
 | 
					    if (form().exist('H', last_page))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      TForm_item& flags = form().section('H',last_page).find_field(PEC_FLAGS);
 | 
					      TForm_item& flags = form().find_field('H',last_page,PEC_FLAGS);
 | 
				
			||||||
      TString s(m.get(F_SVALUTA));
 | 
					      TString s(m.get(F_SVALUTA));
 | 
				
			||||||
      s << "|" << m.get(F_FINK);
 | 
					      s << "|" << m.get(F_FINK);
 | 
				
			||||||
      form().section('H',last_page).set_dirty();
 | 
					      form().section('H',last_page).set_dirty();
 | 
				
			||||||
@ -347,7 +351,7 @@ bool TForm_EC_editor::edit(char s, pagetype p)
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    if (form().exist('G', odd_page))
 | 
					    if (form().exist('G', odd_page))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      TForm_item& pict = form().section('G',odd_page).find_field(PEC_PICTURE);
 | 
					      TForm_item& pict = form().find_field('G',odd_page,PEC_PICTURE);
 | 
				
			||||||
      pict.set_prompt(m.get(F_BACKGROUND));
 | 
					      pict.set_prompt(m.get(F_BACKGROUND));
 | 
				
			||||||
      pict.width() = m.get_int(F_BACKWIDTH);
 | 
					      pict.width() = m.get_int(F_BACKWIDTH);
 | 
				
			||||||
      pict.height() = m.get_int(F_BACKHEIGHT);
 | 
					      pict.height() = m.get_int(F_BACKHEIGHT);
 | 
				
			||||||
@ -362,7 +366,7 @@ bool TForm_EC_editor::edit(char s, pagetype p)
 | 
				
			|||||||
  if ((dirty && k==K_ESC && yesno_box("Salvare le modifiche?")) || (dirty && k==K_ENTER))
 | 
					  if ((dirty && k==K_ESC && yesno_box("Salvare le modifiche?")) || (dirty && k==K_ENTER))
 | 
				
			||||||
  { // Se si preme annulla e sono state effettuate modifiche chiede la conferma per salvare
 | 
					  { // Se si preme annulla e sono state effettuate modifiche chiede la conferma per salvare
 | 
				
			||||||
    // Se invece si preme conferma e sono state effettuate modifiche non chiede la conferma
 | 
					    // Se invece si preme conferma e sono state effettuate modifiche non chiede la conferma
 | 
				
			||||||
    if (form().code() == "")
 | 
					    if (form().code().empty())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      TFilename n(form().name()); n.ext("frm");
 | 
					      TFilename n(form().name()); n.ext("frm");
 | 
				
			||||||
      TFilename bak(n); bak.ext("bak");
 | 
					      TFilename bak(n); bak.ext("bak");
 | 
				
			||||||
@ -399,7 +403,8 @@ bool TForm_EC_editor::ask_profile()
 | 
				
			|||||||
    if (k == K_ENTER)
 | 
					    if (k == K_ENTER)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      check_form();
 | 
					      check_form();
 | 
				
			||||||
      set_form(new TForm(fform, (fcode!=0) ? format("%04ld%c",fcode,flng) : "", extra() ? 2 :1, fdesc));
 | 
					      set_form(new TForm(fform, (fcode!=0) ? cod : "", extra() ? 2 :1, fdesc));
 | 
				
			||||||
 | 
					      form().section_mask() = "sc3100s";
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    }            
 | 
					    }            
 | 
				
			||||||
    else if (k == K_DEL)
 | 
					    else if (k == K_DEL)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user