[Gotisso-commit] SF.net SVN: gotisso:[22] trunk
Status: Inactive
Brought to you by:
jmvaz
From: <jm...@us...> - 2010-08-23 03:55:31
|
Revision: 22 http://gotisso.svn.sourceforge.net/gotisso/?rev=22&view=rev Author: jmvaz Date: 2010-08-23 03:55:24 +0000 (Mon, 23 Aug 2010) Log Message: ----------- the menu grid is Date ordered and minor changes Modified Paths: -------------- trunk/gotisso.lpr trunk/u_main.lfm trunk/u_main.pas trunk/u_meal.lfm trunk/u_meal.pas Modified: trunk/gotisso.lpr =================================================================== --- trunk/gotisso.lpr 2010-08-23 02:22:51 UTC (rev 21) +++ trunk/gotisso.lpr 2010-08-23 03:55:24 UTC (rev 22) @@ -32,8 +32,6 @@ { you can add units after this }, Printer4Lazarus, u_main, u_meal, u_ingredients, u_classes, u_consts; -//{$IFDEF WINDOWS}{$R gotisso.rc}{$ENDIF} - {$R *.res} begin Modified: trunk/u_main.lfm =================================================================== --- trunk/u_main.lfm 2010-08-23 02:22:51 UTC (rev 21) +++ trunk/u_main.lfm 2010-08-23 03:55:24 UTC (rev 22) @@ -34,7 +34,12 @@ TabOrder = 0 TitleStyle = tsStandard OnClick = sgMenuClick + OnCompareCells = sgMenuCompareCells OnDblClick = sgMenuDblClick + ColWidths = ( + 136 + 247 + ) end object btNew: TButton Left = 686 Modified: trunk/u_main.pas =================================================================== --- trunk/u_main.pas 2010-08-23 02:22:51 UTC (rev 21) +++ trunk/u_main.pas 2010-08-23 03:55:24 UTC (rev 22) @@ -56,6 +56,8 @@ procedure FormDestroy(Sender: TObject); procedure FormShow(Sender: TObject); procedure sgMenuClick(Sender: TObject); + procedure sgMenuCompareCells(Sender: TObject; ACol, ARow, BCol, + BRow: Integer; var Result: integer); procedure sgMenuDblClick(Sender: TObject); private { private declarations } @@ -118,6 +120,12 @@ UpdateMenu; end; +procedure TfmMain.sgMenuCompareCells(Sender: TObject; ACol, ARow, BCol, + BRow: Integer; var Result: integer); +begin + Result:= Trunc(StrToDate(sgMenu.Cells[0,ARow]) - StrToDate(sgMenu.Cells[0,BRow])); +end; + procedure TfmMain.sgMenuDblClick(Sender: TObject); begin if btEdit.Enabled then @@ -148,6 +156,7 @@ sgMenu.Cells[0,i]:= DateToStr(MenuPlan.Meal[i-1].Date); sgMenu.Cells[1,i]:= MenuPlan.Meal[i-1].Dishes.AllDishes.Text; end; + sgMenu.SortColRow(True, 0); UpdateMenu; end; Modified: trunk/u_meal.lfm =================================================================== --- trunk/u_meal.lfm 2010-08-23 02:22:51 UTC (rev 21) +++ trunk/u_meal.lfm 2010-08-23 03:55:24 UTC (rev 22) @@ -6,6 +6,7 @@ Caption = 'Meal' ClientHeight = 333 ClientWidth = 561 + OnClose = FormClose OnCreate = FormCreate OnShow = FormShow LCLVersion = '0.9.29' @@ -209,6 +210,7 @@ Width = 75 Cancel = True Caption = 'Close' + ModalResult = 2 TabOrder = 3 end object acActions: TActionList Modified: trunk/u_meal.pas =================================================================== --- trunk/u_meal.pas 2010-08-23 02:22:51 UTC (rev 21) +++ trunk/u_meal.pas 2010-08-23 03:55:24 UTC (rev 22) @@ -66,6 +66,7 @@ procedure btRemoveClick(Sender: TObject); procedure btUpClick(Sender: TObject); procedure cbTypeChange(Sender: TObject); + procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormCreate(Sender: TObject); procedure FormShow(Sender: TObject); procedure lbMealClick(Sender: TObject); @@ -110,6 +111,11 @@ cbDish.ItemIndex:= 0; end; +procedure TfmMeal.FormClose(Sender: TObject; var CloseAction: TCloseAction); +begin + lbMeal.Clear; +end; + procedure TfmMeal.acAddExecute(Sender: TObject); begin if not Add then @@ -118,15 +124,12 @@ procedure TfmMeal.acCloseExecute(Sender: TObject); begin -// close the form, after clearing the meal listbox - lbMeal.Clear; Close; end; procedure TfmMeal.acOKExecute(Sender: TObject); begin ModalResult:= mrOK; - acCloseExecute(Sender); end; procedure TfmMeal.acAddAndCloseExecute(Sender: TObject); @@ -258,12 +261,8 @@ //TODO: it's not editing!!! if ShowModal = mrOK then begin - for i:= 0 to (lbMeal.Count-1) do - begin - AMeal.AddDish(Dishes.DishByName(lbMeal.Items.Strings[i])); - end; - AMeal.Date:= deDate.Date; - MenuPlan.Meal[MealIndex]:= AMeal; + MenuPlan.RemoveMeal(MealIndex); + Add; end; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |