Subversion Repositories Kolibri OS

Rev

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

Rev 4742 Rev 4781
Line 27... Line 27...
27
        dd     0, 0             ; I_Param , I_Path
27
        dd     0, 0             ; I_Param, I_Path
Line 28... Line 28...
28
 
28
 
29
include '../../macros.inc'
29
include '../../macros.inc'
Line 30... Line -...
30
include '../../network.inc'
-
 
31
 
-
 
32
 
-
 
33
macro DrawRectangle x, y, w, h, color
-
 
34
{
-
 
35
        mcall 13, x shl 16 + w,     y shl 16 + 1,     color   ; top
-
 
36
        mcall   , x shl 16 + 1,     y shl 16 + h,     color   ; left
-
 
37
        mcall   , (x+w) shl 16 +1,  y shl 16 + (h+1), color   ; right
-
 
38
        mcall   , x shl 16 + w,   (y+h) shl 16 + 1,   color   ; bottom
-
 
39
}
-
 
40
 
30
include '../../network.inc'
41
 
31
 
Line 42... Line 32...
42
START:
32
START:
-
 
33
        mcall   40, EVM_REDRAW + EVM_BUTTON + EVM_STACK2 + EVM_KEY
43
        mcall   40, EVM_REDRAW + EVM_BUTTON + EVM_STACK2 + EVM_KEY
34
 
44
 
-
 
45
window_redraw:
-
 
46
        mcall   12, 1
-
 
47
        mcall   0, 100 shl 16 + 600, 100 shl 16 + 240, 0x34E1E1E1, , name       ; draw window
-
 
48
        DrawRectangle 0, 25, 400, 180, 0x777777
-
 
49
 
-
 
50
redraw:
-
 
51
        mcall   13, 1 shl 16 + 399, 26 shl 16 + 179, 0x00F3F3F3
-
 
52
        call    draw_interfaces
-
 
53
 
-
 
54
        xor     ebx, ebx
-
 
Line 55... Line 35...
55
        mov     bh, [device]
35
window_redraw:
56
        mcall   74
-
 
57
        mov     [device_type], eax
36
; Notify kernel of start of window draw
Line -... Line 37...
-
 
37
        mcall   12, 1
58
 
38
 
59
        mov     edx, 101
39
; Draw the window
60
        mov     esi, 0x00BBBbbb
40
        mcall   0, 100 shl 16 + 600, 100 shl 16 + 240, 0x34E1E1E1, , name
61
        mov     edi, 0x0081BBFF
41
 
62
 
42
; Define the buttons (for tabs)
63
        cmp     dl, [mode]
43
        mov     ebx, 5 shl 16 + 54
-
 
44
        mov     ecx, 4 shl 16 + 21
64
        cmove   esi, edi
45
        mov     edx, 0x60000000 + 101
-
 
46
  .buttonloop:
Line -... Line 47...
-
 
47
        mcall   8
-
 
48
        add     ebx, 60 shl 16
-
 
49
        inc     edx
-
 
50
        cmp     dl, 106
-
 
51
        jle     .buttonloop
-
 
52
 
-
 
53
; draw sides and upper lines of the tab buttons
65
        mcall   8, 5 shl 16 + 55, 5 shl 16 + 20
54
        mov     eax, 13
66
  .morebuttons:
55
        mov     ebx, 5 shl 16 + 1
67
        inc     edx
56
        mov     ecx, 4 shl 16 + 21
-
 
57
        mov     edx, 0x00777777
-
 
58
  .loop:
-
 
59
        mcall
-
 
60
        mov     bx, 54
-
 
61
        mov     cx, 1
-
 
62
        mcall
-
 
63
        mov     bx, 1
-
 
64
        mov     cx, 21
-
 
65
        add     ebx, 54 shl 16
-
 
66
        mcall
-
 
67
        add     ebx, 6 shl 16
-
 
68
        cmp     ebx, 360 shl 16
Line -... Line 69...
-
 
69
        jb      .loop
-
 
70
 
68
        add     ebx, 60 shl 16
71
; Draw sides and bottom lines of the rectangle
69
        mov     esi, 0x00BBBbbb
72
        mcall  , 0 shl 16 + 1, 25 shl 16 + 180;, 0x00777777
Line -... Line 73...
-
 
73
        mcall  , (0+400) shl 16 +1, 25 shl 16 + (180+1)
-
 
74
        mcall  , 0 shl 16 + 400, (25+180) shl 16 + 1
-
 
75
 
-
 
76
redraw:
-
 
77
 
-
 
78
; Draw interface buttons (on the right hand side)
-
 
79
        call    draw_interfaces
-
 
80
 
-
 
81
; Draw upper line of rectangle
-
 
82
        mcall   13, 0 shl 16 + 400, 25 shl 16 + 1, 0x00777777
-
 
83
 
-
 
84
; Fill rectangle
-
 
85
        mcall   13, 1 shl 16 + 399, 26 shl 16 + 179, 0x00F3F3F3
-
 
86
 
-
 
87
; Fill tab buttons
-
 
88
        mov     eax, 13
-
 
89
        mov     ebx, 6 shl 16 + 53
-
 
90
        mov     si, 101
-
 
91
  .buttonloop:
-
 
92
        mov     ecx, 6 shl 16 + 19
-
 
93
        mov     edx, 0x00BBBBBB
-
 
94
        cmp     si, [mode]
-
 
95
        jne     @f
-
 
96
        mov     edx, 0x00F3F3F3         ; Activated button has other colors
-
 
97
        inc     ecx
-
 
98
  @@:
-
 
99
        mcall
-
 
100
        mov     edx, 0x00E1E1E1
-
 
101
        cmp     si, [mode]
-
 
102
        jne     @f
-
 
103
        mov     edx, 0x00FFFFFF         ; Activated button has other colors
70
 
104
  @@:
Line -... Line 105...
-
 
105
        mov     ecx, 5 shl 16 + 1
-
 
106
        mcall
-
 
107
        add     ebx, 60 shl 16
-
 
108
        inc     si
-
 
109
        cmp     si, 106
-
 
110
        jle     .buttonloop
71
        cmp     dl, [mode]
111
; Print button names on top of the buttons
72
        cmove   esi, edi
112
        mcall   4, 9 shl 16 + 12, 0x80000000, modes
Line 73... Line 113...
73
        mcall
113
 
74
 
114
; Get information about the selected device
Line 550... Line 590...
550
        mcall   17              ; get id
590
        mcall   17              ; get id
551
        cmp     ah, 1
591
        cmp     ah, 1
552
        je      exit
592
        je      exit
553
        cmp     ah, 0
593
        cmp     ah, 0
554
        je      .interface
594
        je      .interface
-
 
595
        shr     ax, 8
555
        mov     [mode], ah
596
        mov     [mode], ax
556
        jmp     redraw
597
        jmp     redraw
Line 557... Line 598...
557
 
598
 
558
  .interface:
599
  .interface:
559
        shr     eax, 16
600
        shr     eax, 16
Line 716... Line 757...
716
 
757
 
Line 717... Line 758...
717
 
758
 
718
; DATA AREA
759
; DATA AREA
719
 
760
 
720
name            db 'Network status', 0
761
name            db 'Network status', 0
721
mode            db 101
762
mode            dw 101
722
device          db 0
763
device          db 0
723
last_device     db 0
764
last_device     db 0