rainmeter-studio/Library/MeasureScript.h
spx 235841e01f Added AutoScale=2 and "k" postfix to Meter=STRING.
----
For instance:
A=2800000000, B=0

- AutoScale=0
AutoScale is disabled. Uses Scale value. (Same as before.)
A="2800000000", B="0"

- AutoScale=1
Scales value by 1024. (Same as before.)
A="2.6 G", B="0.0 "

- AutoScale=2
Scales value by 1000.
A="2.8 G", B="0.0 "

- AutoScale=1k
Scales value by 1024, and uses kilo as the lowest unit.
A="2.6 G", B="0.0 k"

- AutoScale=2k
Scales value by 1000, and uses kilo as the lowest unit.
A="2.8 G", B="0.0 k"
----
2011-01-19 15:31:45 +00:00

55 lines
1.1 KiB
C++

#ifndef MEASURESCRIPT_H
#define MEASURESCRIPT_H
#include "Measure.h"
#include "lua/LuaScript.h"
#include "MeterWindow.h"
class CMeasureScript : public CMeasure
{
public:
CMeasureScript(CMeterWindow* meterWindow);
virtual ~CMeasureScript();
void ReadConfig(CConfigParser& parser, const WCHAR* section);
void Initialize();
bool Update();
double GetValue();
void SetValue(double d);
virtual const WCHAR* GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual);
void MeterMouseEvent(CMeter* p_pMeter, MOUSE p_eMouse);
void RunFunctionWithMeter(const char* p_strFunction, CMeter* p_pMeter);
protected:
LuaScript* m_pLuaScript;
bool m_bUpdateDefined;
bool m_bGetValueDefined;
bool m_bGetStringValueDefined;
bool m_bInitializeDefined;
std::wstring m_strValue;
std::wstring m_ScriptTableName;
/*
Sqrat::Table* m_ScriptTable;
Sqrat::Function* m_UpdateFunc;
Sqrat::Function* m_GetValueFunc;
Sqrat::Function* m_GetStringValueFunc;
Sqrat::Function* m_InitFunc;
Sqrat::Function* m_UpdateTransitionFunc;
*/
};
#endif