xref: /aoo42x/main/toolkit/doc/layout/metricfield.txt (revision cdf0e10c)
1*cdf0e10cSrcweir** MetricField:
2*cdf0e10cSrcweir    + in vcl:
3*cdf0e10cSrcweirclass VCL_DLLPUBLIC CurrencyField : public SpinField, public CurrencyFormatter
4*cdf0e10cSrcweirclass VCL_DLLPUBLIC CurrencyFormatter : public NumericFormatter
5*cdf0e10cSrcweirclass VCL_DLLPUBLIC MetricFormatter : public NumericFormatter
6*cdf0e10cSrcweirclass VCL_DLLPUBLIC NumericFormatter : public FormatterBase
7*cdf0e10cSrcweir
8*cdf0e10cSrcweirMetricFormatter - very simple sal_Int64 wrapping ...
9*cdf0e10cSrcweir    + no doubles ...
10*cdf0e10cSrcweir    + *Could* replicate this with the same interface:
11*cdf0e10cSrcweir	+ prolly easier / better to add an XMetricField interface.
12*cdf0e10cSrcweir
13*cdf0e10cSrcweirvcl's MetricField - itself does a load of (double) casting ...
14*cdf0e10cSrcweir    + to get the value it wants :-)
15*cdf0e10cSrcweir    + Urgh ! ...
16*cdf0e10cSrcweir
17*cdf0e10cSrcweir** Can we just twist VCLXCurrencyField to this purpose ?
18*cdf0e10cSrcweir    + what differences would we want ?
19*cdf0e10cSrcweir    + LongCurrencyFormatter -> 'MetricFormatter' ...
20*cdf0e10cSrcweir
21*cdf0e10cSrcweir** Interesting !
22*cdf0e10cSrcweir    + VCLXCurrencyField is based on 'LongCurrencyField' not CurrencyField ...
23*cdf0e10cSrcweir	+ this is really based on 'BigInt' [ curious ] - so even more precision loss.
24*cdf0e10cSrcweir
25*cdf0e10cSrcweir    + So ... cut/paste VCLXCurencyField -> VCLXMetricField
26*cdf0e10cSrcweir
27*cdf0e10cSrcweir	    + Look at 'VCLXNumericField' interface ...
28*cdf0e10cSrcweir		+ Use 'XNumericField' instead (?)
29*cdf0e10cSrcweir		    + why does this just not "just work" ?
30*cdf0e10cSrcweir
31*cdf0e10cSrcweir    + The 'MetricField' (is also a MetricFormatter)
32*cdf0e10cSrcweir	+ MetricFormatter [ unusually ] has 'Unit' support
33*cdf0e10cSrcweir	    + API grep shows:
34*cdf0e10cSrcweir		+ a) requires 'fieldunit'
35*cdf0e10cSrcweir		+ b) has "UserValue"
36*cdf0e10cSrcweir		+ c) => new IDL interface required ...
37*cdf0e10cSrcweir		+ sub-set / expand NumericField ?
38*cdf0e10cSrcweir
39*cdf0e10cSrcweir	    + add 'CustomConvert' ?
40*cdf0e10cSrcweir	    + add '[SG]etFirst'/Last
41*cdf0e10cSrcweir	    + Properties:
42*cdf0e10cSrcweir	        + 'Unit'
43*cdf0e10cSrcweir		+ 'CustomUnitText'
44*cdf0e10cSrcweir	    + 'spin-size' -> 'value-step'
45*cdf0e10cSrcweir	    + 'BaseValue' ...
46*cdf0e10cSrcweir	    + sal_Int64 ... [!?] ...
47*cdf0e10cSrcweir	    + CorrectedValue
48*cdf0e10cSrcweir	    + Want properties for the UI designer (?)
49*cdf0e10cSrcweir		+ move that stuff out into there ?
50*cdf0e10cSrcweir    + FIXME:
51*cdf0e10cSrcweir	+ rationalise the 'Modify' event crud ...
52*cdf0e10cSrcweir	    + share the code in a base-class ...
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir    + Wrapper:
55*cdf0e10cSrcweir        + need to have static methods 'ConvertDoubleValue' etc.
56*cdf0e10cSrcweir	+ also 'ConvertValue' etc.
57*cdf0e10cSrcweir	+ GetCorrectedValue - never used ...
58