Subversion Repositories Kolibri OS

Rev

Rev 6582 | Rev 7465 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6582 Rev 7464
1
SYS_COL  = 0xe6e6e6
1
SYS_COL  = 0xe6e6e6
2
BT_COL   = 0xcccccc
2
BT_COL   = 0xcccccc
3
STR_COL  = 0x595959 ;0x000000
3
STR_COL  = 0x595959 ;0x000000
-
 
4
 
-
 
5
WIN_X = 320
-
 
6
WIN_Y = 300
-
 
7
WIN_W = 390
-
 
8
WIN_H = 230
-
 
9
 
-
 
10
pad = 28 ; padding between editboxes
4
 
11
 
5
;;================================================================================================;;
12
;;================================================================================================;;
6
login_gui: ;//////////////////////////////////////////////////////////////////////////////////////;;
13
login_gui: ;//////////////////////////////////////////////////////////////////////////////////////;;
7
;;------------------------------------------------------------------------------------------------;;
14
;;------------------------------------------------------------------------------------------------;;
8
;? Login GUI-specific functions                                                                   ;;
15
;? Login GUI-specific functions                                                                   ;;
9
;;------------------------------------------------------------------------------------------------;;
16
;;------------------------------------------------------------------------------------------------;;
10
;> none                                                                                           ;;
17
;> none                                                                                           ;;
11
;;------------------------------------------------------------------------------------------------;;
18
;;------------------------------------------------------------------------------------------------;;
12
;< none                                                                                           ;;
19
;< none                                                                                           ;;
13
;;================================================================================================;;
20
;;================================================================================================;;
14
 
21
 
15
    ; TODO: print error strings (wrong user, pass, etc.)
22
    ; TODO: print error strings (wrong user, pass, etc.)
16
 
23
 
17
  .server_addr:
24
  .server_addr:
18
        mov     [initial_login], 1
25
        mov     [initial_login], 1
19
 
26
 
20
  .get_username:
27
  .get_username:
21
        ; in case of error when either login_gui.server_addr or 
28
        ; in case of error when either login_gui.server_addr or 
22
        ; login_gui.get_username is called, should resize window
29
        ; login_gui.get_username is called, should resize window
23
        mcall   67, 320, 300, 390, 200 ; resize to login gui window size
30
        mcall   67, WIN_X, WIN_Y, WIN_W, WIN_H ; resize to login gui window size
24
 
31
 
25
  .redraw:
32
  .redraw:
26
        call    .draw
33
        call    .draw
27
        jmp     .still
34
        jmp     .still
28
 
35
 
29
 
36
 
30
  align 4
37
  align 4
31
  .draw:
38
  .draw:
32
        mcall   12, 1
39
        mcall   12, 1
33
        mcall   0, <320,390>, <300,200>, 0x34000000+SYS_COL, 0x805080DD, hed
40
        mcall   0, , , 0x34000000+SYS_COL, 0x805080DD, str_title
34
 
41
 
35
        stdcall [edit_box_draw], edit_usr
42
        stdcall [edit_box_draw], edit_usr
36
        stdcall [edit_box_draw], edit_pass
43
        stdcall [edit_box_draw], edit_pass
37
        stdcall [edit_box_draw], edit_server
44
        stdcall [edit_box_draw], edit_server
38
        stdcall [edit_box_draw], edit_port
45
        stdcall [edit_box_draw], edit_port
39
        stdcall [edit_box_draw], edit_path
46
        stdcall [edit_box_draw], edit_path
40
 
47
 
41
        ; draw "connect" button
48
        ; draw "connect" button
42
        mcall   8, <162,65>, <140,25>, 2, BT_COL
49
        mcall   8, <162,65>, <150,25>, 2, BT_COL
43
 
50
 
44
        ; draw strings
51
        ; draw strings
45
        mcall   4, <3,5>, 0xb0000000, gui_str_usr
52
        mcall   4, <3,      8>, 0xb0000000, gui_str_usr
46
        mcall   4, <3,25>, 0xb0000000, gui_str_pass
53
        mcall    , <3,pad*1+8>,           , gui_str_pass
47
        mcall   4, <3,45>, 0xb0000000, gui_str_server
54
        mcall    , <3,pad*2+8>,           , gui_str_server
48
        mcall   4, <3,65>, 0xb0000000, gui_str_port
55
        mcall    , <3,pad*3+8>,           , gui_str_port
49
        mcall   4, <3,85>, 0xb0000000, gui_str_path
56
        mcall    , <3,pad*4+8>,           , gui_str_path
50
        mcall   4, <167,145>, 0xb0000000+STR_COL, gui_str_connect
57
        mcall    , <167,155>, 0xb0000000+STR_COL, gui_str_connect
51
        mcall   4, <3,115>, 0xb0ff0000, [str_error_addr]
58
        mcall    , <3,115>, 0xb0ff0000, [str_error_addr]
52
        mov     [str_error_addr], gui_str_null ; reset error string address
59
        mov     [str_error_addr], gui_str_null ; reset error string address
53
 
60
 
54
        mcall   12, 2
61
        mcall   12, 2
55
        ret
62
        ret
56
 
63
 
57
  align 4
64
  align 4
58
  .still:
65
  .still:
59
        mcall    10     ; wait for event
66
        mcall    10     ; wait for event
60
        dec      eax
67
        dec      eax
61
        jz       .redraw
68
        jz       .redraw
62
        dec      eax
69
        dec      eax
63
        jz       .key
70
        jz       .key
64
        dec      eax
71
        dec      eax
65
        jz       .button
72
        jz       .button
66
 
73
 
67
        stdcall [edit_box_mouse], edit_usr
74
        stdcall [edit_box_mouse], edit_usr
68
        stdcall [edit_box_mouse], edit_pass
75
        stdcall [edit_box_mouse], edit_pass
69
        stdcall [edit_box_mouse], edit_server
76
        stdcall [edit_box_mouse], edit_server
70
        stdcall [edit_box_mouse], edit_port
77
        stdcall [edit_box_mouse], edit_port
71
        stdcall [edit_box_mouse], edit_path
78
        stdcall [edit_box_mouse], edit_path
72
 
79
 
73
        jmp     .still
80
        jmp     .still
74
 
81
 
75
  .button:
82
  .button:
76
        mcall   17
83
        mcall   17
77
 
84
 
78
        dec     ah
85
        dec     ah
79
        jz      .exit
86
        jz      .exit
80
 
87
 
81
        dec     ah   ; 'Connect' button clicked
88
        dec     ah   ; 'Connect' button clicked
82
        jz      gui.main
89
        jz      gui.main
83
 
90
 
84
        jmp     .still
91
        jmp     .still
85
 
92
 
86
  .key:
93
  .key:
87
        mcall   2
94
        mcall   2
-
 
95
 
-
 
96
        cmp     ah,13
-
 
97
        je      gui.main
-
 
98
 
-
 
99
        cmp     ah,9
-
 
100
        je      .tab
88
 
101
 
89
        stdcall [edit_box_key], edit_usr
102
        stdcall [edit_box_key], edit_usr
90
        stdcall [edit_box_key], edit_pass
103
        stdcall [edit_box_key], edit_pass
91
        stdcall [edit_box_key], edit_server
104
        stdcall [edit_box_key], edit_server
92
        stdcall [edit_box_key], edit_port
105
        stdcall [edit_box_key], edit_port
93
        stdcall [edit_box_key], edit_path
106
        stdcall [edit_box_key], edit_path
94
 
107
 
95
        jmp     .still
108
        jmp     .still
96
 
109
 
97
  .error:
110
  .error:
98
        mov     [str_error_addr], gui_str_error
111
        mov     [str_error_addr], gui_str_error
99
        jmp     .server_addr
112
        jmp     .server_addr
100
    
113
    
101
  .exit:
114
  .exit:
102
        jmp     gui.exit
115
        jmp     gui.exit
-
 
116
 
-
 
117
  .tab:
-
 
118
        ;TODO
-
 
119
        jmp     .still
103
 
120
 
104
 
121
 
105
gui_str_connect db 'Connect',0
122
gui_str_connect db 'Connect',0
106
gui_str_usr     db 'Username:',0
123
gui_str_usr     db 'Username:',0
107
gui_str_pass    db 'Password:',0
124
gui_str_pass    db 'Password:',0
108
gui_str_server  db 'Server:',0
125
gui_str_server  db 'Server:',0
109
gui_str_port    db 'Port:',0
126
gui_str_port    db 'Port:',0
110
gui_str_path    db 'Path:',0
127
gui_str_path    db 'Path:',0
111
gui_str_error   db 'ERROR! Check log file for details',0
128
gui_str_error   db 'ERROR! Check log file for details',0
112
gui_str_null    db ' ',0
129
gui_str_null    db ' ',0
113
 
130
 
114
str_error_addr  dd gui_str_null
131
str_error_addr  dd gui_str_null
115
 
132
 
116
; login window components
133
; login window components
117
edit_usr edit_box 300,75,5, 0xffffff,0x6f9480,0,0xAABBCC,0,99,param_user,mouse_dd,ed_focus
134
edit_usr    edit_box 300,75,5,      0xffffff,0x94AECE,0,0xAABBCC,0x10000000,99,param_user,mouse_dd,ed_focus
118
edit_pass edit_box 300,75,25,0xffffff,0x6a9480,0,0xAABBCC,0,99,param_password,mouse_dd,ed_pass
135
edit_pass   edit_box 300,75,pad+5,  0xffffff,0x94AECE,0,0xAABBCC,0x10000000,99,param_password,mouse_dd,ed_pass
119
edit_server edit_box 300,75,45,0xffffff,0x6a9480,0,0xAABBCC,0,99,param_server_addr,mouse_dd,0
136
edit_server edit_box 300,75,pad*2+5,0xffffff,0x94AECE,0,0xAABBCC,0x10000000,99,param_server_addr,mouse_dd,0
120
edit_port edit_box 50,75,65,0xffffff,0x6a9480,0,0xAABBCC,0,99,param_port,mouse_dd,ed_figure_only
137
edit_port   edit_box 50, 75,pad*3+5,0xffffff,0x94AECE,0,0xAABBCC,0x10000000,99,param_port,mouse_dd,ed_figure_only
121
edit_path edit_box 300,75,85,0xffffff,0x6a9480,0,0xAABBCC,0,99,param_path,mouse_dd,0
138
edit_path   edit_box 300,75,pad*4+5,0xffffff,0x94AECE,0,0xAABBCC,0x10000000,99,param_path,mouse_dd,0
122
 
139
 
123
mouse_dd rd 1
140
mouse_dd rd 1