Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Sempronio, The Reader - Unit2.pas

Unit2.pas

Caricato da: Anonymous
Scarica il programma completo

  1. unit Unit2;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls, Grids, Menus, ExtCtrls, FileCtrl;
  8.  
  9. type
  10.   Tfrmfonetica = class(TForm)
  11.     GroupBox1: TGroupBox;
  12.     Label7: TLabel;
  13.     GroupBox2: TGroupBox;
  14.     ComboBox1: TComboBox;
  15.     GroupBox3: TGroupBox;
  16.     ListBox1: TListBox;
  17.     GroupBox4: TGroupBox;
  18.     vocali: TGroupBox;
  19.     Label2: TLabel;
  20.     RadioButton1: TRadioButton;
  21.     RadioButton2: TRadioButton;
  22.     z: TGroupBox;
  23.     Label3: TLabel;
  24.     RadioButton5: TRadioButton;
  25.     RadioButton6: TRadioButton;
  26.     c: TGroupBox;
  27.     lblc: TLabel;
  28.     RadioButton7: TRadioButton;
  29.     RadioButton8: TRadioButton;
  30.     gngl: TGroupBox;
  31.     Label1: TLabel;
  32.     RadioButton3: TRadioButton;
  33.     RadioButton4: TRadioButton;
  34.     j: TGroupBox;
  35.     Label4: TLabel;
  36.     RadioButton11: TRadioButton;
  37.     RadioButton12: TRadioButton;
  38.     il: TGroupBox;
  39.     lblil: TLabel;
  40.     RadioButton13: TRadioButton;
  41.     RadioButton14: TRadioButton;
  42.     StringGrid1: TStringGrid;
  43.     Button3: TButton;
  44.     MainMenu1: TMainMenu;
  45.     File1: TMenuItem;
  46.     N1: TMenuItem;
  47.     Esci1: TMenuItem;
  48.     About1: TMenuItem;
  49.     Chiudi1: TMenuItem;
  50.     Visualizzamodificheeffettuate1: TMenuItem;
  51.     Button1: TButton;
  52.     ListBox2: TListBox;
  53.     StringGrid2: TStringGrid;
  54.     Button2: TButton;
  55.     Button4: TButton;
  56.     GroupBox6: TGroupBox;
  57.     consonanti: TGroupBox;
  58.     RadioButton19: TRadioButton;
  59.     RadioButton20: TRadioButton;
  60.     Label9: TLabel;
  61.     GroupBox7: TGroupBox;
  62.     Label5: TLabel;
  63.     RadioButton9: TRadioButton;
  64.     RadioButton10: TRadioButton;
  65.     RadioButton16: TRadioButton;
  66.     RadioButton15: TRadioButton;
  67.     Label6: TLabel;
  68.     Edit1: TEdit;
  69.     Label8: TLabel;
  70.     GroupBox8: TGroupBox;
  71.     Label10: TLabel;
  72.     Button6: TButton;
  73.     Button5: TButton;
  74.     FileListBox1: TFileListBox;
  75.     RadioButton18: TRadioButton;
  76.     RadioButton17: TRadioButton;
  77.     Label11: TLabel;
  78.     Button7: TButton;
  79.     Button8: TButton;
  80.     Button9: TButton;
  81.     procedure ComboBox1KeyDown(Sender: TObject; var Key: Word;
  82.       Shift: TShiftState);
  83.     procedure ComboBox1Change(Sender: TObject);
  84.     procedure ListBox1Click(Sender: TObject);
  85.     procedure ComboBox1KeyPress(Sender: TObject; var Key: Char);
  86.     procedure Button3Click(Sender: TObject);
  87.     procedure RadioButton14Click(Sender: TObject);
  88.     procedure RadioButton13Click(Sender: TObject);
  89.     procedure Chiudi1Click(Sender: TObject);
  90.     procedure Esci1Click(Sender: TObject);
  91.     procedure About1Click(Sender: TObject);
  92.     procedure Visualizzamodificheeffettuate1Click(Sender: TObject);
  93.     procedure Edit1Change(Sender: TObject);
  94.     procedure ListBox2Click(Sender: TObject);
  95.     procedure Button1Click(Sender: TObject);
  96.     procedure RadioButton1Click(Sender: TObject);
  97.     procedure RadioButton2Click(Sender: TObject);
  98.     procedure RadioButton3Click(Sender: TObject);
  99.     procedure RadioButton4Click(Sender: TObject);
  100.     procedure RadioButton9Click(Sender: TObject);
  101.     procedure RadioButton10Click(Sender: TObject);
  102.     procedure RadioButton15Click(Sender: TObject);
  103.     procedure RadioButton16Click(Sender: TObject);
  104.     procedure RadioButton7Click(Sender: TObject);
  105.     procedure RadioButton8Click(Sender: TObject);
  106.     procedure RadioButton11Click(Sender: TObject);
  107.     procedure RadioButton12Click(Sender: TObject);
  108.     procedure RadioButton5Click(Sender: TObject);
  109.     procedure RadioButton6Click(Sender: TObject);
  110.     procedure Button4Click(Sender: TObject);
  111.     procedure Button5Click(Sender: TObject);
  112.     procedure Button6Click(Sender: TObject);
  113.     procedure FileListBox1Change(Sender: TObject);
  114.     procedure FormActivate(Sender: TObject);
  115.     procedure FormDeactivate(Sender: TObject);
  116.     procedure RadioButton19Click(Sender: TObject);
  117.     procedure RadioButton20Click(Sender: TObject);
  118.     procedure Edit1KeyPress(Sender: TObject; var Key: Char);
  119.     procedure Button7Click(Sender: TObject);
  120.     procedure Button2Click(Sender: TObject);
  121.     procedure Button8Click(Sender: TObject);
  122.   private
  123.     { Private declarations }
  124.   public
  125.     { Public declarations }
  126.   end;
  127.  
  128. var
  129.   frmfonetica: Tfrmfonetica;
  130.  
  131. implementation
  132.  
  133. uses Unit1, Unit3, Unit4, Unit5, Unit6; //Unit2;
  134.  
  135. {$R *.dfm}
  136.  
  137. procedure prossimo;
  138.  begin
  139.   frmfonetica.stringgrid2.row:=frmfonetica.listbox2.ItemIndex;
  140.   frmfonetica.combobox1.Text:=frmfonetica.listbox2.Items[frmfonetica.listbox2.itemindex];
  141.   frmfonetica.button1.click;
  142.   frmfonetica.radiobutton1.Checked:=false;
  143.   frmfonetica.radiobutton2.Checked:=false;
  144.   frmfonetica.radiobutton3.Checked:=false;
  145.   frmfonetica.radiobutton4.Checked:=false;
  146.   frmfonetica.radiobutton5.Checked:=false;
  147.   frmfonetica.radiobutton6.Checked:=false;
  148.   frmfonetica.radiobutton7.Checked:=false;
  149.   frmfonetica.radiobutton8.Checked:=false;
  150.   frmfonetica.radiobutton9.Checked:=false;
  151.   frmfonetica.radiobutton10.Checked:=false;
  152.   frmfonetica.radiobutton11.Checked:=false;
  153.   frmfonetica.radiobutton12.Checked:=false;
  154.   frmfonetica.radiobutton13.Checked:=false;
  155.   frmfonetica.radiobutton14.Checked:=false;
  156.   frmfonetica.radiobutton15.Checked:=false;
  157.   frmfonetica.radiobutton16.Checked:=false;
  158.   frmfonetica.radiobutton19.Checked:=false;
  159.   frmfonetica.radiobutton20.Checked:=false;
  160.  end;
  161. procedure Tfrmfonetica.ComboBox1KeyDown(Sender: TObject; var Key: Word;
  162.   Shift: TShiftState);
  163. begin
  164.  combobox1.Text:='';
  165. end;
  166.  
  167. procedure Tfrmfonetica.ComboBox1Change(Sender: TObject);
  168. begin
  169. button1.click;
  170. end;
  171.  
  172. procedure Tfrmfonetica.ListBox1Click(Sender: TObject);
  173. var i:integer;
  174. begin
  175.  if (listbox1.itemindex>=0) then
  176.   begin
  177.    if (il.visible=false)and (vocali.visible=false)and (gngl.visible=false)and (c.visible=false)and (j.visible=false)and (z.visible=false) then
  178.     exit
  179.    else
  180.     begin
  181.      button3.enabled:=true
  182.     end;
  183.    end
  184.  else
  185.   begin
  186.    button3.enabled:=false;
  187.   end;
  188.  for i:=0 to stringgrid1.rowcount-1 do
  189.   begin
  190.    stringgrid1.Cells[1,i]:=lowercase(stringgrid1.Cells[1,i]) ;
  191.   end;
  192.  i:=-1;
  193.  repeat
  194.   i:=i+1;
  195.   stringgrid1.Cells[0,i];
  196.  until
  197.   stringgrid1.cells[0,i]=listbox1.items[listbox1.ItemIndex];
  198.  stringgrid1.Cells[1,i]:=uppercase( stringgrid1.Cells[1,i]);
  199.  stringgrid1.row:=i;
  200.  //lblcontatore.caption:=inttostr(i);
  201.  
  202. end;
  203.  
  204. procedure Tfrmfonetica.ComboBox1KeyPress(Sender: TObject; var Key: Char);
  205. begin
  206. if ord(key) in [97..122] then
  207. exit
  208. else
  209. key:=chr(0);
  210. end;
  211.  
  212. procedure Tfrmfonetica.Button3Click(Sender: TObject);
  213. var i,i2:integer;
  214. begin
  215.  if (listbox1.ItemIndex=-1) or ((il.visible=false)and (vocali.visible=false)and (gngl.visible=false)and (c.visible=false)and (j.visible=false)and (z.visible=false)) then
  216.   begin
  217.    button3.Enabled:=false;
  218.    showmessage('Prima selezionare una posizione nello step 2');
  219.   end;
  220.   if combobox1.text='a' then
  221.   begin
  222.  
  223.    for i:=0 to (listbox1.count)-1 do
  224.     begin
  225.      if (frmmodifiche.A.count<listbox1.count) then
  226.       begin
  227.       for i2:=0 to (listbox1.count)-1 do
  228.        frmmodifiche.a.Items.Add(chr(0));
  229.        end;
  230.      if radiobutton2.checked=true then
  231.       begin
  232.        frmmodifiche.a.Items.Delete(listbox1.itemindex);
  233.        frmmodifiche.a.Items.Insert(listbox1.itemindex,'chiuso-');
  234.       end
  235.      else
  236.       begin
  237.        frmmodifiche.a.Items.Delete(listbox1.itemindex);
  238.        frmmodifiche.a.Items.Insert(listbox1.itemindex,'aperto-');
  239.       end;
  240.     end
  241.   end
  242.  else
  243.  if combobox1.text='c' then
  244.   begin
  245.    for i:=0 to (listbox1.count)-1 do
  246.     begin
  247.      if frmmodifiche.c.count<listbox1.count then
  248.       for i2:=0 to (listbox1.count)-1 do
  249.      frmmodifiche.c.items.add(chr(0));
  250.      if radiobutton7.checked=true then
  251.       begin
  252.        frmmodifiche.c.Items.Delete(listbox1.itemindex);
  253.        frmmodifiche.c.Items.Insert(listbox1.itemindex,'dolce-');
  254.       end
  255.      else
  256.       begin
  257.        frmmodifiche.C.Items.Delete(listbox1.itemindex);
  258.        frmmodifiche.C.Items.Insert(listbox1.itemindex,'dura-');
  259.       end
  260.     end
  261.    end
  262.   else
  263.    if combobox1.text='e' then
  264.    begin
  265.     for i:=0 to (listbox1.count)-1 do
  266.      begin
  267.       if frmmodifiche.e.count<listbox1.count then
  268.        for i2:=0 to (listbox1.count)-1 do
  269.       frmmodifiche.e.items.add(chr(0));
  270.       if radiobutton1.checked=true then
  271.        begin
  272.         frmmodifiche.e.Items.Delete(listbox1.itemindex);
  273.         frmmodifiche.e.Items.Insert(listbox1.itemindex,'aperto-');
  274.        end
  275.       else
  276.        begin
  277.         frmmodifiche.e.Items.Delete(listbox1.itemindex);
  278.         frmmodifiche.e.Items.Insert(listbox1.itemindex,'chiuso-');
  279.        end
  280.      end
  281.     end
  282.    else
  283.    if combobox1.text='g' then
  284.    begin
  285.    for i:=0 to (listbox1.count)-1 do
  286.     begin
  287.      if frmmodifiche.c.count<listbox1.count then
  288.       for i2:=0 to (listbox1.count)-1 do
  289.      frmmodifiche.c.items.add(chr(0));
  290.      if radiobutton3.checked=true then
  291.       begin
  292.        frmmodifiche.g.Items.Delete(listbox1.itemindex);
  293.        frmmodifiche.g.Items.Insert(listbox1.itemindex,'dolce-');
  294.       end
  295.      else
  296.       begin
  297.        if (radiobutton4.checked=true) or (radiobutton9.Checked=true) or (radiobutton15.checked=true) then
  298.         begin
  299.          if (radiobutton9.Checked=true) or (radiobutton15.checked=true) then
  300.          showmessage('Accertarsi anche di impostare come: "Non pronunciare" il carattere successivo alla g');
  301.          frmmodifiche.g.Items.Delete(listbox1.itemindex);
  302.          frmmodifiche.g.Items.Insert(listbox1.itemindex,'dura-');
  303.         end
  304.        else
  305.         begin
  306.          if (radiobutton10.checked=true) then
  307.           begin
  308.            showmessage('Accertarsi anche di impostare come: "Non pronunciare" il carattere successivo alla g');
  309.            frmmodifiche.g.Items.Delete(listbox1.itemindex);
  310.            frmmodifiche.g.Items.Insert(listbox1.itemindex,'l-');
  311.           end
  312.          else
  313.           begin
  314.            if (radiobutton16.checked=true) then
  315.             begin
  316.              frmmodifiche.g.Items.Delete(listbox1.itemindex);
  317.              frmmodifiche.g.Items.Insert(listbox1.itemindex,'n-');
  318.             end;
  319.           end;
  320.         end;
  321.       end;
  322.      end;
  323.    end
  324.    else
  325.     begin
  326.      if combobox1.text='i' then
  327.       begin
  328.        for i:=0 to (listbox1.count)-1 do
  329.         begin
  330.          if frmmodifiche.i.count<listbox1.count then
  331.       for i2:=0 to (listbox1.count)-1 do
  332.          frmmodifiche.i.items.add(chr(0));
  333.          if radiobutton14.checked=true then
  334.           begin
  335.            frmmodifiche.i.Items.Delete(listbox1.itemindex);
  336.            frmmodifiche.i.Items.Insert(listbox1.itemindex,'non-');
  337.           end
  338.          else
  339.       begin
  340.       if (radiobutton1.checked=true) then
  341.       begin
  342.        frmmodifiche.i.Items.Delete(listbox1.itemindex);
  343.        frmmodifiche.i.Items.Insert(listbox1.itemindex,'aperto-');
  344.       end
  345.       else
  346.        begin
  347.        frmmodifiche.i.Items.Delete(listbox1.itemindex);
  348.        frmmodifiche.i.Items.Insert(listbox1.itemindex,'chiuso-');
  349.       end
  350.     end
  351.    end;
  352.   end
  353.    else
  354.    if combobox1.text='j' then
  355.   begin
  356.    for i:=0 to (listbox1.count)-1 do
  357.     begin
  358.      if frmmodifiche.j.count<listbox1.count then
  359.       for i2:=0 to (listbox1.count)-1 do
  360.      frmmodifiche.j.items.add(chr(0));
  361.      if radiobutton11.checked=true then
  362.       begin
  363.        frmmodifiche.j.Items.Delete(listbox1.itemindex);
  364.        frmmodifiche.j.Items.Insert(listbox1.itemindex,'dolce-');
  365.       end
  366.      else
  367.       begin
  368.        frmmodifiche.j.Items.Delete(listbox1.itemindex);
  369.        frmmodifiche.j.Items.Insert(listbox1.itemindex,'l-');
  370.       end
  371.     end
  372.    end
  373.   else
  374.  if combobox1.text='z' then
  375.   begin
  376.    for i:=0 to (listbox1.count)-1 do
  377.     begin
  378.      if frmmodifiche.z.count<listbox1.count then
  379.       for i2:=0 to (listbox1.count)-1 do
  380.      frmmodifiche.z.items.add(chr(0));
  381.      if radiobutton5.checked=true then
  382.       begin
  383.        frmmodifiche.z.Items.Delete(listbox1.itemindex);
  384.        frmmodifiche.z.Items.Insert(listbox1.itemindex,'sorda-');
  385.       end
  386.      else
  387.       begin
  388.        frmmodifiche.z.Items.Delete(listbox1.itemindex);
  389.        frmmodifiche.z.Items.Insert(listbox1.itemindex,'sonora-');
  390.       end
  391.     end
  392.    end
  393.   else
  394.   if combobox1.text='o' then
  395.   begin
  396.    for i:=0 to (listbox1.count)-1 do
  397.     begin
  398.      if frmmodifiche.o.count<listbox1.count then
  399.       for i2:=0 to (listbox1.count)-1 do
  400.      frmmodifiche.o.items.add(chr(0));
  401.      if radiobutton1.checked=true then
  402.       begin
  403.        frmmodifiche.o.Items.Delete(listbox1.itemindex);
  404.        frmmodifiche.o.Items.Insert(listbox1.itemindex,'aperto-');
  405.       end
  406.      else
  407.       begin
  408.        frmmodifiche.o.Items.Delete(listbox1.itemindex);
  409.        frmmodifiche.o.Items.Insert(listbox1.itemindex,'chiuso-');
  410.       end
  411.     end
  412.    end
  413.   else
  414.   if combobox1.text='u' then
  415.   begin
  416.    for i:=0 to (listbox1.count)-1 do
  417.     begin
  418.      if frmmodifiche.u.count<listbox1.count then
  419.       for i2:=0 to (listbox1.count)-1 do
  420.      frmmodifiche.u.items.add(chr(0));
  421.      if radiobutton1.checked=true then
  422.       begin
  423.        frmmodifiche.u.Items.Delete(listbox1.itemindex);
  424.        frmmodifiche.u.Items.Insert(listbox1.itemindex,'aperto-');
  425.       end
  426.      else
  427.       begin
  428.        frmmodifiche.u.Items.Delete(listbox1.itemindex);
  429.        frmmodifiche.u.Items.Insert(listbox1.itemindex,'chiuso-');
  430.       end
  431.     end
  432.    end
  433.   else
  434.    end
  435.  
  436. end;
  437.  
  438. procedure Tfrmfonetica.RadioButton14Click(Sender: TObject);
  439. begin
  440.  vocali.visible:=false;
  441.  consonanti.visible:=false;
  442.  if radiobutton18.checked=true then
  443.   begin
  444.   stringgrid2.cells[1,listbox2.itemindex]:='none';
  445.   listbox2.ItemIndex:=listbox2.itemindex+1;
  446.   prossimo;
  447.   end;
  448. end;
  449.  
  450. procedure Tfrmfonetica.RadioButton13Click(Sender: TObject);
  451. begin
  452. if lblil.Caption='I:' then
  453.  vocali.visible:=true
  454.  else
  455.  consonanti.visible:=true;
  456.  if radiobutton18.checked=true then
  457.   begin
  458.    stringgrid2.cells[1,listbox2.itemindex]:='#';
  459.    radiobutton1.Checked:=false;
  460.    radiobutton2.Checked:=false;
  461.   end;
  462. end;
  463.  
  464. procedure Tfrmfonetica.Chiudi1Click(Sender: TObject);
  465. begin
  466.  close
  467. end;
  468.  
  469. procedure Tfrmfonetica.Esci1Click(Sender: TObject);
  470. begin
  471.  halt
  472. end;
  473.  
  474. procedure Tfrmfonetica.About1Click(Sender: TObject);
  475. begin
  476. frmabout.Show;
  477. end;
  478.  
  479. procedure Tfrmfonetica.Visualizzamodificheeffettuate1Click(
  480.   Sender: TObject);
  481. begin
  482.  frmmodifiche.Show;
  483. end;
  484.  
  485. procedure Tfrmfonetica.Edit1Change(Sender: TObject);
  486. var i:integer;
  487. begin
  488. listbox2.clear;
  489.  for i:=0 to length(edit1.Text)-1 do
  490.   begin
  491.    stringgrid2.rowCount:=i+1;
  492.    StringGrid2.cells[0,i]:=inttostr(i+1);
  493.   // StringGrid2.cells[1,i]:=;
  494.    stringgrid2.cells[1,i]:='#';
  495.    listbox2.Items[i]:= edit1.text[i+1]  //StringGrid2.cells[1,i]
  496.   end;
  497.  radiobutton1.Checked:=false;
  498.  radiobutton2.Checked:=false;
  499.  radiobutton3.Checked:=false;
  500.  radiobutton4.Checked:=false;
  501.  radiobutton5.Checked:=false;
  502.  radiobutton6.Checked:=false;
  503.  radiobutton7.Checked:=false;
  504.  radiobutton8.Checked:=false;
  505.  radiobutton9.Checked:=false;
  506.  radiobutton10.Checked:=false;
  507.  radiobutton11.Checked:=false;
  508.  radiobutton12.Checked:=false;
  509.  radiobutton13.Checked:=false;
  510.  radiobutton14.Checked:=false;
  511.  radiobutton15.Checked:=false;
  512.  radiobutton16.Checked:=false;
  513.  radiobutton19.Checked:=false;
  514.  radiobutton20.Checked:=false;
  515. (* if edit1.Text='' then
  516.  button2.Enabled:=False
  517.  else
  518.   button2.Enabled:=true; *)
  519. end;
  520.  
  521. procedure Tfrmfonetica.ListBox2Click(Sender: TObject);
  522. begin
  523.  prossimo
  524.  (*stringgrid2.row:=listbox2.ItemIndex;
  525.  combobox1.Text:=listbox2.Items[listbox2.itemindex];
  526.  button1.click;
  527.  radiobutton1.Checked:=false;
  528.  radiobutton2.Checked:=false;
  529.  radiobutton3.Checked:=false;
  530.  radiobutton4.Checked:=false;
  531.  radiobutton5.Checked:=false;
  532.  radiobutton6.Checked:=false;
  533.  radiobutton7.Checked:=false;
  534.  radiobutton8.Checked:=false;
  535.  radiobutton9.Checked:=false;
  536.  radiobutton10.Checked:=false;
  537.  radiobutton11.Checked:=false;
  538.  radiobutton12.Checked:=false;
  539.  radiobutton13.Checked:=false;
  540.  radiobutton14.Checked:=false;
  541.  radiobutton15.Checked:=false;
  542.  radiobutton16.Checked:=false;
  543.  radiobutton19.Checked:=false;
  544.  radiobutton20.Checked:=false; *)
  545. end;
  546.  
  547. procedure Tfrmfonetica.Button1Click(Sender: TObject);
  548. var i,contatore:integer;
  549. begin
  550.  if (listbox2.itemindex>=0) then
  551.   begin
  552.    button3.enabled:=true;
  553.    button2.Enabled:=true;
  554.   end
  555.  else
  556.   begin
  557.    button3.enabled:=false;
  558.    button2.Enabled:=false;
  559.   end;
  560.  contatore:=0;
  561.  for i:=0 to Length(frmmainform.memo2.Text)-1 do
  562.   begin
  563.    if combobox1.text[1]=(frmmainform.memo2.Text[i+1]) then
  564.     begin
  565.      contatore:=contatore+1;
  566.     end;
  567.   end;
  568.  label7.caption:='Nel testo ho trovato: '+inttostr(contatore)+' '+combobox1.text;
  569.  
  570.  contatore:=0;
  571.     listbox1.Clear;
  572.  for i:=0 to stringgrid1.rowcount-1 do
  573.   begin
  574.    stringgrid1.Cells[0,i]:='';
  575.    if stringgrid1.Cells[1,i]=combobox1.Text[1] then
  576.     begin
  577.      contatore:=contatore+1;
  578.      stringgrid1.Cells[0,i]:=inttostr(contatore);
  579.      listbox1.Items.Add(inttostr(contatore));
  580.     end;
  581.   end;
  582.  
  583. (* if(combobox1.Text[1]) in ['b','d','f','k','m','n','p','q','r','s','t','v'] then
  584.   begin
  585.    consonanti.Visible:=true;
  586.    vocali.Visible:=false;
  587.    gngl.Visible:=false;
  588.    z.Visible:=false;
  589.    cg.visible:=false;
  590.    j.Visible:=false;
  591.   end
  592.  else     *)
  593.   begin
  594.    if (combobox1.Text[1]) in ['a','e','o','u'] then
  595.     begin
  596.      il.Visible:=false;
  597.      vocali.Visible:=true;
  598.      gngl.Visible:=false;
  599.      z.Visible:=false;
  600.      c.visible:=false;
  601.      j.Visible:=false;
  602.      consonanti.Visible:=false;
  603.     end
  604.    else
  605.     begin
  606.      if (combobox1.Text[1]) in ['c'] then
  607.       begin
  608.        il.Visible:=true;
  609.        lblil.Caption:='C';
  610.        vocali.Visible:=false;
  611.        gngl.Visible:=false;
  612.        z.Visible:=false;
  613.        c.visible:=true;
  614.        j.Visible:=false;
  615.        consonanti.Visible:=true;
  616.       end
  617.      else
  618.       if (combobox1.Text[1]) in ['g'] then
  619.        begin
  620.         il.Visible:=true;
  621.         lblil.Caption:='G';
  622.         vocali.Visible:=false;
  623.         gngl.Visible:=true;
  624.         z.Visible:=false;
  625.         j.Visible:=false;
  626.         consonanti.Visible:=true;
  627.         groupbox7.visible:=true;
  628.        end
  629.       else
  630.        begin
  631.         if (combobox1.Text[1]) in ['h','w','x','y','b','d','f','k','m','n','p','q','r','s','t','v'] then
  632.          begin
  633.           if (combobox1.Text[1]) in ['b','d','f','m','n','p','q','r','s','t','v'] then
  634.            begin
  635.             consonanti.Visible:=true;
  636.             il.Visible:=true;
  637.             lblil.caption:=uppercase(combobox1.text[1])+':';
  638.            end
  639.           else
  640.            begin
  641.             consonanti.Visible:=false;
  642.             il.Visible:=false;
  643.            end;
  644.           vocali.Visible:=false;
  645.           gngl.Visible:=false;
  646.           z.Visible:=false;
  647.           c.visible:=false;
  648.           j.Visible:=false;
  649.          end
  650.         else
  651.          begin
  652.           if (combobox1.Text[1]) in ['j'] then
  653.            begin
  654.             il.Visible:=false;
  655.             vocali.Visible:=false;
  656.             gngl.Visible:=false;
  657.             z.Visible:=false;
  658.             c.visible:=false;
  659.             j.Visible:=true;
  660.             consonanti.Visible:=false;
  661.            end
  662.           else
  663.            begin
  664.             if (combobox1.Text[1]) in ['z'] then
  665.              begin
  666.               il.Visible:=true;
  667.               lblil.Caption:='Z';
  668.               vocali.Visible:=false;
  669.               gngl.Visible:=false;
  670.               z.Visible:=true;
  671.               c.visible:=false;
  672.               j.Visible:=false;
  673.               consonanti.Visible:=true;
  674.              end
  675.             else
  676.              begin
  677.               if (combobox1.Text[1]) in ['l'] then
  678.                begin
  679.                 il.Visible:=true;
  680.                 vocali.Visible:=false;
  681.                 gngl.Visible:=false;
  682.                 z.Visible:=false;
  683.                 c.visible:=false;
  684.                 j.Visible:=false;
  685.                 lblil.caption:='L:';
  686.                 consonanti.Visible:=true;
  687.                end
  688.               else
  689.                begin
  690.                 if (combobox1.Text[1]) in ['i'] then
  691.                 begin
  692.                  il.Visible:=true;
  693.                  vocali.Visible:=true;
  694.                  gngl.Visible:=false;
  695.                  z.Visible:=false;
  696.                  c.visible:=false;
  697.                  j.Visible:=false;
  698.                  lblil.caption:='I:';
  699.                  consonanti.Visible:=false;
  700.                 end
  701.                 end
  702.               end;
  703.            end;
  704.          end;
  705.        end;
  706.      end;
  707.   end;
  708.   listbox1.ItemIndex:=0;
  709.  if listbox1.ItemIndex=0 then
  710.  button3.Enabled:=true
  711.  else
  712.  button3.Enabled:=false;
  713. end;
  714.  
  715. procedure Tfrmfonetica.RadioButton1Click(Sender: TObject);
  716. begin
  717.  if radiobutton18.checked=true then
  718.   begin
  719.    stringgrid2.cells[1,listbox2.itemindex]:='aperto-';
  720.    listbox2.ItemIndex:=listbox2.itemindex+1;
  721.    prossimo;
  722.   end;
  723. end;
  724.  
  725. procedure Tfrmfonetica.RadioButton2Click(Sender: TObject);
  726. begin
  727.  if radiobutton18.checked=true then
  728.   begin
  729.    stringgrid2.cells[1,listbox2.itemindex]:='chiuso-';
  730.      listbox2.ItemIndex:=listbox2.itemindex+1;
  731.      prossimo;
  732.   end;
  733. end;
  734.  
  735. procedure Tfrmfonetica.RadioButton3Click(Sender: TObject);
  736. begin
  737.  if radiobutton18.checked=true then
  738.   if radiobutton19.checked=true then
  739.    begin
  740.     stringgrid2.cells[1,listbox2.itemindex]:='doppia-dolce-';
  741.     listbox2.ItemIndex:=listbox2.itemindex+1;
  742.     prossimo;
  743.    end
  744.   else
  745.    if radiobutton20.checked=true then
  746.     begin
  747.      stringgrid2.cells[1,listbox2.itemindex]:='dolce-';
  748.      listbox2.ItemIndex:=listbox2.itemindex+1;
  749.      prossimo;
  750.     end
  751.    else
  752.     begin
  753.      showmessage('Prima selezionare se la lettera deve essere singola o doppia');
  754.      radiobutton3.checked:=false;
  755.     end;
  756. end;
  757.  
  758. procedure Tfrmfonetica.RadioButton4Click(Sender: TObject);
  759. begin
  760.  if radiobutton18.checked=true then
  761.   if radiobutton19.checked=true then
  762.    begin
  763.     stringgrid2.cells[1,listbox2.itemindex]:='doppia-dura-';
  764.     listbox2.ItemIndex:=listbox2.itemindex+1;
  765.     prossimo;
  766.    end
  767.   else
  768.    if radiobutton20.checked=true then
  769.     begin
  770.      stringgrid2.cells[1,listbox2.itemindex]:='dura-';
  771.      listbox2.ItemIndex:=listbox2.itemindex+1;
  772.      prossimo;
  773.     end
  774.    else
  775.     begin
  776.      showmessage('Prima selezionare se la lettera deve essere singola o doppia');
  777.      radiobutton4.checked:=false;
  778.     end;
  779. end;
  780.  
  781. procedure Tfrmfonetica.RadioButton9Click(Sender: TObject);
  782. begin
  783.  if radiobutton18.checked=true then
  784.   begin
  785.    stringgrid2.cells[1,listbox2.itemindex]:='dura-';
  786.    listbox2.ItemIndex:=listbox2.itemindex+1;
  787.    prossimo;
  788.   end;
  789. end;
  790.  
  791. procedure Tfrmfonetica.RadioButton10Click(Sender: TObject);
  792. begin
  793.  if radiobutton18.checked=true then
  794.   begin
  795.    stringgrid2.cells[1,listbox2.itemindex]:='l-';
  796.    listbox2.ItemIndex:=listbox2.itemindex+1;
  797.    prossimo;
  798.   end;
  799. end;
  800.  
  801. procedure Tfrmfonetica.RadioButton15Click(Sender: TObject);
  802. begin
  803.  if radiobutton18.checked=true then
  804.   begin
  805.    stringgrid2.cells[1,listbox2.itemindex]:='dura-';
  806.    listbox2.ItemIndex:=listbox2.itemindex+1;
  807.    prossimo;
  808.   end;
  809. end;
  810.  
  811. procedure Tfrmfonetica.RadioButton16Click(Sender: TObject);
  812. begin
  813.  if radiobutton18.checked=true then
  814.   begin
  815.    stringgrid2.cells[1,listbox2.itemindex]:='n-';
  816.    listbox2.ItemIndex:=listbox2.itemindex+1;
  817.    prossimo;
  818.   end;
  819. end;
  820.  
  821. procedure Tfrmfonetica.RadioButton7Click(Sender: TObject);
  822. begin
  823. if radiobutton18.checked=true then
  824.   if radiobutton19.checked=true then
  825.    begin
  826.     stringgrid2.cells[1,listbox2.itemindex]:='doppia-dolce-';
  827.     listbox2.ItemIndex:=listbox2.itemindex+1;
  828.     prossimo;
  829.    end
  830.   else
  831.    if radiobutton20.checked=true then
  832.     begin
  833.      stringgrid2.cells[1,listbox2.itemindex]:='dolce-';
  834.      listbox2.ItemIndex:=listbox2.itemindex+1;
  835.      prossimo;
  836.     end
  837.   else
  838.    begin
  839.     showmessage('Prima selezionare se la lettera deve essere singola o doppia');
  840.     radiobutton7.checked:=false;
  841.     end;
  842. end;
  843.  
  844. procedure Tfrmfonetica.RadioButton8Click(Sender: TObject);
  845. begin
  846.  if radiobutton18.checked=true then
  847.   if radiobutton19.checked=true then
  848.    begin
  849.     stringgrid2.cells[1,listbox2.itemindex]:='doppia-dura-';
  850.     listbox2.ItemIndex:=listbox2.itemindex+1;
  851.     prossimo;
  852.    end
  853.   else
  854.    if radiobutton20.checked=true then
  855.     begin
  856.      stringgrid2.cells[1,listbox2.itemindex]:='dura-';
  857.      listbox2.ItemIndex:=listbox2.itemindex+1;
  858.      prossimo;
  859.     end
  860.    else
  861.     begin
  862.      showmessage('Prima selezionare se la lettera deve essere singola o doppia');
  863.      radiobutton8.checked:=false;
  864.      end;
  865. end;
  866.  
  867. procedure Tfrmfonetica.RadioButton11Click(Sender: TObject);
  868. begin
  869.  if radiobutton18.checked=true then
  870.   begin
  871.    stringgrid2.cells[1,listbox2.itemindex]:='dolce-';
  872.    listbox2.ItemIndex:=listbox2.itemindex+1;
  873.    prossimo;
  874.   end;
  875. end;
  876.  
  877. procedure Tfrmfonetica.RadioButton12Click(Sender: TObject);
  878. begin
  879.  if radiobutton18.checked=true then
  880.   begin
  881.    stringgrid2.cells[1,listbox2.itemindex]:='l-';
  882.    listbox2.ItemIndex:=listbox2.itemindex+1;
  883.    prossimo;
  884.   end;
  885. end;
  886.  
  887. procedure Tfrmfonetica.RadioButton5Click(Sender: TObject);
  888. begin
  889.  if radiobutton18.checked=true then
  890.   begin
  891.    stringgrid2.cells[1,listbox2.itemindex]:='sorda-';
  892.    listbox2.ItemIndex:=listbox2.itemindex+1;
  893.    prossimo;
  894.   end;
  895. end;
  896.  
  897. procedure Tfrmfonetica.RadioButton6Click(Sender: TObject);
  898. begin
  899.  if radiobutton18.checked=true then
  900.   begin
  901.    stringgrid2.cells[1,listbox2.itemindex]:='sonora-';
  902.    listbox2.ItemIndex:=listbox2.itemindex+1;
  903.    prossimo;
  904.   end;
  905. end;
  906.  
  907. procedure Tfrmfonetica.Button4Click(Sender: TObject);
  908. var f:textfile;
  909.     i:integer;
  910.     n:string;
  911. begin
  912. if fileexists(edit1.Text+'.ssr') then
  913.  if messagedlg('Il file che si sta tentando di creare esiste già.. sovrascrivere?',mtconfirmation,[mbyes,mbno],0)=mrno then
  914.   begin
  915.   Showmessage('Il file non è stato sovrascritto, cambiare nome al file e riprovare')
  916.  ;exit
  917.   end;
  918.   //  else
  919.    ;n:='Verrà creato il file di che permetterà di riconoscere la parola'+#13+#10;
  920.    n:=n+uppercase(edit1.Text)+#13+#10;
  921.    n:=n+'continuare?';
  922.    if messagedlg(n,mtconfirmation,[mbyes,mbno],0)=mryes then
  923.     begin
  924.      assignfile(f,(*'insegnamenti\'+*)edit1.Text+'.ssr');
  925.      rewrite(f);
  926.      for i:=0 to stringgrid2.rowcount-1 do
  927.       writeln(f,stringgrid2.cells[1,i]);
  928.      closefile(f);
  929.      showmessage('L''operazione è stata completata con successo');
  930.     end
  931.    else
  932.     showmessage('L''operazione è stata interrotta, il file non è stato creato');
  933.  
  934.    
  935.    filelistbox1.Update
  936.   end;
  937.  
  938. procedure Tfrmfonetica.Button5Click(Sender: TObject);
  939. var n:string;
  940. begin
  941. n:='Si sta tentando di cancellare il file'+#13+#10;
  942. n:=n+'insegnamenti\'+uppercase(filelistbox1.items[filelistbox1.itemindex])+#13+#10;
  943. n:=n+ 'Confermare la rimozione?';
  944. if messagedlg(n, mtconfirmation,[mbyes,mbno],0)=mryes then
  945. begin
  946. deletefile((*'insegnamenti\'+*)filelistbox1.items[filelistbox1.itemindex]+'.ssr');
  947. deletefile((*'insegnamenti\'+*)filelistbox1.items[filelistbox1.itemindex]);
  948. showmessage('La rimozione del file è avvenuta con successo');
  949. end
  950. else
  951. showmessage('E'' stata interrotta l''operazione; Il file non è stato rimosso');
  952. filelistbox1.Update;
  953. end;
  954.  
  955. procedure Tfrmfonetica.Button6Click(Sender: TObject);
  956. var a,b,c:integer; f:textfile;   riga:string;
  957. begin
  958.  a:=length((filelistbox1.Items[filelistbox1.itemindex]));//carica il nome da modificare
  959.  b:=a-4;                //toglie l'estensione del file (che è compostra da 4 elementi
  960.  edit1.Text:=copy(filelistbox1.Items[filelistbox1.itemindex],1,b);
  961.  //visualizza le vecchie impostazioni
  962.  c:=-1;
  963.  assignfile(f,filelistbox1.Items[filelistbox1.itemindex]);
  964.  reset(f);
  965.  while not seekeof(f) do
  966.   begin
  967.    c:=c+1;
  968.    read(f,riga);
  969.    stringgrid2.Cells[1,c]:=(riga);
  970.   end;
  971.   listbox2.ItemIndex:=0;
  972.   prossimo;
  973.   //combobox1.ItemIndex:=combobox1.ItemIndex+1;
  974. end;
  975.  
  976. procedure Tfrmfonetica.FileListBox1Change(Sender: TObject);
  977. begin
  978.  if filelistbox1.itemindex<0 then
  979.   begin
  980.    button5.Enabled:=falsE;
  981.    button6.enabled:=false;
  982.   end
  983.  else
  984.   begin
  985.    button5.Enabled:=true;
  986.    button6.enabled:=true;
  987.   end;
  988.   label10.caption:='File esistenti: '+inttostr(filelistbox1.count);
  989. end;
  990. procedure Tfrmfonetica.FormActivate(Sender: TObject);
  991. begin
  992.  filelistbox1.Directory:='insegnamenti\';
  993. end;
  994.  
  995. procedure Tfrmfonetica.FormDeactivate(Sender: TObject);
  996. begin
  997.  filelistbox1.Directory:='..\';
  998. end;
  999.  
  1000. procedure Tfrmfonetica.RadioButton19Click(Sender: TObject);
  1001. begin
  1002.  if radiobutton18.checked=true then
  1003.   stringgrid2.cells[1,listbox2.itemindex]:='doppia-';
  1004.   radiobutton3.checked:=false;
  1005.   radiobutton4.checked:=falsE;
  1006.   groupbox7.visible:=false;
  1007. end;
  1008.  
  1009. procedure Tfrmfonetica.RadioButton20Click(Sender: TObject);
  1010. begin
  1011.  if radiobutton18.checked=true then
  1012.   stringgrid2.cells[1,listbox2.itemindex]:='#';
  1013.   radiobutton3.checked:=false;
  1014.   radiobutton4.checked:=falsE;
  1015.   groupbox7.visible:=true;
  1016. end;
  1017.  
  1018. procedure Tfrmfonetica.Edit1KeyPress(Sender: TObject; var Key: Char);
  1019. begin
  1020.  if ord(key) in [65..90] then
  1021.   key:=chr(ord(key)+32);
  1022.  
  1023.  if ord(key) in [97..122,8] then
  1024.   EXIT
  1025.  else
  1026.   key:=chr(0);
  1027. end;
  1028.  
  1029. procedure Tfrmfonetica.Button7Click(Sender: TObject);
  1030. begin
  1031.  frmhelp.memo1.lines.loadfromfile('../help/insegnamenti/step1.txt');
  1032.  frmhelp.showmodal;
  1033. end;
  1034.  
  1035. procedure Tfrmfonetica.Button2Click(Sender: TObject);
  1036. begin
  1037. stringgrid2.Cells[1,listbox2.itemindex]:='#';
  1038. end;
  1039.  
  1040. procedure Tfrmfonetica.Button8Click(Sender: TObject);
  1041. begin
  1042.  frmhelp.memo1.lines.loadfromfile('../help/insegnamenti/step2.txt');
  1043.  frmhelp.showmodal;
  1044. end;
  1045.  
  1046. end.