!752

static JTextField tf1, tf2, tf3, tf4;
static JLabel lblEntries;

concepts.

concept Quadro {
  S user, system, suggest, feedback;
}

static Quadro currentQuadro;

p-substance {
  loadAndAutoSaveConcepts();
  
  showForm(
    "User:", tf1 = new JTextField,
    "System:", tf2 = new JTextField,
    "Suggest:", tf3 = new JTextField,
    "Feedback:", tf4 = new JTextField,
    "Entries in DB:" , lblEntries = jlabel());
    
  installTimer(lblEntries, 1000, r {
    lblEntries.setText(str(countConcepts(Quadro.class)));
  });
    
  onEnter(tf1, r {
    currentQuadro = null;
    q().user = tf1.getText();
    q().system = makeSystemAnswer(q().user);
    tf2.setText(q().system);
    tf4.requestFocus();
  });
  
  onEnter(tf3, r {
    q().suggest = tf3.getText();
  });
  
  onEnter(tf4, r {
    q().feedback = tf4.getText();
  });
}

static Quadro q() {
  if (currentQuadro == null)
    currentQuadro = new Quadro;
  ret currentQuadro;
}

static S makeSystemAnswer(S q) {
  ret "woooot";
}