From 19da1c20c5532455417b1631e8b442c489447045 Mon Sep 17 00:00:00 2001 From: villa Date: Mon, 5 Jun 1995 08:58:11 +0000 Subject: [PATCH] Corretto errore nella creazione righe array_sheet per items forms (uack uack, zakaput gnorck kiot) git-svn-id: svn://10.65.10.50/trunk@1438 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/form.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/include/form.cpp b/include/form.cpp index 8cfc1a841..e8cf809aa 100755 --- a/include/form.cpp +++ b/include/form.cpp @@ -629,9 +629,10 @@ bool TForm_item::update() } void TForm_item::print_on(TToken_string& row) const -{ +{ + row = ""; row.add(id()); - row = class_name(); + row.add(class_name()); row.add(_y); row.add(_x); @@ -666,6 +667,7 @@ void TForm_item::read_from(const TMask& m) _prompt = m.get(F_PROMPT); _width = atoi(m.get(F_WIDTH)); _height = atoi(m.get(F_HEIGHT)); + _id = atoi(m.get(F_ID)); _flag.read_from(m); @@ -680,12 +682,24 @@ bool TForm_item::edit(TMask& m) m.enable(F_CLASS, m.insert_mode()); m.reset(); - if (!m.insert_mode()) - print_on(m); + + if (m.insert_mode()) + { + short id = 0; + for (word i = 0; i < section().fields(); i++) + { + const TForm_item& f = section().field(i); + if (f.id() > id) id = f.id(); + } + _id = id+1; + } + + print_on(m); const bool godmode = form().edit_level() > 1; m.enable_page(1, godmode); m.enable(-7, godmode); + m.enable(F_ID, godmode); const bool dirty = m.run() == K_ENTER && m.dirty(); if (dirty)