Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1951 mario79 1
;---------------------------------------------------------------------
2
kfile:
3
	test	dword [status],1
4
	jnz	still
5
	or	dword [status],1
6
 
7
	call	load_directory.copy_dir_path
8
 
9
;	call	get_filter_data
10
 
11
 
12
	cmp [OpenDialog_path],dword 'NoKe'
13
	je	@f
14
	mov [OpenDialog_data.start_path],dword OpenDialog_path
15
	jmp	.start_OpenDialog
16
@@:
17
	mov	ebx,open_dialog_name
18
	mov	esi,path
19
	mov	edi,library_path
20
	call	copy_file_path
21
 
22
.start_OpenDialog:
23
 
24
;start_OpenDialog	OpenDialog_data
25
	push    dword OpenDialog_data
26
	call    [OpenDialog_Start]
27
 
28
	call	clear_control_key_flag
29
 
30
	cmp	[OpenDialog_data.status],2
31
	je	thread1_start
32
	cmp	[OpenDialog_data.status],1
33
	jne	@f
34
	xor	dword [status],1
35
	jmp	kopen_1
36
@@:
37
	xor	dword [status],1
38
	jmp	still
39
 
40
thread1_start:
41
 
42
	call	get_memory_for_tread_stack
43
	mov	[thread_stack],eax
44
	mcall	51,1,thread1	;, thread_stack
45
	jmp	still
46
;---------------------------------------------------------------------
47
get_filter_data:
48
	mov	edi,Filter+4
49
	xor	eax,eax
50
	mov	ecx,10
51
	cld
52
@@:
53
	mov	esi,10
54
	sub	esi,ecx
55
	lea     esi,[esi+esi*2] ; x 3
56
	shl	esi,3  ; x 8
57
	add	esi,dword Convert_plugin_0.Assoc
58
	mov	esi,[esi]
59
	add	esi,4
60
 
61
	test	esi,esi
62
	jz	@f
63
	call	.start
64
	dec	ecx
65
	jnz	@r
66
@@:
67
	mov	[edi],byte 0
68
	mov	eax,Filter
69
	sub	edi,eax
70
	mov	[eax],edi
71
 
72
	ret
73
.start:
74
@@:
75
	lodsb
76
	stosb
77
	test	eax,eax
78
	jnz	@r
79
	cmp	[esi],ah
80
	jne	@r
81
	ret
82
;---------------------------------------------------------------------
83
thread1:			; start of thread1
84
    mcall 9, procinfo_threads, -1
85
    mov   eax,[ebx+30]
86
    mov   [PID1],eax
87
	mcall 40, 0x27
88
 
89
   or  ecx,-1		; get information about me
90
   call getappinfo
91
 
92
    mov  esi,string
93
@@:
94
    cld
95
    lodsb
96
    test al,al
97
    jne  @r
98
    sub  esi,string
99
    mov  eax,esi
100
    dec  eax
101
    mov edi, edit1
102
    mov [edi+48], eax  ;ed_size
103
    mov [edi+52], eax  ;ed_pos
104
.red:
105
    call .draw_window
106
 
107
.still:
108
 
109
    mcall 10		; wait here for event
110
 
111
    cmp  eax,1			; redraw request ?
112
    je	 .red
113
    cmp  eax,2			; key in buffer ?
114
    je	 .key
115
    cmp  eax,3			; button in buffer ?
116
    je	 .button
117
 
118
	push    dword name_editboxes
119
	call    [edit_box_mouse]
120
;	mouse_edit_box name_editboxes
121
;    mouse_menubar menu_data_2
122
    jmp  .still
123
 
124
.key: 			; key
125
    mcall 2
126
    cmp ah,13
127
    je	.close_with_open_file
128
    cmp ah,27
129
    je	.close
130
 
131
	push    dword name_editboxes
132
	call    [edit_box_key]
133
;    key_edit_box name_editboxes
134
    jmp  .still
135
 
136
.close_with_open_file:
137
	mov  [open_file_flag],byte 1
138
	jmp  .close
139
 
140
.button:			; button
141
    mov  eax,17 		; get id
142
    mcall
143
 
144
    cmp  ah,1			; button id=1 ?
145
    jne  .still
146
.close:
147
;    bts  dword [status],2
148
;    btr  dword [status],0
149
	xor  dword [status],1
150
	xor   eax,eax
151
    mov   [PID1],eax
152
	mcall	68,13,[thread_stack]
153
    mov  eax,-1 		; close this program
154
    mcall
155
 
156
    jmp  .still
157
 
158
;   *********************************************
159
;   *******  WINDOW DEFINITIONS AND DRAW ********
160
;   *********************************************
161
 
162
 
163
.draw_window:
164
 
165
 
166
    mov  eax,12 		   ; function 12:tell os about windowdraw
167
    mov  ebx,1			   ; 1, start of draw
168
    mcall
169
 
170
				   ; DRAW WINDOW
171
    xor  eax,eax		   ; function 0 : define and draw window
172
    mov  ebx,100*65536+300	   ; [x start] *65536 + [x size]
173
    mov  ecx,100*65536+80	   ; [y start] *65536 + [y size]
174
    mov  edx,0x03eeeeee 	   ; color of work area RRGGBB,8->color gl
175
    mcall
176
 
177
				   ; WINDOW LABEL
178
 
179
    mcall 71,1, labelt1
180
 
181
	push    dword name_editboxes
182
	call    [edit_box_draw]
183
;	draw_edit_box name_editboxes
184
;    mcall 47,0x80000,[PID1],<200, 5>,0xffffff
185
;    mcall 71,1, proverka
186
;    mcall 47,0x80001,0,<300, 5>,0xffffff
187
;	draw_menu_bar menu_data_2
188
    mov  eax,12 		   ; function 12:tell os about windowdraw
189
    mov  ebx,2			   ; 2, end of draw
190
    mcall
191
 
192
    ret
193
 
194
 
195
;---------------------------------------------------------------------