comparison mde/content/Content.d @ 170:e45226d3deae

Context menu services not applicable to the current type can now be hidden. Added files missing from previous commits.
author Diggory Hardy <diggory.hardy@gmail.com>
date Mon, 29 Jun 2009 21:20:16 +0200
parents da8d3091fdaf
children 1f9d00f392bd
comparison
equal deleted inserted replaced
169:bc1cf73dc835 170:e45226d3deae
105 desc_ = e.desc; 105 desc_ = e.desc;
106 } 106 }
107 107
108 /** Add a callback. Callbacks are called on a change or event, in the order 108 /** Add a callback. Callbacks are called on a change or event, in the order
109 * added. */ 109 * added. */
110 Content addCallback (void delegate (Content) cb) { 110 override IContent addCallback (void delegate (IContent) cb) {
111 this.cb ~= cb; 111 this.cb ~= cb;
112 return this; 112 return this;
113 } 113 }
114 /// ditto 114 /// ditto
115 Content addCallback (void function (Content) cb) { 115 override IContent addCallback (void function (IContent) cb) {
116 this.cb ~= util.toDg (cb); 116 this.cb ~= util.toDg (cb);
117 return this; 117 return this;
118 } 118 }
119 119
120 /** End of an event, e.g. a button release or end of an edit (calls callbacks). 120 /** End of an event, e.g. a button release or end of an edit (calls callbacks).
146 override void opAssign (char[]) {} 146 override void opAssign (char[]) {}
147 147
148 protected: 148 protected:
149 char[] symbol; 149 char[] symbol;
150 char[] name_, desc_; // translated name and description 150 char[] name_, desc_; // translated name and description
151 void delegate (Content) cb[]; 151 void delegate (IContent) cb[];
152 152
153 public static: 153 public static:
154 /** Get Content with _symbol name symbol from the list of all content, or 154 /** Get Content with _symbol name symbol from the list of all content, or
155 * null if no such Content exists. */ 155 * null if no such Content exists. */
156 Content get (char[] symbol) { 156 Content get (char[] symbol) {