Rev 3949 | Rev 4060 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3949 | Rev 3981 | ||
---|---|---|---|
Line 64... | Line 64... | ||
64 | TIMESTAMP = 3 ; 3 = hh:mm:ss, 2 = hh:mm, 0 = no timestamp |
64 | TIMESTAMP = 3 ; 3 = hh:mm:ss, 2 = hh:mm, 0 = no timestamp |
Line 65... | Line 65... | ||
65 | 65 | ||
Line 66... | Line 66... | ||
66 | MAX_WINDOWNAME_LEN = 256 |
66 | MAX_WINDOWNAME_LEN = 256 |
- | 67 | ||
- | 68 | WINDOW_BTN_START = 100 |
|
Line 67... | Line 69... | ||
67 | 69 | WINDOW_BTN_CLOSE = 2 |
|
Line 68... | Line 70... | ||
68 | WINDOW_BTN_START = 100 |
70 | WINDOW_BTN_LIST = 3 |
Line 180... | Line 182... | ||
180 | mov [scroll1.line_color], eax |
182 | mov [scroll1.line_color], eax |
Line 181... | Line 183... | ||
181 | 183 | ||
182 | ; get settings from ini |
184 | ; get settings from ini |
183 | invoke ini.get_str, path, str_user, str_nick, user_nick, MAX_NICK_LEN, default_nick |
185 | invoke ini.get_str, path, str_user, str_nick, user_nick, MAX_NICK_LEN, default_nick |
- | 186 | invoke ini.get_str, path, str_user, str_real, user_real_name, MAX_REAL_LEN, default_real |
|
Line 184... | Line 187... | ||
184 | invoke ini.get_str, path, str_user, str_real, user_real_name, MAX_REAL_LEN, default_real |
187 | invoke ini.get_str, path, str_user, str_quitmsg, quit_msg, 250, default_quit |
185 | 188 | ||
186 | ; Welcome user |
189 | ; Welcome user |
Line 187... | Line 190... | ||
187 | mov esi, str_welcome |
190 | mov esi, str_welcome |
Line 188... | Line 191... | ||
188 | call print_text2 |
191 | call print_text2 |
189 | 192 | ||
Line 190... | Line 193... | ||
190 | call draw_window ;;; FIXME (gui is not correctly drawn first time) |
193 | call draw_window ;;; FIXME (gui is not correctly drawn first time because of window sizes) |
Line 209... | Line 212... | ||
209 | cmp al, 3 |
212 | cmp al, 3 |
210 | je mouse |
213 | je mouse |
Line 211... | Line 214... | ||
211 | 214 | ||
Line 212... | Line 215... | ||
212 | call process_network_event |
215 | call process_network_event |
213 | 216 | ||
214 | mov edx, [window_open] |
217 | mov edx, [window_active] |
215 | test [edx + window.flags], FLAG_UPDATED |
218 | test [edx + window.flags], FLAG_UPDATED |
216 | jz .no_update |
219 | jz .no_update |
217 | and [edx + window.flags], not FLAG_UPDATED |
220 | and [edx + window.flags], not FLAG_UPDATED |
Line 224... | Line 227... | ||
224 | jmp still |
227 | jmp still |
Line 225... | Line 228... | ||
225 | 228 | ||
Line 226... | Line 229... | ||
226 | button: |
229 | button: |
227 | 230 | ||
Line 228... | Line 231... | ||
228 | mcall 17 ; get id |
231 | mcall 17 ; get id |
229 | shr eax, 8 |
232 | ror eax, 8 |
Line 230... | Line 233... | ||
230 | 233 | ||
231 | cmp ax, 1 ; close program |
234 | cmp ax, 1 ; close program |
Line -... | Line 235... | ||
- | 235 | je exit |
|
- | 236 | ||
- | 237 | cmp ax, WINDOW_BTN_CLOSE |
|
- | 238 | jne @f |
|
- | 239 | ||
- | 240 | call window_close |
|
- | 241 | jmp still |
|
- | 242 | ||
- | 243 | @@: |
|
232 | je exit |
244 | cmp ax, WINDOW_BTN_LIST |
233 | 245 | jne @f |
|
234 | cmp ax, 50 |
246 | |
235 | jne @f |
247 | push eax |
236 | 248 | ||
237 | mcall 37, 1 ; Get mouse position |
249 | mcall 37, 1 ; Get mouse position |
238 | sub ax, TEXT_Y |
250 | sub ax, TEXT_Y |
239 | mov bl, 10 |
251 | mov bl, 10 |
240 | div bl |
252 | div bl |
Line 241... | Line 253... | ||
241 | and eax, 0x000000ff |
253 | and eax, 0x000000ff |
Line -... | Line 254... | ||
- | 254 | inc eax |
|
- | 255 | add eax, [scroll1.position] |
|
- | 256 | mov ebx, [window_active] |
|
- | 257 | mov [ebx + window.selected], eax |
|
- | 258 | ||
- | 259 | call print_channel_list |
|
- | 260 | ||
- | 261 | pop eax |
|
- | 262 | test eax, 1 shl 25 ; Right mouse button pressed? |
|
- | 263 | jz still |
|
- | 264 | ||
- | 265 | ; Right mouse BTN was pressed, open chat window |
|
- | 266 | mov ebx, [window_active] |
|
- | 267 | mov eax, [ebx + window.selected] |
|
- | 268 | dec eax |
|
- | 269 | imul eax, MAX_NICK_LEN |
|
242 | inc eax |
270 | mov ebx, [ebx + window.data_ptr] |
Line 243... | Line 271... | ||
243 | add eax, [scroll1.position] |
271 | lea esi, [ebx + window_data.names + eax] |
244 | mov ebx, [window_open] |
272 | call window_open |
245 | mov [ebx + window.selected], eax |
273 | push [window_print] |
Line 260... | Line 288... | ||
260 | shl edx, 16 |
288 | shl edx, 16 |
261 | mov dx, ax |
289 | mov dx, ax |
262 | add edx, windows |
290 | add edx, windows |
263 | cmp [edx + window.data_ptr], 0 |
291 | cmp [edx + window.data_ptr], 0 |
264 | je exit |
292 | je exit |
265 | mov [window_open], edx |
293 | mov [window_active], edx |
266 | call window_refresh |
294 | call window_refresh |
267 | call draw_window |
295 | call draw_window |
Line 268... | Line 296... | ||
268 | 296 | ||
- | 297 | jmp still |
|
269 | jmp still |
298 | |
- | 299 | exit: |
|
- | 300 | ||
- | 301 | cmp [socketnum], 0 |
|
- | 302 | je @f |
|
- | 303 | mov esi, quit_msg |
|
- | 304 | call cmd_usr_quit_server |
|
- | 305 | @@: |
|
270 | exit: |
306 | |
Line 271... | Line 307... | ||
271 | mcall -1 |
307 | mcall -1 |
Line 288... | Line 324... | ||
288 | mov [edit1.pos], 0 |
324 | mov [edit1.pos], 0 |
Line 289... | Line 325... | ||
289 | 325 | ||
290 | push dword edit1 |
326 | push dword edit1 |
Line 291... | Line 327... | ||
291 | call [edit_box_draw] |
327 | call [edit_box_draw] |
292 | 328 | ||
293 | mov edx, [window_open] |
329 | mov edx, [window_active] |
294 | mov edx, [edx + window.data_ptr] |
330 | mov edx, [edx + window.data_ptr] |
Line 295... | Line 331... | ||
295 | add edx, window_data.text |
331 | add edx, window_data.text |
Line 346... | Line 382... | ||
346 | 382 | ||
347 | str_user db 'user', 0 |
383 | str_user db 'user', 0 |
348 | str_nick db 'nick', 0 |
384 | str_nick db 'nick', 0 |
349 | str_real db 'realname', 0 |
385 | str_real db 'realname', 0 |
- | 386 | str_email db 'email', 0 |
|
Line 350... | Line 387... | ||
350 | str_email db 'email', 0 |
387 | str_quitmsg db 'quitmsg', 0 |
351 | 388 | ||
- | 389 | default_nick db 'kolibri_user', 0 |
|
Line 352... | Line 390... | ||
352 | default_nick db 'kolibri_user', 0 |
390 | default_real db 'Kolibri User', 0 |
353 | default_real db 'Kolibri User', 0 |
391 | default_quit db 'KolibriOS forever', 0 |
354 | 392 | ||
355 | str_welcome db 10 |
393 | str_welcome db 10 |
Line 395... | Line 433... | ||
395 | text_start dd ? ; pointer to current textbox data |
433 | text_start dd ? ; pointer to current textbox data |
396 | irc_data dd 0x0 ; encoder |
434 | irc_data dd 0x0 ; encoder |
397 | textbox_width dd 80 ; in characters, not pixels ;) |
435 | textbox_width dd 80 ; in characters, not pixels ;) |
398 | pos dd 66 * 11 ; encoder |
436 | pos dd 66 * 11 ; encoder |
Line 399... | Line 437... | ||
399 | 437 | ||
400 | window_open dd windows |
438 | window_active dd windows |
Line 401... | Line 439... | ||
401 | window_print dd windows |
439 | window_print dd windows |
402 | 440 | ||
Line 458... | Line 496... | ||
458 | 496 | ||
Line 459... | Line 497... | ||
459 | irc_server_name rb MAX_SERVER_NAME |
497 | irc_server_name rb MAX_SERVER_NAME |
460 | 498 | ||
- | 499 | user_nick rb MAX_NICK_LEN |
|
Line 461... | Line 500... | ||
461 | user_nick rb MAX_NICK_LEN |
500 | user_real_name rb MAX_REAL_LEN |
Line 462... | Line 501... | ||
462 | user_real_name rb MAX_REAL_LEN |
501 | quit_msg rb 250 |