Subversion Repositories Kolibri OS

Rev

Rev 1951 | Details | Compare with Previous | 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
2000 mario79 8
	cmp	[OpenDialog_path],dword 'NoKe'
9
	je	@f
1951 mario79 10
 
2000 mario79 11
	mov	[OpenDialog_data.start_path],dword OpenDialog_path
1951 mario79 12
	jmp	.start_OpenDialog
2000 mario79 13
;---------------------------------------------------------------------
1951 mario79 14
@@:
15
	mov	ebx,open_dialog_name
16
	mov	esi,path
17
	mov	edi,library_path
18
	call	copy_file_path
19
 
20
.start_OpenDialog:
21
	push    dword OpenDialog_data
22
	call    [OpenDialog_Start]
23
	call	clear_control_key_flag
24
	cmp	[OpenDialog_data.status],2
25
	je	thread1_start
2000 mario79 26
 
1951 mario79 27
	cmp	[OpenDialog_data.status],1
28
	jne	@f
2000 mario79 29
 
1951 mario79 30
	xor	dword [status],1
31
	jmp	kopen_1
2000 mario79 32
;---------------------------------------------------------------------
1951 mario79 33
@@:
34
	xor	dword [status],1
35
	jmp	still
2000 mario79 36
;---------------------------------------------------------------------
1951 mario79 37
thread1_start:
2000 mario79 38
	call	get_memory_for_thread_stack
1951 mario79 39
	mov	[thread_stack],eax
2000 mario79 40
	mcall	51,1,thread1	; thread_stack
1951 mario79 41
	jmp	still
42
;---------------------------------------------------------------------
2000 mario79 43
thread1:			; start of thread1
44
	mcall	9,procinfo_threads, -1
45
	mov	eax,[ebx+30]
46
	mov	[PID1],eax
47
	mcall	40,0x27
48
	or	ecx,-1		; get information about me
49
	call	getappinfo
50
	mov	esi,string
51
;-------------------------------------
1951 mario79 52
	cld
53
@@:
54
	lodsb
2000 mario79 55
	test	al,al
1951 mario79 56
	jne	@r
2000 mario79 57
;-------------------------------------
58
	sub	esi,string
59
	mov	eax,esi
60
	dec	eax
61
	mov	edi, edit1
62
	mov	[edi+48], eax  ;ed_size
63
	mov	[edi+52], eax  ;ed_pos
64
;-------------------------------------
1951 mario79 65
.red:
2000 mario79 66
	call	.draw_window
67
;-------------------------------------
1951 mario79 68
.still:
2000 mario79 69
	mcall	10		; wait here for event
1951 mario79 70
 
2000 mario79 71
	cmp	eax,1			; redraw request ?
72
	je	.red
1951 mario79 73
 
2000 mario79 74
	cmp	eax,2			; key in buffer ?
75
	je	.key
1951 mario79 76
 
2000 mario79 77
	cmp	eax,3			; button in buffer ?
78
	je	.button
1951 mario79 79
 
2000 mario79 80
	push	dword name_editboxes
81
	call	[edit_box_mouse]
82
	jmp	.still
83
;---------------------------------------------------------------------
1951 mario79 84
.key: 			; key
2000 mario79 85
	mcall
86
	cmp	ah,13
87
	je	.close_with_open_file
88
 
89
	cmp	ah,27
90
	je	.close
1951 mario79 91
 
2000 mario79 92
	push	dword name_editboxes
93
	call	[edit_box_key]
94
	jmp	.still
95
;---------------------------------------------------------------------
1951 mario79 96
.close_with_open_file:
2000 mario79 97
	mov	[open_file_flag],byte 1
98
	jmp	.close
99
;---------------------------------------------------------------------
1951 mario79 100
.button:			; button
2000 mario79 101
	mcall	17 		; get id
102
	cmp	ah,1			; button id=1 ?
103
	jne	.still
1951 mario79 104
.close:
2000 mario79 105
	xor	dword [status],1
106
	xor	eax,eax
107
	mov	[PID1],eax
1951 mario79 108
	mcall	68,13,[thread_stack]
2000 mario79 109
	mcall	-1 		; close this program
110
	jmp	.still
111
;---------------------------------------------------------------------
1951 mario79 112
;   *********************************************
113
;   *******  WINDOW DEFINITIONS AND DRAW ********
114
;   *********************************************
115
.draw_window:
2000 mario79 116
	mcall	12,1
117
	xor	eax,eax		   ; function 0 : define and draw window
118
	xor	esi,esi
119
	mcall	,<100,300>,<100,80>,0x13eeeeee,,labelt1
1951 mario79 120
	push    dword name_editboxes
121
	call    [edit_box_draw]
2000 mario79 122
;	mcall	47,0x80000,[PID1],<200, 5>,0xffffff
123
	mcall	12,2
124
	ret
125
;---------------------------------------------------------------------