[Gotisso-commit] SF.net SVN: gotisso:[14] trunk/u_meal.pas
Status: Inactive
Brought to you by:
jmvaz
|
From: <jm...@us...> - 2009-12-07 14:21:26
|
Revision: 14
http://gotisso.svn.sourceforge.net/gotisso/?rev=14&view=rev
Author: jmvaz
Date: 2009-12-07 14:21:18 +0000 (Mon, 07 Dec 2009)
Log Message:
-----------
added some comments
Modified Paths:
--------------
trunk/u_meal.pas
Modified: trunk/u_meal.pas
===================================================================
--- trunk/u_meal.pas 2009-12-06 01:51:56 UTC (rev 13)
+++ trunk/u_meal.pas 2009-12-07 14:21:18 UTC (rev 14)
@@ -109,13 +109,17 @@
if not Add then
ShowMessage(sError)
else
- Close;
+ begin
+ lbMeal.Clear;
+ Close;
+ end;
end;
procedure TfmMeal.btDownClick(Sender: TObject);
var
i: Integer;
begin
+// moving down the selected rows, mantaining then selected
for i:= (lbMeal.Count-2) downto 0 do
if lbMeal.Selected[i] then
begin
@@ -128,18 +132,21 @@
procedure TfmMeal.btCloseClick(Sender: TObject);
begin
+// close the form, after clearing the meal listbox
lbMeal.Clear;
Close;
end;
procedure TfmMeal.btAddDishClick(Sender: TObject);
begin
+// add choosed dish to the meal listbox
lbMeal.Items.Add(cbDish.Items.Strings[cbDish.ItemIndex]);
UpdateMeal;
end;
procedure TfmMeal.btClearClick(Sender: TObject);
begin
+// clear the meal listbox
lbMeal.Clear;
UpdateMeal;
end;
@@ -148,6 +155,7 @@
var
i: Integer;
begin
+//removing the selected rows
for i:= (lbMeal.Count-1) downto 0 do
if lbMeal.Selected[i] then
lbMeal.Items.Delete(i);
@@ -158,6 +166,7 @@
var
i: Integer;
begin
+// moving up the selected rows, mantaining then selected
for i:= 1 to (lbMeal.Count-1) do
if lbMeal.Selected[i] then
begin
@@ -173,8 +182,10 @@
UpdateMeal;
end;
+
procedure TfmMeal.UpdateMeal;
begin
+// enable or disable the buttons depending on the dish count or dish selected position
btUp.Enabled:= ((lbMeal.SelCount > 0) and (not lbMeal.Selected[0]));
btDown.Enabled:= ((lbMeal.SelCount > 0) and (not lbMeal.Selected[lbMeal.Count-1]));
btRemove.Enabled:= (lbMeal.SelCount > 0);
@@ -188,6 +199,7 @@
Meal: TMeal;
i: Integer;
begin
+// add the meal to the menu object
Result:= False;
Meal:= TMeal.Create;
try
@@ -197,7 +209,7 @@
end;
Meal.Date:= deDate.Date;
- //TODO: falta adicionar ao cardápio
+ //TODO: add to menu object
lbMeal.Clear;
UpdateMeal;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|