Rev 325 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 325 | Rev 390 | ||
---|---|---|---|
Line 111... | Line 111... | ||
111 | 111 | ||
112 | for (int i=0;i<tab_entrys_count[act_tab];i++) |
112 | for (int i=0;i<tab_entrys_count[act_tab];i++) |
113 | { |
113 | { |
114 | lcd_lines[1+2*i]=tab_entrys[act_tab][i]; |
114 | lcd_lines[1+2*i]=tab_entrys[act_tab][i]; |
115 | if (tab_entry_types[act_tab][i]== PARAMTYPE_BOOLEAN) |
115 | if (tab_entry_types[act_tab][i]== PARAMTYPE_BOOLEAN) |
116 | lcd_lines[2+2*i]=(((canvas.mk.params.field_from_act(tab_entry_src[act_tab][i][0])&(1<<tab_entry_src[act_tab][i][1]))==0)?"off":"on" ) ; |
116 | lcd_lines[2+2*i]=(((canvas.mk.params.get_field_from_act(tab_entry_src[act_tab][i][0])&(1<<tab_entry_src[act_tab][i][1]))==0)?"off":"on" ) ; |
117 | if (tab_entry_types[act_tab][i]== PARAMTYPE_BYTE) |
117 | if (tab_entry_types[act_tab][i]== PARAMTYPE_BYTE) |
Line 118... | Line 118... | ||
118 | lcd_lines[2+2*i]=""+canvas.mk.params.field_from_act(tab_entry_src[act_tab][i][0]); |
118 | lcd_lines[2+2*i]=""+canvas.mk.params.get_field_from_act(tab_entry_src[act_tab][i][0]); |
Line 119... | Line 119... | ||
119 | 119 | ||
120 | } |
120 | } |
Line 141... | Line 141... | ||
141 | canvas.lcd_lines[0]="reading params"; |
141 | canvas.lcd_lines[0]="reading params"; |
142 | } |
142 | } |
Line 143... | Line 143... | ||
143 | 143 | ||
Line -... | Line 144... | ||
- | 144 | } |
|
- | 145 | ||
- | 146 | ||
144 | } |
147 | public final static int KEYCODE_CLEAR=-8; |
145 | 148 | ||
146 | public void keypress (int keyCode,int action) |
149 | public void keypress (int keyCode,int action) |
147 | { |
150 | { |
148 | if (act_y==0) switch (action) |
151 | if (act_y==0) switch (action) |
Line 154... | Line 157... | ||
154 | case Canvas.LEFT: |
157 | case Canvas.LEFT: |
155 | if (act_tab!=0) act_tab--; |
158 | if (act_tab!=0) act_tab--; |
156 | break; |
159 | break; |
157 | } |
160 | } |
158 | else |
161 | else |
159 | switch (action) |
- | |
160 | { |
162 | { |
161 | case Canvas.RIGHT: |
- | |
162 | switch(tab_entry_types[act_tab][act_y/2-1]) |
163 | if(tab_entry_types[act_tab][act_y/2-1]==PARAMTYPE_BYTE) |
163 | { |
164 | { |
164 | case PARAMTYPE_BOOLEAN: |
165 | if ((keyCode >= Canvas.KEY_NUM0) && (keyCode <= Canvas.KEY_NUM9)) |
165 | 166 | { |
|
166 | canvas.mk.params.field_from_act_xor(tab_entry_src[act_tab][act_y/2-1][0],1<<tab_entry_src[act_tab][act_y/2-1][1]); |
167 | if( Math.abs(canvas.mk.params.get_field_from_act(tab_entry_src[act_tab][act_y/2-1][0]))*10+(keyCode - Canvas.KEY_NUM0)<1000) |
- | 168 | canvas.mk.params.set_field_from_act(tab_entry_src[act_tab][act_y/2-1][0] , Math.abs(canvas.mk.params.get_field_from_act(tab_entry_src[act_tab][act_y/2-1][0]))*10+(keyCode - Canvas.KEY_NUM0)); |
|
167 | break; |
169 | return; |
- | 170 | } |
|
- | 171 | else |
|
168 | case PARAMTYPE_BYTE: |
172 | if ( keyCode==KEYCODE_CLEAR) |
169 | canvas.mk.params.field_from_act_add(tab_entry_src[act_tab][act_y/2-1][0],1); |
173 | canvas.mk.params.set_field_from_act(tab_entry_src[act_tab][act_y/2-1][0],0); |
170 | break; |
- | |
171 | } |
174 | } |
- | 175 | ||
- | 176 | ||
- | 177 | switch (action) |
|
- | 178 | { |
|
- | 179 | ||
- | 180 | case Canvas.RIGHT: |
|
- | 181 | switch(tab_entry_types[act_tab][act_y/2-1]) |
|
- | 182 | { |
|
- | 183 | case PARAMTYPE_BOOLEAN: |
|
- | 184 | ||
- | 185 | canvas.mk.params.field_from_act_xor(tab_entry_src[act_tab][act_y/2-1][0],1<<tab_entry_src[act_tab][act_y/2-1][1]); |
|
- | 186 | break; |
|
- | 187 | case PARAMTYPE_BYTE: |
|
- | 188 | if (canvas.mk.params.get_field_from_act(tab_entry_src[act_tab][act_y/2-1][0])<255) |
|
- | 189 | canvas.mk.params.field_from_act_add(tab_entry_src[act_tab][act_y/2-1][0],1); |
|
- | 190 | break; |
|
- | 191 | } |
|
172 | break; |
192 | break; |
173 | 193 | ||
174 | case Canvas.LEFT: |
194 | case Canvas.LEFT: |
175 | switch(tab_entry_types[act_tab][act_y/2-1]) |
195 | switch(tab_entry_types[act_tab][act_y/2-1]) |
176 | { |
196 | { |
177 | case PARAMTYPE_BOOLEAN: |
197 | case PARAMTYPE_BOOLEAN: |
178 | 198 | ||
179 | canvas.mk.params.field_from_act_xor(tab_entry_src[act_tab][act_y/2-1][0],1<<tab_entry_src[act_tab][act_y/2-1][1]); |
199 | canvas.mk.params.field_from_act_xor(tab_entry_src[act_tab][act_y/2-1][0],1<<tab_entry_src[act_tab][act_y/2-1][1]); |
180 | 200 | ||
181 | break; |
201 | break; |
182 | case PARAMTYPE_BYTE: |
202 | case PARAMTYPE_BYTE: |
- | 203 | if (canvas.mk.params.get_field_from_act(tab_entry_src[act_tab][act_y/2-1][0])>0) |
|
183 | canvas.mk.params.field_from_act_add(tab_entry_src[act_tab][act_y/2-1][0],-1); |
204 | canvas.mk.params.field_from_act_add(tab_entry_src[act_tab][act_y/2-1][0],-1); |
184 | break; |
205 | break; |
185 | } |
206 | } |
186 | 207 | ||
187 | 208 | ||
188 | break; |
209 | break; |
- | 210 | } |
|
- | 211 | ||
189 | } |
212 | } |
190 | 213 | ||
191 | switch (action) |
214 | switch (action) |
192 | { |
215 | { |
Line 193... | Line 216... | ||
193 | 216 | ||
194 | case Canvas.DOWN: |
217 | case Canvas.DOWN: |