[Igarden-commit] Garden/source/Reports PurchaseReport.h, 1.1.2.3, 1.1.2.4 PurchaseReport.cpp, 1.1.2
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2006-12-26 15:45:38
|
Update of /cvsroot/igarden/Garden/source/Reports In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22899 Modified Files: Tag: Release_branch_v1 PurchaseReport.h PurchaseReport.cpp Log Message: Add "Include Annuals to Repurchase" checkbox for shopping list Index: PurchaseReport.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/Reports/Attic/PurchaseReport.cpp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** PurchaseReport.cpp 19 Dec 2006 12:49:57 -0000 1.1.2.4 --- PurchaseReport.cpp 26 Dec 2006 15:45:36 -0000 1.1.2.5 *************** *** 44,47 **** --- 44,48 ---- #include "Path.h" #include "DocumentTags.h" + #include "SourceQuery.h" #include <XGCheckButton.h> #include <XGPopControl.h> *************** *** 57,60 **** --- 58,62 ---- const short kFormat = 13; const short kIncludeMulch = 14; + const short kIncludeAllAnnuals = 15; using yaaf::XGCheckButton; *************** *** 104,107 **** --- 106,110 ---- _showPictures = false; _includeMulch = false; + _includeAllAnnuals = false; } *************** *** 205,208 **** --- 208,214 ---- check = dynamic_cast<XGCheckButton*>(dlog->FindViewByID(kIncludeMulch)); check->SetValue(_includeMulch ? 1 : 0); + + check = dynamic_cast<XGCheckButton*>(dlog->FindViewByID(kIncludeAllAnnuals)); + check->SetValue(_includeAllAnnuals ? 1 : 0); } *************** *** 229,232 **** --- 235,244 ---- EnableFindButton(AllowPrint(), dlog); break; + case kIncludeAllAnnuals: + check = dynamic_cast<XGCheckButton*>(dlog->FindViewByID(kIncludeAllAnnuals)); + _includeAllAnnuals = !check->GetValue(); + check->SetValue(_includeAllAnnuals); + EnableFindButton(AllowPrint(), dlog); + break; } } *************** *** 361,365 **** if(!instance->GetInt32(kNumPurchased, &numPurchased)) numPurchased = 0; ! numUnpurchased = ref->GetNumItems() - numPurchased; if(numUnpurchased > 0) { --- 373,381 ---- if(!instance->GetInt32(kNumPurchased, &numPurchased)) numPurchased = 0; ! ! if(_includeAllAnnuals && (mat->GetMaterialType() == kMaterialTypeAnnual)) ! numUnpurchased = ref->GetNumItems(); ! else ! numUnpurchased = ref->GetNumItems() - numPurchased; if(numUnpurchased > 0) { *************** *** 446,449 **** --- 462,466 ---- PathElement *elem; bool show, matchPlot, matchSupplier; + SourceQuery query(SourceMaterialFile::GetSourceDatabase()); format = _templates[_currentItem]; *************** *** 554,560 **** numPurchased = 0; ! mat->GetPictureRelativePath(picturePath); ! numUnpurchased = ref->GetNumItems() - numPurchased; if(numUnpurchased > 0) { --- 571,587 ---- numPurchased = 0; ! if(format.hasPicture) ! { ! String fullName; ! fullName = mat->GetFullCanonicalName(); ! query.FindPictures(fullName, kOnePicture); ! } ! mat->GetPictureRelativePath(picturePath); ! ! if(_includeAllAnnuals && (mat->GetMaterialType() == kMaterialTypeAnnual)) ! numUnpurchased = ref->GetNumItems(); ! else ! numUnpurchased = ref->GetNumItems() - numPurchased; if(numUnpurchased > 0) { *************** *** 615,619 **** { siftedList[data] = data; - // printf("Setting value for '%s' to %ld\n", namePtr, data.count); } else --- 642,645 ---- *************** *** 632,635 **** --- 658,662 ---- siftedList_t::iterator iter; + for(iter = siftedList.begin(); iter != siftedList.end(); iter++) { Index: PurchaseReport.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/Reports/Attic/PurchaseReport.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** PurchaseReport.h 19 Dec 2006 12:49:57 -0000 1.1.2.3 --- PurchaseReport.h 26 Dec 2006 15:45:36 -0000 1.1.2.4 *************** *** 77,80 **** --- 77,81 ---- bool _showPictures; bool _includeMulch; + bool _includeAllAnnuals; // Including living ones, for purchase next year long _currentItem; XGSDynArray<ShopTemplate_t> _templates; |