files
KOS_qrcodes/programs/develop/libGUI/src/text.inc
andrew_programmer 6cdf720037 That new in this version:
1) Transfer of parameters to functions of library is copied on the convention stdcall.

2) Now functions link on names.

3)Now, if to guide the mouse on a component and to press the left button of the mouse all 
messages from the mouse are sent only to this component.If to release(let off) the left 
button of the mouse messages from the mouse again become accessible to all components.

4) In library new functions are added.
  int Version (void) - to receive the version of library. The version comes back in a format: year + month + day. 
  The current library has version 71014.
  void RemoveComponent (void *Control, int new_x, int new_y) - moves a component to new coordinates.
  void ResizeComponent (void *Control, int new_sizex, int new_sizey) - changes the size of a component.
  Examples of use of these functions look in example Bookmark.
 
5) The example of work with libGUI in programming language C is added. This example is a part of the interface 
   written by me for my scientific program.

git-svn-id: svn://kolibrios.org@648 a494cfbc-eb01-0410-851d-a64ba20cac60
2007-10-15 10:45:36 +00:00

151 lines
3.4 KiB
PHP

tx_control_data_size = 22
tx_no_show_text = 1b
tx_redraw_all = 10000000b
tx_redraw_all_off = 01111111b
tx_special_redraw_on = 100b
tx_special_redraw_off = 11111011b
;****************************************************
;********************craete Text**********************
;****************************************************
;IN
;pointer to parend
;pointer to Text's structure
;OUT
;pointer to initialized Texr's structure
align 4
craete_text:
mov ebx,[esp+4]
mov eax,[esp+8]
mov [PointerToStructureForText],eax
mov eax,control_header_size+tx_control_data_size
call craete_control
;set all image's parameters in control
mov [eax],dword text
mov ecx,tx_control_data_size
mov esi,[PointerToStructureForText]
mov edi,eax
add edi,control_header_size
rep movsb
call get_skin_height
mov ebx,[PointerToStructureForText]
mov ecx,[ebx+6] ;x
mov edx,[ebx+10] ;y
mov esi,[ebx+14] ;length x
imul esi,6
add ecx,border_width
add edx,[skin_height]
;copy information to control
mov [eax+24],ecx
mov [eax+28],edx
mov [eax+32],esi
mov [eax+36],dword 9
ret 8
;****************************************************
;********************Draw Text**********************
;****************************************************
;IN
;pointer to control of text
;message
;OUT
;not returned value
align 4
text:
;get message
mov eax,[esp+8]
;get pointer to control of image
mov esi,[esp+4]
mov [PointerForText],esi
;copy control to local control
add esi,control_header_size
mov edi,dword Text
mov ecx,tx_control_data_size
rep movsb
cmp [eax],dword 1
jne no_redraw_all_text
xor ebx,ebx
mov bl,[Text.type]
and bl,tx_no_show_text
test bl,bl
jnz no_redraw_all_text
or [Text.type],tx_redraw_all
no_redraw_all_text:
cmp [eax],dword 3
jne no_special_message_for_text
xor ebx,ebx
mov bl,[Text.type]
and bl,tx_special_redraw_on
test bl,bl
jz no_special_message_for_text
or [Text.type],tx_redraw_all
and [Text.type],tx_special_redraw_off
no_special_message_for_text:
;load coordinats and size from control
mov eax,[PointerForText]
mov ebx,[eax+24] ;x
mov ecx,[eax+28] ;y
;set current coordinats and sizes in zakladka
mov [Text.x],ebx
mov [Text.y],ecx
;get standart colors table
mov eax,48
mov ebx,3
mov ecx,dword pointer2
mov edx,40
mcall
xor eax,eax
mov al,[Text.type]
and al,tx_redraw_all
test al,al
jz no_redraw_text_
and [Text.type],tx_redraw_all_off
mov esi,dword Text
mov edi,[PointerForText]
add edi,control_header_size
mov ecx,2
rep movsb
mov eax,4
mov ebx,[Text.x]
shl ebx,16
add ebx,[Text.y]
mov ecx,[Text.color]
mov edx,[Text.pointer]
mov esi,[Text.length]
mov edi,[pointer2+8]
mcall
no_redraw_text_:
exit_text:
ret 8