Mercurial > projects > mde
comparison mde/gui/content/options.d @ 91:4d5d53e4f881
Shared alignment for dynamic content lists - finally implemented! Lots of smaller changes too.
Some debugging improvements.
When multiple .mtt files are read for merging, files with invalid headers are ignored and no error is thrown so long as at least one file os valid.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Thu, 16 Oct 2008 17:43:48 +0100 |
parents | 61ea26abe4dd |
children | 9520cc0448e5 |
comparison
equal
deleted
inserted
replaced
90:b525ff28774b | 91:4d5d53e4f881 |
---|---|
51 | 51 |
52 protected: | 52 protected: |
53 ContentOption[] textOpts; | 53 ContentOption[] textOpts; |
54 } | 54 } |
55 | 55 |
56 //FIXME - todo.txt | |
56 class ContentOptionText : ContentOption | 57 class ContentOptionText : ContentOption |
57 { | 58 { |
58 this (Options o, char[] s, char[] name, char[] desc) { | 59 this (Options o, char[] s, char[] name, char[] desc) { |
59 opts = o; | 60 opts = o; |
60 symb = s; | 61 symb = s; |
61 name_ = name; | 62 name_ = name; |
62 desc_ = desc; | 63 desc_ = desc; |
63 } | 64 } |
64 | 65 |
65 char[] toString () { | 66 char[] toString (uint i) { |
67 if (i == 0) | |
68 return opts.get!(char[])(symb); | |
69 else if (i == 1) | |
70 return name_; | |
71 else if (i == 2) | |
72 return desc_; | |
73 } | |
74 /+char[] value () { | |
66 return opts.get!(char[])(symb); | 75 return opts.get!(char[])(symb); |
67 } | 76 } |
68 void value (char[] v) { | 77 void value (char[] v) { |
69 opts.set!(char[])(symb, v); | 78 opts.set!(char[])(symb, v); |
70 } | 79 }+/ |
71 } | 80 } |
72 | 81 |
73 abstract class ContentOption : IContent | 82 abstract class ContentOption : IContent |
74 { | 83 { |
75 abstract char[] toString (); | |
76 | |
77 //char[] value (); /// Get/set the value. | |
78 void value (char[] v); /// ditto | |
79 | |
80 // Get the symbol name (useful?) | 84 // Get the symbol name (useful?) |
81 | 85 /+ |
82 /// Get the translated name | 86 /// Get the translated name |
83 char[] name () { | 87 char[] name () { |
84 return name_; | 88 return name_; |
85 } | 89 } |
86 | 90 |
87 /// Get the description (translated) | 91 /// Get the description (translated) |
88 char[] description () { | 92 char[] description () { |
89 return desc_; | 93 return desc_; |
90 } | 94 } |
91 | 95 +/ |
92 protected: | 96 protected: |
93 Options opts; // the set of options within which our option lies | 97 Options opts; // the set of options within which our option lies |
94 char[] symb; // the symbol name of our option | 98 char[] symb; // the symbol name of our option |
95 char[] name_, desc_;// name and description, loaded by lookup.Translation | 99 char[] name_, desc_;// name and description, loaded by lookup.Translation |
96 } | 100 } |