summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2DlgItemBelongGage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/T2DLL/T2DlgItemBelongGage.cpp')
-rw-r--r--src/T2DLL/T2DlgItemBelongGage.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/T2DLL/T2DlgItemBelongGage.cpp b/src/T2DLL/T2DlgItemBelongGage.cpp
index 7553062..81dcec7 100644
--- a/src/T2DLL/T2DlgItemBelongGage.cpp
+++ b/src/T2DLL/T2DlgItemBelongGage.cpp
@@ -1,28 +1,47 @@
#include "T2DlgItemBelongGage.h"
+#include "T2Tenant.h"
-T2DlgItemBelongGage::T2DlgItemBelongGage(T2TowerDoc*, T2ImageObj*, CPalette*) {
+T2DlgItemBelongGage::T2DlgItemBelongGage(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* palette)
+ : T2DlgItemGageBase(towerDoc, imageObj, palette)
+ , mTenant(NULL)
+{
}
/*virtual*/ int T2DlgItemBelongGage::GetMinValue() {
+ return 1;
}
/*virtual*/ int T2DlgItemBelongGage::GetMaxValue() {
+ return 300;
}
/*virtual*/ int T2DlgItemBelongGage::GetValue() {
+ int value = GetMinValue();
+ if (mTenant) {
+ mTenant->UpdateResidencialEstimate(mTowerDoc);
+ value = mTenant->GetEstimate();
+ }
+ return value;
}
/*virtual*/ int T2DlgItemBelongGage::GetBlueValue() {
+ return 200;
}
/*virtual*/ int T2DlgItemBelongGage::GetYellowValue() {
+ return 70;
}
-/*virtual*/ unsigned long T2DlgItemBelongGage::GetGageColor(int) {
+/*virtual*/ COLORREF T2DlgItemBelongGage::GetGageColor(int value) {
+ return (value <= GetYellowValue()) ? PALETTERGB(255, 0, 0) :
+ (value <= GetBlueValue()) ? PALETTERGB(255, 255, 0) :
+ PALETTERGB(0, 0, 255);
}
-void T2DlgItemBelongGage::SetTenant(T2Tenant*) {
+void T2DlgItemBelongGage::SetTenant(T2Tenant* tenant) {
+ mTenant = tenant;
}
-/*virtual*/ int T2DlgItemBelongGage::IsDrawInterior() {
+/*virtual*/ BOOL T2DlgItemBelongGage::IsDrawInterior() {
+ return (mTenant != NULL);
}