)
# pragma resource "*. dfm "* Params;
// ---------- -------------------------------------------------- ---------------
__fastcall TParams :: TParams (TComponent * Owner)
: TForm (Owner)
{
}
// ---------------------------------------- ----------------------------------- __fastcall TParams :: FormActivate (TObject * Sender)
{-> Caption = "Кількість осередків для кульок (" + IntToStr (Form1-> UpDown1-> Min) + "-" + IntToStr (Form1-> UpDown1 -> Max) + "):
}
// ---------------------------------------- ----------------------------------- __fastcall TParams :: Button2Click (TObject * Sender)
{();
}
// ---------------------------------------- ----------------------------------- __fastcall TParams :: Edit1KeyPress (TObject * Sender, char & Key)
{((Key> = '0 ') && (Key <= '9') | | (Key == VK_BACK)) return; (Key == VK_RETURN) Edit2- > SetFocus (); Key = 0;
}
// ---------------------------------------- ----------------------------------- __fastcall TParams :: Edit2KeyPress (TObject * Sender, char & Key)
{((Key> = '0 ') && (Key <= '9') | | (Key == VK_BACK)) return; (Key == VK_RETURN) Button1- > SetFocus (); Key = 0;
}
// ---------------------------------------- ----------------------------------- __fastcall TParams :: Button1Click (TObject * Sender)
{kol; (StrToInt (Edit1-> Text) UpDown1-> Min)
{("Число вічок не менше" + IntToStr (Form1-> UpDown1-> Min) + "!"); -> SetFocus ();;
} (StrToInt (Edit1-> Text)> Form1-> UpDown1-> Max)
{-> Text = IntToStr (Form1-> UpDown1-> Max); ("Число осередків не більше" + IntToStr (Form1-> UpDown1-> Max) + "!"); -> SetFocus ();;
} = StrToInt (Edit1-> Text); -> UpDown1-> Position = kol; (Form1-> UpDown2-> Position> kol * kol)
{-> UpDown2-> Position = kol * kol; -> Edit2-> Text = IntToStr (kol * kol);
} -> UpDown2-> Max = kol * kol; -> Edit1-> Text = Edit1-> Text; (StrToInt (Edit2-> Text) UpDown2-> Min)
{("Число кульок не менш" + IntToStr (Form1-> UpDown2-> Min) + "!"); -> SetFocus ();;
} (StrToInt (Edit2-> Text)> Form1-> UpDown2-> Max)
{("При такому колічесвтом осередків число кульок не більше" + IntToStr (Form1-> UpDown2-> Max) + "!"); -> SetFocus (); ;
} -> UpDown2-> Position = StrToInt
}