diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-06-28 22:22:32 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-06-28 22:22:32 +0100 |
commit | c0c336500955a23e344651e5412c9d9d441ef4ee (patch) | |
tree | 790769c748db307cf3314f6e896e2f61c68561a2 /src/T2DLL/T2DlgItemCustomerGage.cpp | |
parent | 37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff) | |
download | t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip |
first pass of T2DLL
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2DlgItemCustomerGage.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/T2DLL/T2DlgItemCustomerGage.cpp b/src/T2DLL/T2DlgItemCustomerGage.cpp index 42cd0a7..1a829cc 100644 --- a/src/T2DLL/T2DlgItemCustomerGage.cpp +++ b/src/T2DLL/T2DlgItemCustomerGage.cpp @@ -1,28 +1,47 @@ #include "T2DlgItemCustomerGage.h" +#include "T2Tenant.h" -T2DlgItemCustomerGage::T2DlgItemCustomerGage(T2TowerDoc*, T2ImageObj*, CPalette*) { +T2DlgItemCustomerGage::T2DlgItemCustomerGage(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* palette) + : T2DlgItemGageBase(towerDoc, imageObj, palette) + , mTenant(NULL) +{ } /*virtual*/ int T2DlgItemCustomerGage::GetMinValue() { + return 1; } /*virtual*/ int T2DlgItemCustomerGage::GetMaxValue() { + return 300; } /*virtual*/ int T2DlgItemCustomerGage::GetValue() { + int value = GetMinValue(); + if (mTenant) { + mTenant->UpdateResidencialEstimate(mTowerDoc); + value = mTenant->GetEstimate(); + } + return value; } /*virtual*/ int T2DlgItemCustomerGage::GetBlueValue() { + return 200; } /*virtual*/ int T2DlgItemCustomerGage::GetYellowValue() { + return 70; } -/*virtual*/ unsigned long T2DlgItemCustomerGage::GetGageColor(int) { +/*virtual*/ COLORREF T2DlgItemCustomerGage::GetGageColor(int value) { + return (value <= GetYellowValue()) ? PALETTERGB(255, 0, 0) : + (value <= GetBlueValue()) ? PALETTERGB(255, 255, 0) : + PALETTERGB(0, 0, 255); } -void T2DlgItemCustomerGage::SetTenant(T2Tenant*) { +void T2DlgItemCustomerGage::SetTenant(T2Tenant* tenant) { + mTenant = tenant; } -/*virtual*/ int T2DlgItemCustomerGage::IsDrawInterior() { +/*virtual*/ BOOL T2DlgItemCustomerGage::IsDrawInterior() { + return (mTenant != NULL); } |