Subversion Repositories Kolibri OS

Rev

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

Rev 267 Rev 297
Line 35... Line 35...
35
	call	set_cur_tab
35
	call	set_cur_tab
36
	call	align_editor_in_tab
36
	call	align_editor_in_tab
37
	call	draw_editor
37
	call	draw_editor
38
	call	draw_statusbar
38
	call	draw_statusbar
39
	call	draw_tabctl
39
	call	draw_tabctl
-
 
40
	call	update_caption
Line 40... Line 41...
40
 
41
 
41
    @@:
42
    @@:
Line 42... Line 43...
42
	jmp	still.skip_write
43
	jmp	still.skip_write
43
 
44
 
44
  btn.vscroll_up:
45
  btn.vscroll_up:
45
	dec	[cur_editor.TopLeft.Y] ;! [top_line]
46
	dec	[cur_editor.TopLeft.Y]
46
	jns	@f
47
	jns	@f
47
	inc	[cur_editor.TopLeft.Y] ;! [top_line]
48
	inc	[cur_editor.TopLeft.Y]
48
	ret
49
	ret
Line 49... Line 50...
49
    @@: call	check_inv_all.skip_check
50
    @@: call	editor_check_for_changes
50
	ret
51
	ret
51
 
52
 
52
  btn.vscroll_down:
53
  btn.vscroll_down:
53
	inc	[cur_editor.TopLeft.Y] ;! [top_line]
54
	inc	[cur_editor.TopLeft.Y]
54
	mov	eax,[cur_editor.Lines.Count] ;! eax,[lines]
55
	mov	eax,[cur_editor.Lines.Count]
55
	sub	eax,[lines.scr]
56
	sub	eax,[lines.scr]
56
	cmp	eax,[cur_editor.TopLeft.Y] ;! eax,[top_line]
57
	cmp	eax,[cur_editor.TopLeft.Y]
57
	jge	@f
58
	jge	@f
58
	dec	[cur_editor.TopLeft.Y] ;! [top_line]
59
	dec	[cur_editor.TopLeft.Y]
Line 59... Line 60...
59
	ret
60
	ret
60
    @@: call	check_inv_all.skip_check
61
    @@: call	editor_check_for_changes
61
	ret
62
	ret
62
 
63
 
63
  btn.hscroll_up:
64
  btn.hscroll_up:
64
	dec	[cur_editor.TopLeft.X] ;! [left_col]
65
	dec	[cur_editor.TopLeft.X]
65
	jns	@f
66
	jns	@f
Line 66... Line 67...
66
	inc	[cur_editor.TopLeft.X] ;! [left_col]
67
	inc	[cur_editor.TopLeft.X]
67
	ret;jmp     still.skip_write
68
	ret
68
    @@: call	check_inv_all.skip_check
69
    @@: call	editor_check_for_changes
69
	ret
70
	ret
70
 
71
 
71
  btn.hscroll_down:
72
  btn.hscroll_down:
72
	inc	[cur_editor.TopLeft.X] ;! [left_col]
73
	inc	[cur_editor.TopLeft.X]
73
	mov	eax,[cur_editor.Columns.Count] ;! eax,[columns]
74
	mov	eax,[cur_editor.Columns.Count]
74
	sub	eax,[columns.scr]
75
	sub	eax,[columns.scr]
75
	cmp	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
76
	cmp	eax,[cur_editor.TopLeft.X]
Line 76... Line 77...
76
	jge	@f
77
	jge	@f
77
	dec	[cur_editor.TopLeft.X] ;! [left_col]
78
	dec	[cur_editor.TopLeft.X]
78
	ret
79
	ret
Line 91... Line 92...
91
	jns	@f
92
	jns	@f
92
	inc	[tab_bar.Items.Left]
93
	inc	[tab_bar.Items.Left]
93
    @@: call	draw_tabctl
94
    @@: call	draw_tabctl
94
	ret
95
	ret
Line 95... Line 96...
95
 
96
 
96
  btn.search:
-
 
97
  key.f3:
97
  btn.debug_board:
98
	call	search
98
	call	open_debug_board
-
 
99
	ret
99
	jc	@f
100
  btn.sysfuncs_txt:
100
	call	check_inv_all
101
	call	open_sysfuncs_txt
101
    @@: ret
-
 
Line 102... Line 102...
102
 
102
	ret
103
 
103
 
104
func search
104
func search
105
	cld
105
	cld
106
	mov	ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
106
	mov	ecx,[cur_editor.Caret.Y]
107
	mov	edx,ecx
107
	mov	edx,ecx
108
	call	get_line_offset
108
	call	get_line_offset
109
	cmp	word[esi],0
109
	cmp	word[esi],0
110
	je	.exit
110
	je	.exit
111
	call	get_real_length
111
	call	get_real_length
112
	add	esi,4
112
	add	esi,4
113
	or	eax,eax
113
	or	eax,eax
114
	jz	.end_line.2
114
	jz	.end_line.2
115
	mov	ecx,eax
115
	mov	ecx,eax
116
	sub	ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
116
	sub	ecx,[cur_editor.Caret.X]
117
	push	esi
117
	push	esi
Line 118... Line 118...
118
	add	esi,[cur_editor.Caret.X] ;! esi,[pos.x]
118
	add	esi,[cur_editor.Caret.X]
119
	jmp	@f
119
	jmp	@f
120
 
120
 
Line 149... Line 149...
149
	cmp	edi,[s_search.size]
149
	cmp	edi,[s_search.size]
150
	jne	.next_ok
150
	jne	.next_ok
Line 151... Line 151...
151
 
151
 
152
  .found:
152
  .found:
153
	add	esp,4
153
	add	esp,4
154
	mov	[cur_editor.Caret.Y],edx ;! [pos.y],edx
154
	mov	[cur_editor.Caret.Y],edx
155
	mov	[cur_editor.SelStart.Y],edx ;! [sel.y],edx
155
	mov	[cur_editor.SelStart.Y],edx
156
	mov	ecx,edx
156
	mov	ecx,edx
157
	lea	eax,[esi-4]
157
	lea	eax,[esi-4]
158
	call	get_line_offset
158
	call	get_line_offset
159
	sub	eax,esi
159
	sub	eax,esi
160
	mov	[cur_editor.SelStart.X],eax ;! [sel.x],eax
160
	mov	[cur_editor.SelStart.X],eax
161
	add	eax,[s_search.size]
161
	add	eax,[s_search.size]
162
	mov	[cur_editor.Caret.X],eax ;! [pos.x],eax
162
	mov	[cur_editor.Caret.X],eax
163
	mov	[s_status],0
163
	mov	[s_status],0
164
	clc
164
	clc
Line 165... Line 165...
165
	ret
165
	ret
166
 
166
 
167
  .end_line:
167
  .end_line:
168
	pop	esi
168
	pop	esi
169
  .end_line.2:
169
  .end_line.2:
170
	movzx	eax,word[esi-4]
170
	movzx	eax,word[esi-4]
171
	add	esi,eax;[esi-4]
171
	add	esi,eax
172
	inc	edx
172
	inc	edx
173
	call	get_real_length
173
	call	get_real_length
174
	mov	ecx,eax
174
	mov	ecx,eax
Line 178... Line 178...
178
  .exit:
178
  .exit:
179
	mov	[s_status],s_text_not_found
179
	mov	[s_status],s_text_not_found
180
	stc
180
	stc
181
	ret
181
	ret
182
endf
182
endf
183
 
-
 
184
  btn.compile:
-
 
185
  key.ctrl_f9:
-
 
186
	mov	bl,0
-
 
187
	call	start_fasm
-
 
188
	ret
-
 
189
  btn.compile_run:
-
 
190
  key.f9:
-
 
191
	mov	bl,1
-
 
192
	call	start_fasm
-
 
193
	ret
-
 
194
  btn.debug_board:
-
 
195
	call	open_debug_board
-
 
196
	ret
-
 
197
  btn.sysfuncs_txt:
-
 
198
	call	open_sysfuncs_txt
-
 
199
	ret
-
 
200
 
-
 
201
  btn.load_file:
-
 
202
  key.ctrl_l:
-
 
203
	call	load_file
-
 
204
	jnc	@f
-
 
205
	ret
-
 
206
    @@:
-
 
207
 
-
 
208
	xor	eax,eax
-
 
209
	mov	[cur_editor.TopLeft.Y],eax ;! [top_line],eax
-
 
210
	mov	[cur_editor.TopLeft.X],eax ;! [left_col],eax
-
 
211
	mov	[cur_editor.Caret.X],eax ;! [pos.x],eax
-
 
212
	mov	[cur_editor.Caret.Y],eax ;! [pos.y],eax
-
 
213
	mov	[cur_editor.SelStart.X],eax ;! [sel.x],eax
-
 
214
	mov	[cur_editor.SelStart.Y],eax ;! [sel.y],eax
-
 
215
 
-
 
216
	mov	[cur_editor.Modified],al ;! [modified],al
-
 
217
 
-
 
218
; enable color syntax for ASM and INC files:
-
 
219
	mov	[cur_editor.AsmMode],al ;! [asm_mode],al
-
 
220
 
-
 
221
;       mov     eax,[f_info.length]
-
 
222
;       add     eax,f_info.path
-
 
223
;       mov     byte[eax],0
-
 
224
	lea	ebx,[cur_editor.FilePath]
-
 
225
	mov	eax,ebx
-
 
226
	call	strlen
-
 
227
	mov	ecx,dword[ebx+eax-3]
-
 
228
	or	ecx,0x202020
-
 
229
	cmp	ecx,'asm'
-
 
230
	jne	@f
-
 
231
	inc	[cur_editor.AsmMode] ;! [asm_mode]
-
 
232
	jmp	.nocol
-
 
233
    @@: cmp	ecx,'inc'
-
 
234
	jne	.nocol
-
 
235
	inc	[cur_editor.AsmMode] ;! [asm_mode]
-
 
236
    .nocol:
-
 
237
 
-
 
238
  update_caption:
-
 
239
	lea	esi,[cur_editor.FilePath] ;! mov     esi,f_info.path
-
 
240
	mov	edi,s_title
-
 
241
 
-
 
242
    @@: lodsb
-
 
243
	cmp	al,0
-
 
244
	je	@f
-
 
245
	stosb
-
 
246
	jmp	@b
-
 
247
    @@:
-
 
248
	;cld
-
 
249
	;mov     ecx,[f_info.length]
-
 
250
	;jecxz   @f
-
 
251
	;rep     movsb
-
 
252
 
-
 
253
	mov	dword[edi],' - '
-
 
254
	add	edi,3
-
 
255
    @@: mov	esi,htext
-
 
256
	mov	ecx,htext.size
-
 
257
	cld
-
 
258
	rep	movsb
-
 
259
 
-
 
260
	mov	al,0
-
 
261
	stosb
-
 
262
 
-
 
263
	mcall	71,1,s_title
-
 
264
 
-
 
265
	clc
-
 
266
	ret
-
 
267
 
-
 
268
  btn.close_main_window:
-
 
269
  key.alt_x:
-
 
270
	mov	esi,self_path
-
 
271
	mov	byte[esi+PATHL-1],0
-
 
272
	mov	edi,f_info.path
-
 
273
	cld
-
 
274
    @@: lodsb
-
 
275
	stosb
-
 
276
	or	al,al
-
 
277
	jnz	@b
-
 
278
 
-
 
279
	mov	[f_info70+0],2
-
 
280
	mov	[f_info70+4],0
-
 
281
	mov	[f_info70+8],0
-
 
282
	mov	[f_info70+12],TINYPAD_END
-
 
283
	mov	[f_info70+16],0
-
 
284
	mov	byte[f_info70+20],0
-
 
285
	mov	[f_info70+21],f_info.path
-
 
286
	mcall	70,f_info70
-
 
287
 
-
 
288
  .close:
-
 
289
	mov	[main_closed],1
-
 
290
	mcall	-1
-