Subversion Repositories Kolibri OS

Rev

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

Rev 259 Rev 297
Line 1... Line -...
1
struct TBOX
-
 
2
  x	 dw ?
-
 
3
  width  dw ?
-
 
4
  y	 dw ?
-
 
5
  height dw ?
-
 
6
  sel.x  db ?
-
 
7
  pos.x  db ?
-
 
8
  ofs.x  db ?
-
 
9
  length db ?
-
 
10
  text	 rb 255
-
 
11
ends
-
 
12
 
-
 
13
virtual at ebp
1
virtual at ebp
14
  tbox TBOX
2
  tbox TBOX
15
end virtual
3
end virtual
Line 16... Line 4...
16
 
4
 
17
tb.pos.x	db ?
5
tb.pos.x	db ?
18
tb.sel.x	db ?
6
tb.sel.x	db ?
Line 19... Line 7...
19
tb.sel.selected db ?
7
tb.sel.selected db ?
20
 
8
 
21
func textbox.get_width
9
func textbox.get_width
22
	push	ebx edx
10
	push	ebx edx
23
	movzx	eax,[tbox.width-2]
11
	movzx	eax,[tbox.width]
24
	add	eax,-6
12
	add	eax,-6
25
	xor	edx,edx
13
	xor	edx,edx
26
	mov	ebx,6
14
	mov	ebx,6
Line 82... Line 70...
82
	ja	@f
70
	ja	@f
83
	xchg	al,ah
71
	xchg	al,ah
84
    @@: mov	[tb.pos.x],al
72
    @@: mov	[tb.pos.x],al
85
	mov	[tb.sel.x],ah
73
	mov	[tb.sel.x],ah
Line 86... Line 74...
86
 
74
 
87
	mcall	13,dword[tbox.x],dword[tbox.y],[color_tbl+4*5];[sc.work]
75
	mcall	13,dword[tbox.width],dword[tbox.height],[color_tbl.back]
88
	mov	edx,[cl_3d_inset]
76
	mov	edx,[cl_3d_inset]
Line 89... Line 77...
89
	call	draw_framerect
77
	call	draw_framerect
90
 
78
 
91
	call	textbox.get_width
79
	call	textbox.get_width
Line 92... Line 80...
92
	mov	esi,eax
80
	mov	esi,eax
93
	mov	edi,eax
81
	mov	edi,eax
94
 
82
 
95
	cmp	ebp,[focused_tb]
83
	cmp	ebp,[focused_tb]
96
	je	@f
84
	je	@f
97
	mov	ebx,dword[tbox.x]
85
	mov	ebx,dword[tbox.x-2]
98
	mov	bx,[tbox.y+2]
86
	mov	bx,[tbox.y]
99
	movzx	eax,[tbox.height-2]
87
	movzx	eax,[tbox.height]
100
	shr	eax,1
88
	shr	eax,1
101
	add	eax,4*65536-4
-
 
102
	add	ebx,eax
89
	add	eax,4*65536-4
103
	lea	edx,[tbox.text]
90
	add	ebx,eax
Line 104... Line 91...
104
;       movzx   esi,[tbox.length]
91
	lea	edx,[tbox.text]
105
	mcall	4,,[color_tbl+4*0];[sc.work_text]
92
	mcall	4,,[color_tbl.text]
106
	ret
93
	ret
Line 121... Line 108...
121
	cmp	eax,ecx
108
	cmp	eax,ecx
122
	jbe	.lp2
109
	jbe	.lp2
123
	mov	eax,ecx
110
	mov	eax,ecx
124
  .lp2: imul	eax,6
111
  .lp2: imul	eax,6
125
	imul	ebx,6
112
	imul	ebx,6
126
	movzx	ecx,[tbox.x+2]
113
	movzx	ecx,[tbox.x]
127
	add	ecx,3
114
	add	ecx,3
128
;       sub     eax,ebx
-
 
129
	add	ebx,ecx
115
	add	ebx,ecx
130
	shl	ebx,16
116
	shl	ebx,16
131
	add	ebx,eax
117
	add	ebx,eax
132
	movzx	ecx,[tbox.height-2]
118
	movzx	ecx,[tbox.height]
133
	shr	ecx,1
119
	shr	ecx,1
134
	add	cx,[tbox.y+2]
120
	add	cx,[tbox.y]
135
	shl	ecx,16
121
	shl	ecx,16
136
	add	ecx,-5*65536+10
122
	add	ecx,-5*65536+10
137
	mcall	13,,,[color_tbl+4*7];0x0000007F
123
	mcall	13,,,[color_tbl.back.sel]
Line 138... Line 124...
138
 
124
 
139
	mov	esi,[esp]
125
	mov	esi,[esp]
140
	lea	edx,[tbox.text]
126
	lea	edx,[tbox.text]
141
	movzx	eax,[tbox.ofs.x]
127
	movzx	eax,[tbox.ofs.x]
142
	add	edx,eax
128
	add	edx,eax
143
	mov	ebx,dword[tbox.x]
129
	mov	ebx,dword[tbox.x-2]
144
	mov	bx,[tbox.y+2]
130
	mov	bx,[tbox.y]
145
	movzx	eax,[tbox.height-2]
131
	movzx	eax,[tbox.height]
146
	shr	eax,1
132
	shr	eax,1
147
	add	eax,4*65536-4
133
	add	eax,4*65536-4
148
	add	ebx,eax
134
	add	ebx,eax
149
	mov	eax,4
135
	mov	eax,4
150
	or	esi,esi
136
	or	esi,esi
151
	jz	.lp3
137
	jz	.lp3
152
	mcall	,,[color_tbl+4*0];[sc.work_text]
138
	mcall	,,[color_tbl.text]
153
  .lp3: sub	edi,esi
139
  .lp3: sub	edi,esi
154
	jnz	.lp4
140
	jnz	.lp4
155
	add	esp,8
141
	add	esp,8
156
	jmp	.exit
142
	jmp	.exit
Line 162... Line 148...
162
	sub	esi,ecx
148
	sub	esi,ecx
163
	cmp	esi,edi
149
	cmp	esi,edi
164
	jbe	.lp5
150
	jbe	.lp5
165
	mov	esi,edi
151
	mov	esi,edi
166
  .lp5:
152
  .lp5:
167
	mcall	,,[color_tbl+4*6];0x00FFFFFF
153
	mcall	,,[color_tbl.text.sel]
168
	sub	edi,esi
154
	sub	edi,esi
169
	jz	.exit
155
	jz	.exit
170
	add	edx,esi
156
	add	edx,esi
171
	imul	esi,6*65536
157
	imul	esi,6*65536
172
	add	ebx,esi
158
	add	ebx,esi
173
	lea	ecx,[tbox.text]
159
	lea	ecx,[tbox.text]
174
;        sub     ecx,edx
-
 
175
;        add     edi,ecx
-
 
176
	mcall	,,[color_tbl+4*0],,edi;[sc.work_text],,edi
160
	mcall	,,[color_tbl.text],,edi
177
	jmp	.exit
161
	jmp	.exit
Line 178... Line 162...
178
 
162
 
179
    @@: lea	edx,[tbox.text]
163
    @@: lea	edx,[tbox.text]
180
	movzx	eax,[tbox.ofs.x]
164
	movzx	eax,[tbox.ofs.x]
181
	add	edx,eax
165
	add	edx,eax
182
	mov	ebx,dword[tbox.x]
166
	mov	ebx,dword[tbox.x-2]
183
	mov	bx,[tbox.y+2]
167
	mov	bx,[tbox.y]
184
	movzx	eax,[tbox.height-2]
168
	movzx	eax,[tbox.height]
185
	shr	eax,1
169
	shr	eax,1
186
	add	eax,4*65536-4
170
	add	eax,4*65536-4
187
	add	ebx,eax
171
	add	ebx,eax
188
	movzx	eax,[tbox.ofs.x]
172
	movzx	eax,[tbox.ofs.x]
189
	call	textbox.get_width
173
	call	textbox.get_width
190
	mov	esi,eax
174
	mov	esi,eax
Line 191... Line 175...
191
	mcall	4,,[color_tbl+4*0];[sc.work_text]
175
	mcall	4,,[color_tbl.text]
192
 
176
 
193
  .exit:
177
  .exit:
194
	movzx	ebx,[tbox.pos.x]
178
	movzx	ebx,[tbox.pos.x]
195
	movzx	eax,[tbox.ofs.x]
179
	movzx	eax,[tbox.ofs.x]
196
	sub	ebx,eax
180
	sub	ebx,eax
197
	imul	ebx,6
181
	imul	ebx,6
198
	movzx	eax,[tbox.x+2]
182
	movzx	eax,[tbox.x]
199
	add	eax,3
183
	add	eax,3
200
	add	ebx,eax
184
	add	ebx,eax
201
	push	bx
185
	push	bx
202
	shl	ebx,16
186
	shl	ebx,16
203
	pop	bx
187
	pop	bx
204
	movzx	ecx,[tbox.height-2]
188
	movzx	ecx,[tbox.height]
205
	shr	ecx,1
189
	shr	ecx,1
206
	add	cx,[tbox.y+2]
190
	add	cx,[tbox.y]
207
	push	cx
191
	push	cx
208
	shl	ecx,16
192
	shl	ecx,16
209
	pop	cx
193
	pop	cx