Subversion Repositories Kolibri OS

Rev

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

Rev 824 Rev 1008
1
diff16 'tp-button.asm',0,$
1
diff16 'tp-button.asm',0,$
2
 
2
 
3
button:
3
button:
4
	mcall	17
4
	mcall	17
5
	cmp	al,0
5
	cmp	al,0
6
	jne	still
6
	jne	still
7
	shr	eax,8
7
	shr	eax,8
8
 
8
 
9
	cmp	[bot_mode],0
9
	cmp	[bot_mode],0
10
	je	@f
10
	je	@f
11
	mov	ebx,eax
11
	mov	ebx,eax
12
	mov	al,3
12
	mov	al,3
13
	call	[bot_dlg_handler]
13
	call	[bot_dlg_handler]
14
	jmp	still
14
	jmp	still
15
 
15
 
16
    @@: mov	esi,accel_table2
16
    @@: mov	esi,accel_table2
17
  .acc: cmp	eax,[esi]
17
  .acc: cmp	eax,[esi]
18
	jne	@f
18
	jne	@f
19
	call	dword[esi+4]
19
	call	dword[esi+4]
20
	jmp	still.skip_write
20
	jmp	still.skip_write
21
    @@: add	esi,8
21
    @@: add	esi,8
22
	cmp	byte[esi],0
22
	cmp	byte[esi],0
23
	jne	.acc
23
	jne	.acc
24
 
24
 
25
	cmp	eax,[tab_bar.Buttons.First]
25
	cmp	eax,[tab_bar.Buttons.First]
26
	jb	@f
26
	jb	@f
27
	cmp	eax,[tab_bar.Buttons.Last]
27
	cmp	eax,[tab_bar.Buttons.Last]
28
	ja	@f
28
	ja	@f
29
 
29
 
30
	;// TAB CONTROL BUTTONS
30
	;// TAB CONTROL BUTTONS
31
 
31
 
32
	add	eax,-1000
32
	add	eax,-1000
33
	imul	ebp,eax,sizeof.TABITEM
33
	imul	ebp,eax,sizeof.TABITEM
34
	add	ebp,[tab_bar.Items]
34
	add	ebp,[tab_bar.Items]
35
	cmp	ebp,[tab_bar.Current.Ptr]
35
	cmp	ebp,[tab_bar.Current.Ptr]
36
	je	@f
36
	je	@f
37
	call	set_cur_tab
37
	call	set_cur_tab
38
	call	align_editor_in_tab
38
	call	align_editor_in_tab
39
	call	draw_editor
39
	call	draw_editor
40
	call	draw_statusbar
40
	call	draw_statusbar
41
	call	draw_tabctl
41
	call	draw_tabctl
42
	call	update_caption
42
	call	update_caption
43
 
43
 
44
    @@:
44
    @@:
45
	jmp	still.skip_write
45
	jmp	still.skip_write
46
 
46
 
47
  btn.vscroll_up:
47
  btn.vscroll_up:
48
	dec	[cur_editor.TopLeft.Y]
48
	dec	[cur_editor.TopLeft.Y]
49
	jns	@f
49
	jns	@f
50
	inc	[cur_editor.TopLeft.Y]
50
	inc	[cur_editor.TopLeft.Y]
51
	ret
51
	ret
52
    @@: call	editor_check_for_changes.direct
52
    @@: call	editor_check_for_changes.direct
53
	ret
53
	ret
54
 
54
 
55
  btn.vscroll_down:
55
  btn.vscroll_down:
56
	inc	[cur_editor.TopLeft.Y]
56
	inc	[cur_editor.TopLeft.Y]
57
	mov	eax,[cur_editor.Lines.Count]
57
	mov	eax,[cur_editor.Lines.Count]
58
	sub	eax,[lines.scr]
58
	sub	eax,[lines.scr]
59
	cmp	eax,[cur_editor.TopLeft.Y]
59
	cmp	eax,[cur_editor.TopLeft.Y]
60
	jge	@f
60
	jge	@f
61
	dec	[cur_editor.TopLeft.Y]
61
	dec	[cur_editor.TopLeft.Y]
62
	ret
62
	ret
63
    @@: call	editor_check_for_changes.direct
63
    @@: call	editor_check_for_changes.direct
64
	ret
64
	ret
65
 
65
 
66
  btn.hscroll_up:
66
  btn.hscroll_up:
67
	dec	[cur_editor.TopLeft.X]
67
	dec	[cur_editor.TopLeft.X]
68
	jns	@f
68
	jns	@f
69
	inc	[cur_editor.TopLeft.X]
69
	inc	[cur_editor.TopLeft.X]
70
	ret
70
	ret
71
    @@: call	editor_check_for_changes.direct
71
    @@: call	editor_check_for_changes.direct
72
	ret
72
	ret
73
 
73
 
74
  btn.hscroll_down:
74
  btn.hscroll_down:
75
	inc	[cur_editor.TopLeft.X]
75
	inc	[cur_editor.TopLeft.X]
76
	mov	eax,[cur_editor.Columns.Count]
76
	mov	eax,[cur_editor.Columns.Count]
77
	sub	eax,[columns.scr]
77
	sub	eax,[columns.scr]
78
	cmp	eax,[cur_editor.TopLeft.X]
78
	cmp	eax,[cur_editor.TopLeft.X]
79
	jge	@f
79
	jge	@f
80
	dec	[cur_editor.TopLeft.X]
80
	dec	[cur_editor.TopLeft.X]
81
	ret
81
	ret
82
    @@: call	editor_check_for_changes.direct
82
    @@: call	editor_check_for_changes.direct
83
	ret
83
	ret
84
 
84
 
85
  btn.tabctl_right:
85
  btn.tabctl_right:
86
	call	get_hidden_tabitems_number
86
	call	get_hidden_tabitems_number
87
	or	eax,eax
87
	or	eax,eax
88
	jz	@f
88
	jz	@f
89
	inc	[tab_bar.Items.Left]
89
	inc	[tab_bar.Items.Left]
90
	call	draw_tabctl
90
	call	draw_tabctl
91
    @@: ret
91
    @@: ret
92
  btn.tabctl_left:
92
  btn.tabctl_left:
93
	dec	[tab_bar.Items.Left]
93
	dec	[tab_bar.Items.Left]
94
	jns	@f
94
	jns	@f
95
	inc	[tab_bar.Items.Left]
95
	inc	[tab_bar.Items.Left]
96
    @@: call	draw_tabctl
96
    @@: call	draw_tabctl
97
	ret
97
	ret
98
 
98
 
99
  btn.debug_board:
99
  btn.debug_board:
100
	call	open_debug_board
100
	call	open_debug_board
101
	ret
101
	ret
102
  btn.sysfuncs_txt:
102
  btn.sysfuncs_txt:
103
	call	open_sysfuncs_txt
103
	call	open_sysfuncs_txt
104
	ret
104
	ret
105
 
105
 
106
proc search
106
proc search
107
	cld
107
	cld
108
	mov	ecx,[cur_editor.Caret.Y]
108
	mov	ecx,[cur_editor.Caret.Y]
109
	mov	edx,ecx
109
	mov	edx,ecx
110
	call	get_line_offset
110
	call	get_line_offset
111
	cmp	word[esi],0
111
	cmp	[esi+EDITOR_LINE_DATA.Size],0
112
	je	.exit
112
	je	.exit
113
	call	get_real_length
113
	call	get_real_length
114
	add	esi,4
114
	add	esi,sizeof.EDITOR_LINE_DATA
115
	or	eax,eax
115
	or	eax,eax
116
	jz	.end_line.2
116
	jz	.end_line.2
117
	mov	ecx,eax
117
	mov	ecx,eax
118
	sub	ecx,[cur_editor.Caret.X]
118
	sub	ecx,[cur_editor.Caret.X]
119
	push	esi
119
	push	esi
120
	add	esi,[cur_editor.Caret.X]
120
	add	esi,[cur_editor.Caret.X]
121
	jmp	@f
121
	jmp	@f
122
 
122
 
123
  .next_line:
123
  .next_line:
124
	push	esi
124
	push	esi
125
    @@: sub	ecx,[s_search.size]
125
    @@: sub	ecx,[s_search.size]
126
	inc	ecx
126
	inc	ecx
127
 
127
 
128
  .next_char:
128
  .next_char:
129
	dec	ecx
129
	dec	ecx
130
	js	.end_line
130
	js	.end_line
131
	xor	edi,edi
131
	xor	edi,edi
132
 
132
 
133
  .next_ok:
133
  .next_ok:
134
	movzx	eax,byte[edi+esi]
134
	movzx	eax,byte[edi+esi]
135
	movzx	ebx,byte[edi+s_search]
135
	movzx	ebx,byte[edi+s_search]
136
 
136
 
137
	cmp	al,$61
137
	cmp	al,$61
138
	jb	@f
138
	jb	@f
139
	add	al,[eax+add_table-$61]
139
	add	al,[eax+add_table-$61]
140
    @@: cmp	bl,$61
140
    @@: cmp	bl,$61
141
	jb	@f
141
	jb	@f
142
	add	bl,[ebx+add_table-$61]
142
	add	bl,[ebx+add_table-$61]
143
    @@:
143
    @@:
144
	cmp	al,bl
144
	cmp	al,bl
145
	je	@f
145
	je	@f
146
 
146
 
147
	inc	esi
147
	inc	esi
148
	jmp	.next_char
148
	jmp	.next_char
149
    @@:
149
    @@:
150
	inc	edi
150
	inc	edi
151
	cmp	edi,[s_search.size]
151
	cmp	edi,[s_search.size]
152
	jne	.next_ok
152
	jne	.next_ok
153
 
153
 
154
  .found:
154
  .found:
155
	add	esp,4
155
	add	esp,4
156
	mov	[cur_editor.Caret.Y],edx
156
	mov	[cur_editor.Caret.Y],edx
157
	mov	[cur_editor.SelStart.Y],edx
157
	mov	[cur_editor.SelStart.Y],edx
158
	mov	ecx,edx
158
	mov	ecx,edx
159
	lea	eax,[esi-4]
159
	lea	eax,[esi-sizeof.EDITOR_LINE_DATA]
160
	call	get_line_offset
160
	call	get_line_offset
161
	sub	eax,esi
161
	sub	eax,esi
162
	mov	[cur_editor.SelStart.X],eax
162
	mov	[cur_editor.SelStart.X],eax
163
	add	eax,[s_search.size]
163
	add	eax,[s_search.size]
164
	mov	[cur_editor.Caret.X],eax
164
	mov	[cur_editor.Caret.X],eax
165
	mov	[s_status],0
165
	mov	[s_status],0
166
	clc
166
	clc
167
	ret
167
	ret
168
 
168
 
169
  .end_line:
169
  .end_line:
170
	pop	esi
170
	pop	esi
171
  .end_line.2:
171
  .end_line.2:
172
	movzx	eax,word[esi-4]
172
	mov	eax,[esi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size]
173
	add	esi,eax
173
	add	esi,eax
174
	inc	edx
174
	inc	edx
175
	call	get_real_length
175
	call	get_real_length
176
	mov	ecx,eax
176
	mov	ecx,eax
177
	lodsd
177
	lodsd
-
 
178
	add	esi,2
178
	or	eax,eax
179
	or	eax,eax
179
	jnz	.next_line
180
	jnz	.next_line
180
  .exit:
181
  .exit:
181
	mov	[s_status],s_text_not_found
182
	mov	[s_status],s_text_not_found
182
	stc
183
	stc
183
	ret
184
	ret
184
endp
185
endp