Subversion Repositories Kolibri OS

Rev

Rev 4671 | Rev 6026 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4671 Rev 6023
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                                 ;;
2
;;                                                                 ;;
3
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved.    ;;
3
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved.    ;;
4
;; Distributed under terms of the GNU General Public License       ;;
4
;; Distributed under terms of the GNU General Public License       ;;
5
;;                                                                 ;;
5
;;                                                                 ;;
6
;;   Written by hidnplayr@kolibrios.org                            ;;
6
;;   Written by hidnplayr@kolibrios.org                            ;;
7
;;                                                                 ;;
7
;;                                                                 ;;
8
;;         GNU GENERAL PUBLIC LICENSE                              ;;
8
;;         GNU GENERAL PUBLIC LICENSE                              ;;
9
;;          Version 2, June 1991                                   ;;
9
;;          Version 2, June 1991                                   ;;
10
;;                                                                 ;;
10
;;                                                                 ;;
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 12... Line -...
12
 
-
 
13
 
12
 
Line 14... Line 13...
14
 
13
 
Line 15... Line 14...
15
draw_window:    ; Completely redraw the window, recalculate all coordinates and sizes
14
draw_window:    ; Completely redraw the window, recalculate all coordinates and sizes
Line 53... Line 52...
53
        add     edx, 0x33000000
52
        add     edx, 0x33000000
54
        mov     edi, str_programname
53
        mov     edi, str_programname
55
        mcall
54
        mcall
56
        mcall   12, 2		
55
        mcall   12, 2           
Line 57... Line 56...
57
			
56
                        
58
		test	[thread_info.wnd_state], 100b ; skip if window rolled up
57
        test    [thread_info.wnd_state], 100b   ; skip if window is rolled up
Line 59... Line -...
59
		jne		.exit
-
 
60
 
-
 
61
        mov     ebx, [xsize]
-
 
62
        mov     ecx, [ysize]
-
 
63
        sub     cx, BOTTOM_Y ;;;;
-
 
64
        push    cx
-
 
65
        shl     ecx, 16
-
 
66
        pop     cx
-
 
67
        mov     edx, [colors.work_graph]
-
 
68
        mcall   38                              ; draw bottom line
-
 
69
        mov     ecx, TOP_Y SHL 16 + TOP_Y
-
 
70
        mcall                                   ; draw top line
58
        jne     .exit
71
 
59
 
72
; calculate available space for textbox and coordinates for scrollbars
60
; calculate available space for textbox and coordinates for scrollbars
73
        mov     eax, [ysize]
61
        mov     eax, [ysize]
74
        sub     eax, TOP_Y + BOTTOM_Y - 1   ;;;;
62
        sub     eax, TOP_Y + INPUTBOX_HEIGHT - 1   ;;;;
75
        mov     [scroll2.y_size], ax
63
        mov     [scroll2.y_size], ax
76
        mov     [scroll1.y_size], ax
64
        mov     [scroll1.y_size], ax
77
        sub     eax, 4 ;;;;
65
        sub     eax, 4 ;;;;
Line 135... Line 123...
135
        sub     ebx, USERLIST_WIDTH + SCROLLBAR_WIDTH + 3
123
        sub     ebx, USERLIST_WIDTH + SCROLLBAR_WIDTH + 3
136
        push    bx
124
        push    bx
137
        shl     ebx, 16
125
        shl     ebx, 16
138
        pop     bx
126
        pop     bx
139
        mov     ecx, [ysize]
127
        mov     ecx, [ysize]
140
        add     ecx, TOP_Y shl 16 - (BOTTOM_Y)
128
        add     ecx, TOP_Y shl 16 - (INPUTBOX_HEIGHT)
141
        mov     edx, [colors.work_graph]
129
        mov     edx, [colors.work_graph]
142
        mcall   38
130
        mcall   38
143
  .not_channel:
131
  .not_channel:
Line 144... Line 132...
144
 
132
 
145
; draw editbox
133
; draw editbox
146
        mov     eax, [ysize]
134
        mov     eax, [ysize]
147
        sub     eax, 13 ;;;;;;
135
        sub     eax, INPUTBOX_HEIGHT
Line 148... Line 136...
148
        mov     [edit1.top], eax
136
        mov     [edit1.top], eax
149
 
137
 
Line 265... Line 253...
265
        ret
253
        ret
Line 266... Line 254...
266
 
254
 
Line -... Line 255...
-
 
255
 
-
 
256
draw_windowtabs:
-
 
257
 
-
 
258
; Draw horizontal line
-
 
259
 
-
 
260
        mov     ebx, [xsize]
-
 
261
        mov     edx, [colors.work_graph]
267
 
262
        mov     ecx, TOP_Y SHL 16 + TOP_Y
Line 268... Line 263...
268
draw_windowtabs:
263
        mcall   38
269
 
264
 
270
; Create the buttons
265
; Create the buttons
271
 
266
 
272
        mov     eax, 8
267
        mov     eax, 8
273
        mov     ebx, 5 shl 16 + 120
268
        mov     ebx, TAB_WIDTH
274
        mov     ecx, 12 shl 16 + 12
269
        mov     ecx, TOP_SPACE shl 16 + TAB_HEIGHT
275
        mov     edx, WINDOW_BTN_START
270
        mov     edx, WINDOW_BTN_START
Line 281... Line 276...
281
        not     esi
276
        not     esi
282
        and     esi, 0x00ffffff
277
        and     esi, 0x00ffffff
283
      @@:
278
      @@:
284
        mcall
279
        mcall
285
        inc     edx
280
        inc     edx
286
        add     ebx, 125 shl 16
281
        add     ebx, (TAB_WIDTH + TAB_SPACE) shl 16
287
        add     edi, sizeof.window
282
        add     edi, sizeof.window
288
        cmp     [edi + window.data_ptr], 0
283
        cmp     [edi + window.data_ptr], 0
289
        jne     .more_btn
284
        jne     .more_btn
Line 290... Line 285...
290
 
285
 
291
; Draw the close window button
-
 
292
 
286
; Draw the close window button
293
        mov     edi, [window_active]
287
        mov     edi, [window_active]
294
        cmp     [edi + window.type], WINDOWTYPE_SERVER  ; dont let the user close server window
288
        cmp     [edi + window.type], WINDOWTYPE_SERVER  ; dont let the user close server window
Line 295... Line 289...
295
        je      @f
289
        je      @f
296
 
290
 
297
;        mov     eax, 8
291
;        mov     eax, 8
298
        mov     ebx, [xsize]
292
        mov     ebx, [xsize]
299
        sub     ebx, 12
293
        sub     ebx, SCROLLBAR_WIDTH
300
        shl     ebx, 16
294
        shl     ebx, 16
301
        mov     bx, 12
295
        mov     bx, SCROLLBAR_WIDTH
302
        mov     ecx, 6 shl 16 + 12
296
        mov     ecx, TOP_SPACE shl 16 + TAB_HEIGHT - 1
303
        mov     edx, WINDOW_BTN_CLOSE
297
        mov     edx, WINDOW_BTN_CLOSE
304
        mov     esi, 0x00aa0000         ; red !
298
        mov     esi, 0x00aa0000         ; red !
Line 305... Line 299...
305
        mcall
299
        mcall
Line 306... Line 300...
306
  @@:
300
  @@:
307
 
301
 
308
; Draw the windownames onto the buttons
302
; Draw the windownames onto the buttons
309
 
303
 
310
        mov     eax, 4
304
        mov     eax, 4
311
        mov     ebx, 10 shl 16 + 15
305
        mov     ebx, 5 shl 16 + TOP_SPACE + 4 ;;;;
312
        mov     esi, MAX_WINDOWS
306
        mov     esi, MAX_WINDOWS
Line 321... Line 315...
321
        lea     edx, [edi + window.name]
315
        lea     edx, [edi + window.name]
322
        mcall
316
        mcall
323
        add     edi, sizeof.window      ; get ptr to next window
317
        add     edi, sizeof.window      ; get ptr to next window
324
        cmp     [edi + window.data_ptr], 0
318
        cmp     [edi + window.data_ptr], 0
325
        je      .enough
319
        je      .enough
326
        add     ebx, 125 shl 16
320
        add     ebx, (TAB_WIDTH + TAB_SPACE) shl 16
327
        dec     esi
321
        dec     esi
328
        jnz     .more
322
        jnz     .more
329
  .enough:
323
  .enough:
Line 330... Line 324...
330
 
324
 
Line 331... Line 325...
331
        ret
325
        ret
332
 
326
 
333
 
327
 
334
 
328
 
335
highlight_updated_tabs:
329
highlight_updated_tabs:
336
        mov     eax, 4
330
        mov     eax, 4
337
        mov     ebx, 10 shl 16 + 15
331
        mov     ebx, 5 shl 16 + TOP_SPACE + 4 ;;;;
338
        mov     ecx, 0x80aa0000
332
        mov     ecx, 0x80aa0000
Line 345... Line 339...
345
        mcall
339
        mcall
346
  .next:
340
  .next:
347
        add     edi, sizeof.window      ; get ptr to next window
341
        add     edi, sizeof.window      ; get ptr to next window
348
        cmp     [edi + window.data_ptr], 0
342
        cmp     [edi + window.data_ptr], 0
349
        je      .enough_
343
        je      .enough_
350
        add     ebx, 125 shl 16
344
        add     ebx, (TAB_WIDTH + TAB_SPACE) shl 16
351
        dec     esi
345
        dec     esi
352
        jnz     .more_
346
        jnz     .more_
353
  .enough_:
347
  .enough_:
Line 354... Line 348...
354
 
348
 
355
        ret
349
        ret