Changeset 311 for cpp/frams/_demos/loader_test_param.cpp
- Timestamp:
- 01/26/15 07:31:30 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/loader_test_param.cpp
r308 r311 21 21 { 22 22 public: 23 SString text, longtext ;23 SString text, longtext, deftext; 24 24 int i1, i2, i3; 25 25 float f1, f2, f3; 26 26 ExtValue x; 27 int notchanged,notloaded,notsaved; 27 28 }; 28 29 … … 30 31 ParamEntry data_paramtab[] = 31 32 { 32 { "Data", 1, 8, "data", },33 { "Data", 1, 12, "data", }, 33 34 { "text", 0, 0, "Text", "s 0 10", FIELD(text), }, // 10 = length limit 34 35 { "longtext", 0, 0, "Long text", "s 1", FIELD(longtext), }, // 1 = multiline, 0 = unlimited 36 { "deftext", 0, 0, "Text with default value", "s 0 0 some text", FIELD(deftext), }, 35 37 { "i1", 0, 0, "Integer 1", "d", FIELD(i1), }, // unrestricted integer 36 38 { "i2", 0, 0, "Integer 2", "d -5 5 1", FIELD(i2), }, // [-5..5] integer, default=1 37 { "i3", 0, 0, "Integer 3", "d 0 3 0~Zero~One~Two~Three", FIELD(i3), }, // [0..3] + text labels (Param::getText())39 { "i3", 0, 0, "Integer 3", "d -1 3 0 ~Minus~Zero~One~Two~Three", FIELD(i3), }, // [0..3] + text labels (Param::getText()) 38 40 { "f1", 0, 0, "Float 1", "d", FIELD(f1), }, // unrestricted float 39 41 { "f2", 0, 0, "Float 2", "f -100 100 -100", FIELD(f2), }, // [-100..100] float, default=-100 40 42 { "x", 0, 0, "Untyped", "x", FIELD(x), }, // any type (class ExtValue) 43 { "notchanged", 0, PARAM_READONLY, "Read only field", "d", FIELD(notchanged), }, // neither load() nor setDefault() can change this 44 { "notloaded", 0, PARAM_DONTLOAD, "Unloadable field", "d", FIELD(notloaded), }, // load() does not change this 45 { "notsaved", 0, PARAM_DONTSAVE, "Unsaveable field", "d", FIELD(notsaved), }, // save() skips this field 41 46 { 0, 0, 0, }, 42 47 }; … … 59 64 Data data; 60 65 Param param(data_paramtab, &data); 66 67 data.notchanged=100; 68 data.notloaded=200; 61 69 62 70 loader.addObject(¶m); … … 82 90 case MultiParamLoader::BeforeObject: 83 91 fprintf(stderr, "----- object found, loading...\n"); 92 data.notchanged++; 84 93 param.setDefault(); //reset (initialize) struct contents 85 94 break;
Note: See TracChangeset
for help on using the changeset viewer.