fix interface calculating,

fix scroll broken in 6352,
fix keyboard function

git-svn-id: svn://kolibrios.org@6357 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2016-03-19 09:57:37 +00:00
parent 33d91d9843
commit 6f44ae55dd
11 changed files with 183 additions and 216 deletions

View File

@ -43,6 +43,21 @@ include '../../../libio.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
;---------------------------------------------------------
; *** ª®­áâ ­âë ¤«ï ¨­â¥àä¥©á  ***
; ®ª­® । ªâ®à 
ci_edit_wnd_x_pos equ 5 ;ª®®à¤¨­ â  x ¤«ï ®ª­  । ªâ®à 
ci_edit_wnd_y_pos equ 87 ;ª®®à¤¨­ â  y ¤«ï ®ª­  । ªâ®à 
ci_edit_wnd_border equ 3 ;à ¬ª  ¢®ªà㣠®ª­  । ªâ®à 
; áªà®««¨­£¨
ci_scrollh_coord_x_min equ (ci_edit_wnd_x_pos+3) ;¬¨­¨¬ «ì­ ï ¯®§¨æ¨ï ¯®«§ã­ª 
;£®à¨§®­â «ì­®£® áªà®««¨­£ 
ci_scrollv_coord_y_min equ (ci_edit_wnd_y_pos+3) ;¬¨­¨¬ «ì­ ï ¯®§¨æ¨ï ¯®«§ã­ª 
;¢¥à⨪ «ì­®£® áªà®««¨­£ 
;---------------------------------------------------------
include 'bmplib.inc' include 'bmplib.inc'
include 'dialog2.inc' include 'dialog2.inc'
include 'design.inc' include 'design.inc'
@ -59,9 +74,7 @@ load_libraries l_libs_start,end_l_libs
cmp eax,-1 cmp eax,-1
jz close jz close
;--------------------------------------------------------
;---------------set events mask--------------------------
;--------------------------------------------------------
mcall SF_SET_EVENTS_MASK,0x80000067 ; 1100111b mcall SF_SET_EVENTS_MASK,0x80000067 ; 1100111b
;--------------------------------------------------------- ;---------------------------------------------------------
;-----------------------init data------------------------- ;-----------------------init data-------------------------
@ -138,9 +151,6 @@ copy_str_1:
jnz @b jnz @b
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
;---------------------------------------------------------
;---------------------------------------------------------
;---------------------------------------------------------
include 'events.inc' include 'events.inc'
include 'events_of_window.inc' include 'events_of_window.inc'
include 'events_of_keys.inc' include 'events_of_keys.inc'
@ -177,25 +187,18 @@ file 'panel_buttons.png'
;****************cursors****************** ;****************cursors******************
brush_cursor: brush_cursor:
file 'brush.cur' file 'brush.cur'
;----------------------------------------------------------
flood_fill_cursor: flood_fill_cursor:
file 'flood_fill.cur' file 'flood_fill.cur'
;----------------------------------------------------------
lastik_cursor: lastik_cursor:
file 'lastik.cur' file 'lastik.cur'
;----------------------------------------------------------
other_cursor: other_cursor:
file 'other.cur' file 'other.cur'
;----------------------------------------------------------
pencil_cursor: pencil_cursor:
file 'pencil.cur' file 'pencil.cur'
;----------------------------------------------------------
pipette_cursor: pipette_cursor:
file 'pipette.cur' file 'pipette.cur'
;----------------------------------------------------------
spray_cursor: spray_cursor:
file 'spray.cur' file 'spray.cur'
;----------------------------------------------------------
zoom_cursor: zoom_cursor:
file 'zoom.cur' file 'zoom.cur'
;---------------------------------------------------------- ;----------------------------------------------------------
@ -268,7 +271,7 @@ Scroll1CoordinatX rd 1 ;scroll x screen position
Scroll1CoordinatY rd 1 ;scroll y screen position Scroll1CoordinatY rd 1 ;scroll y screen position
Scroll1MaxSizeX rd 1 Scroll1MaxSizeX rd 1
Scroll1MaxSizeY rd 1 Scroll1MaxSizeY rd 1
Scroll1SizeX rd 1 Scroll1SizeX rd 1 ;scroll polzunok size
Scroll1FreeX rd 1 Scroll1FreeX rd 1
Scroll2CoordinatX rd 1 Scroll2CoordinatX rd 1

View File

@ -1,4 +1,10 @@
;---------------------------------------------------------- ;----------------------------------------------------------
;input:
; eax - start X
; ebx - start Y
; ecx - size X
; edx - size Y
; esi - colos styles (1...7)
draw_volume_rectangle: draw_volume_rectangle:
mov [line_x],eax mov [line_x],eax
mov [line_y],ebx mov [line_y],ebx
@ -83,7 +89,7 @@ exit_colors:
add ebx,[line_size_x] add ebx,[line_size_x]
add ecx,[line_size_y] add ecx,[line_size_y]
mov edx,[color_rectangle] mov edx,[color_rectangle]
call draw_rectangle mcall SF_DRAW_RECT
;line 1 ;line 1
mov edx,[color_line1] mov edx,[color_line1]
mov ebx,[line_x] mov ebx,[line_x]
@ -197,14 +203,13 @@ no_light_rectangle:
mov [line_size_x],ecx mov [line_size_x],ecx
mov [line_size_y],edx mov [line_size_y],edx
mov edx,esi mov edx,esi
mov eax,13
mov ebx,[line_x] mov ebx,[line_x]
mov ecx,[line_y] mov ecx,[line_y]
shl ebx,16 shl ebx,16
shl ecx,16 shl ecx,16
add ebx,[line_size_x] add ebx,[line_size_x]
add ecx,[line_size_y] add ecx,[line_size_y]
mcall mcall SF_DRAW_RECT
ret ret
;---------------------------------------------------------- ;----------------------------------------------------------
draw_conture: draw_conture:
@ -280,20 +285,14 @@ columnus_true:
print_text: print_text:
mov [text_x],eax mov [text_x],eax
mov [text_y],ebx mov [text_y],ebx
mov eax,4
mov ebx,[text_x] mov ebx,[text_x]
shl ebx,16 shl ebx,16
add ebx,[text_y] add ebx,[text_y]
mcall mcall SF_DRAW_TEXT
ret ret
;---------------------------------------------------------- ;----------------------------------------------------------
draw_rectangle:
mcall 13
ret
;------------------------
draw_line: draw_line:
mov eax,38 mcall SF_DRAW_LINE
mcall
ret ret
;---------------------------------------------------------- ;----------------------------------------------------------
;lightlin 12508927 ;lightlin 12508927

View File

@ -1,15 +1,29 @@
;---------------------------------------------------------- ;----------------------------------------------------------
;---------------------system events------------------------ ;---------------------system events------------------------
;---------------------------------------------------------- ;----------------------------------------------------------
align 4
event: event:
mov eax,10 mcall SF_WAIT_EVENT
mcall
ret ret
;---------------------------------------------------------
;---------------SOUND of EVENTS--------------------------- ;----------------------------------------------------------
;--------------------------------------------------------- ;---------------------sound of events----------------------
;----------------------------------------------------------
align 4
sound: sound:
mov eax,55 mcall SF_SPEAKER_PLAY,55
mov ebx,eax ret
mcall
ret ;----------------------------------------------------------
;---------------------user events--------------------------
;----------------------------------------------------------
;description:
; ¯¥à¥¬¥é¥­¨¥ áªà®««¨­£®¢ ¢ «¥¢ë© ¢¥àå­¨© 㣮« (0,0)
align 4
scrollbar_move_00:
and [PosX],0
and [PosY],0
mov [Scroll1CoordinatX],ci_scrollh_coord_x_min
mov [Scroll2CoordinatY],ci_scrollv_coord_y_min
ret

View File

@ -1,86 +1,81 @@
;------------------------------------------ ;------------------------------------------
;-------------KEYS------------------------- ;-------------KEYS-------------------------
;------------------------------------------ ;------------------------------------------
keys: align 4
keys:
mov eax,2 mcall SF_GET_KEY
mcall
shr eax,8 shr eax,8
cmp eax,176 cmp al,176
jne key2 jne key2
sub [PosX],20 sub [PosX],20
jmp change_screen jmp change_screen
key2: key2:
cmp eax,179 cmp al,179
jne key3 jne key3
add [PosX],20 add [PosX],20
jmp change_screen jmp change_screen
key3: key3:
cmp eax,177 cmp al,177
jne key4 jne key4
add [PosY],20 add [PosY],20
jmp change_screen jmp change_screen
key4: key4:
cmp eax,178 cmp al,178
jne key5 jne key5
sub [PosY],20 sub [PosY],20
jmp change_screen jmp change_screen
key5: key5:
cmp eax,49 cmp al,49 ;1
jne key6 jne key6
mov [k],1 mov [k],1
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
call drawwin call drawwin
jmp change_screen jmp change_screen
key6: key6:
cmp eax,50 cmp al,50 ;2
jne key7 jne key7
mov [k],2 mov [k],2
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
call drawwin call drawwin
jmp change_screen jmp change_screen
key7: key7:
cmp eax,52 cmp al,52 ;4
jne key8 jne key8
mov [k],4 mov [k],4
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
call drawwin call drawwin
jmp change_screen jmp change_screen
key8: key8:
cmp eax,56 cmp al,56 ;8
jne key9 jne key9
mov [k],8 mov [k],8
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
call drawwin call drawwin
jmp change_screen jmp change_screen
key9: key9:
cmp eax,48 cmp al,48 ;0
jne key10 jne key10
mov [k],16 mov [k],16
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
call drawwin call drawwin
jmp change_screen jmp change_screen
key10: key10:
cmp eax,255 cmp al,255
jne key11 jne key11
call analizing_picture_to_palette call analizing_picture_to_palette
call drawwin call drawwin
jmp change_screen jmp change_screen
key11: key11:
cmp eax,27 ;cmp al,27 ;Esc
jne still ;jne still
jmp still
mov eax,CursorsID mov eax,CursorsID
call delete_cursors call delete_cursors
close: close:
mov eax,-1 mcall SF_TERMINATE_PROCESS
mcall
jmp still jmp still

View File

@ -45,8 +45,8 @@ no_redraw_panel:
mov ebx,[MouseY] mov ebx,[MouseY]
mov ecx,[WorkScreen_SizeX] mov ecx,[WorkScreen_SizeX]
mov edx,[WorkScreen_SizeY] mov edx,[WorkScreen_SizeY]
add ecx,9 add ecx,ci_scrollh_coord_x_min
add edx,89 add edx,ci_scrollv_coord_y_min
cmp eax,ecx cmp eax,ecx
jae mouse_scroll jae mouse_scroll
@ -74,13 +74,13 @@ mouse_scroll:
test eax,eax test eax,eax
jz no_horizontal jz no_horizontal
mov eax,9 mov eax,ci_scrollh_coord_x_min
mov ebx,[Scroll1CoordinatY] mov ebx,[Scroll1CoordinatY]
mov ecx,[Scroll1MaxSizeX] mov ecx,[Scroll1MaxSizeX]
inc ecx
mov edx,14+10 mov edx,14+10
mov esi,7 mov esi,7
inc ecx call draw_volume_rectangle ; horizontal scrollbar clear
call draw_volume_rectangle
mov eax,[MouseX] mov eax,[MouseX]
mov ebx,[Scroll1SizeX] mov ebx,[Scroll1SizeX]
@ -88,13 +88,13 @@ mouse_scroll:
sub eax,ebx sub eax,ebx
mov ecx,[MouseX] mov ecx,[MouseX]
add ecx,ebx add ecx,ebx
mov edx,8+1 mov edx,ci_scrollh_coord_x_min
add edx,[Scroll1MaxSizeX] add edx,[Scroll1MaxSizeX]
mov [Scroll1CoordinatX],eax mov [Scroll1CoordinatX],eax
sub eax,9 sub eax,ci_scrollh_coord_x_min
jns no_min_scroll jns no_min_scroll
mov [Scroll1CoordinatX],9 mov [Scroll1CoordinatX],ci_scrollh_coord_x_min
no_min_scroll: no_min_scroll:
cmp ecx,edx cmp ecx,edx
@ -106,7 +106,7 @@ no_min_scroll:
no_max_scroll: no_max_scroll:
mov eax,[Scroll1CoordinatX] mov eax,[Scroll1CoordinatX]
sub eax,9 sub eax,ci_scrollh_coord_x_min
mov ebx,[Picture_SizeX] mov ebx,[Picture_SizeX]
imul eax,ebx imul eax,ebx
mov ebx,[Scroll1MaxSizeX] mov ebx,[Scroll1MaxSizeX]
@ -127,12 +127,12 @@ no_horizontal:
jz no_vertical jz no_vertical
mov eax,[Scroll2CoordinatX] mov eax,[Scroll2CoordinatX]
mov ebx,89 mov ebx,ci_scrollv_coord_y_min
mov ecx,14+10 mov ecx,14+10
mov edx,[Scroll2MaxSizeY] mov edx,[Scroll2MaxSizeY]
inc edx
mov esi,7 mov esi,7
inc edx call draw_volume_rectangle ; vertical scrollbar clear
call draw_volume_rectangle
mov eax,[MouseY] mov eax,[MouseY]
mov ebx,[Scroll2SizeY] mov ebx,[Scroll2SizeY]
@ -140,14 +140,14 @@ no_horizontal:
sub eax,ebx sub eax,ebx
mov ecx,[MouseY] mov ecx,[MouseY]
add ecx,ebx add ecx,ebx
mov edx,89 mov edx,ci_scrollv_coord_y_min
add edx,[Scroll2MaxSizeY] add edx,[Scroll2MaxSizeY]
mov [Scroll2CoordinatY],eax mov [Scroll2CoordinatY],eax
sub eax,89 sub eax,ci_scrollv_coord_y_min
jns no_min_scroll2 jns no_min_scroll2
mov [Scroll2CoordinatY],89 mov [Scroll2CoordinatY],ci_scrollv_coord_y_min
no_min_scroll2: no_min_scroll2:
cmp ecx,edx cmp ecx,edx
@ -159,7 +159,7 @@ no_min_scroll2:
no_max_scroll2: no_max_scroll2:
mov eax,[Scroll2CoordinatY] mov eax,[Scroll2CoordinatY]
sub eax,89 sub eax,ci_scrollv_coord_y_min
mov ebx,[Picture_SizeY] mov ebx,[Picture_SizeY]
imul eax,ebx imul eax,ebx
mov ebx,[Scroll2MaxSizeY] mov ebx,[Scroll2MaxSizeY]
@ -183,13 +183,13 @@ no_scrollers:
sub ecx,36 sub ecx,36
sub edx,35 sub edx,35
cmp eax,9 cmp eax,ci_scrollh_coord_x_min
jle not_work_arrea jle not_work_arrea
cmp eax,ecx cmp eax,ecx
jae not_work_arrea jae not_work_arrea
cmp ebx,20+15+1+50 cmp ebx,ci_scrollv_coord_y_min
jle not_work_arrea jle not_work_arrea
cmp ebx,edx cmp ebx,edx

View File

@ -12,27 +12,22 @@ drawwin:
mov edx,[esi+46] mov edx,[esi+46]
mov [Window_CordinatX],eax mov [Window_CordinatX],eax
mov [Window_CordinatY],ebx mov [Window_CordinatY],ebx
mov [Window_SizeX],ecx
mov [Window_SizeY],edx cmp ecx,585
jae @f
cmp [Window_SizeX],585 mov ecx,585 ;minimum size x
jae no_minimum_size_x @@:
mov [Window_SizeX],585
mov ecx,[Window_SizeX]
no_minimum_size_x:
cmp [Window_SizeY],400 cmp [Window_SizeY],400
jae no_minimum_size_y jae @f
mov edx,400 ;minimum size y
@@:
mov [Window_SizeX],ecx
mov [Window_SizeY],edx
mov [Window_SizeY],400
mov edx,[Window_SizeY]
no_minimum_size_y:
mov [MaxWorkScreen_SizeX],ecx mov [MaxWorkScreen_SizeX],ecx
mov [MaxWorkScreen_SizeY],edx mov [MaxWorkScreen_SizeY],edx
sub [MaxWorkScreen_SizeX],20+10+5+10 sub [MaxWorkScreen_SizeX],ci_edit_wnd_x_pos+2*ci_edit_wnd_border+34
sub [MaxWorkScreen_SizeY],20+10+15+1+49+20+10 sub [MaxWorkScreen_SizeY],ci_edit_wnd_y_pos+2*ci_edit_wnd_border+34
cmp [MaxWorkScreen_SizeX],0 cmp [MaxWorkScreen_SizeX],0
jns no_znak1 jns no_znak1
@ -88,71 +83,53 @@ no_znak2:
call MovePictureToWorkScreen call MovePictureToWorkScreen
;------------------------------------------------ ;------------------------------------------------
mov ebx,[WorkScreen_SizeX] mov ebx,[WorkScreen_SizeX]
add ebx,5+3 add ebx,ci_edit_wnd_x_pos+ci_edit_wnd_border
mov edx,[Window_SizeX]
sub edx,ebx
sub edx,25+10-3
shl ebx,16 shl ebx,16
mov bx,dx mov bx,ci_edit_wnd_border ;è¨à¨­  ¡®à¤îà 
mov ecx,20+15+1+49+2 mov ecx,ci_edit_wnd_y_pos+ci_edit_wnd_border
mov edx,[Window_SizeY] mov edx,[Window_SizeY]
mov eax,[WorkScreen_SizeY] sub edx,ci_edit_wnd_y_pos+2*ci_edit_wnd_border+34
shr eax,16
sub edx,eax
sub edx,20+15+1+49+2+25+10
shl ecx,16 shl ecx,16
mov cx,dx mov cx,dx ;¢ëá®â  ¡®à¤îà 
mcall SF_DRAW_RECT,,,0xc7cbcf mcall SF_DRAW_RECT,,,0xc7cbcf ;¡®à¤îà á¯à ¢  ®â ®ª­  ¯¥à¥¤ áªà®««¨­£®¬
;------------------------------------------------ ;------------------------------------------------
mcall ,<5,3> mcall ,<ci_edit_wnd_x_pos,ci_edit_wnd_border> ;¡®à¤îà á«¥¢  ®â ®ª­ 
;------------------------------------------------ ;------------------------------------------------
mov ebx,5 mov ebx,ci_edit_wnd_x_pos
mov edx,[Window_SizeX] mov edx,[Window_SizeX]
mov eax,[WorkScreen_SizeX] sub edx,25+10+ci_edit_wnd_x_pos
shr eax,16
sub edx,eax
sub edx,25+10
shl ebx,16 shl ebx,16
mov bx,dx mov bx,dx ;è¨à¨­  ¡®à¤îà 
mov ecx,[WorkScreen_SizeY] mov ecx,[WorkScreen_SizeY]
add ecx,20+15+1+49+2+3 add ecx,ci_edit_wnd_y_pos+ci_edit_wnd_border
mov edx,[Window_SizeY]
sub edx,ecx
sub edx,25+10-3
shl ecx,16 shl ecx,16
mov cx,dx mov cx,ci_edit_wnd_border ;¢ëá®â  ¡®à¤îà 
mcall SF_DRAW_RECT,,,0xc7cbcf mcall SF_DRAW_RECT,,,0xc7cbcf ;¡®à¤îà ¯®¤ ®ª­®¬ ¨ ­ ¤ áªà®««¨­£®¬
;------------------------------------------------ ;------------------------------------------------
mcall ,,<20+15+1+49+2,3> mcall ,,<ci_edit_wnd_y_pos,ci_edit_wnd_border> ;¡®à¤îà ¯®¤ ¯ ­¥«ìî ¨ ­ ¤ ®ª­®¬
;------------------------------------------------ ;------------------------------------------------
; draw_volume_rectangle mov eax,ci_edit_wnd_x_pos
; eax - start X
; ebx - start Y
; ecx - size X
; edx - size Y
mov eax,5
mov ebx,[Window_SizeY] mov ebx,[Window_SizeY]
mov ecx,[Window_SizeX] mov ecx,[Window_SizeX]
mov edx,20+10 mov edx,20+10
mov esi,3 mov esi,3
sub ecx,30 sub ecx,35+ci_edit_wnd_x_pos
sub ebx,25+10 sub ebx,25+10
call draw_volume_rectangle ; horizontal scrollbar call draw_volume_rectangle ; horizontal scrollbar border
;------------------------------------------------ ;------------------------------------------------
mov eax,[Window_SizeX] mov eax,[Window_SizeX]
mov ebx,20+15+1+49+2 mov ebx,ci_edit_wnd_y_pos
mov ecx,20+10 mov ecx,20+10
mov edx,[Window_SizeY] mov edx,[Window_SizeY]
mov esi,3 mov esi,3
sub eax,25+10 sub eax,25+10
sub edx,20+15+1+49+5+20 sub edx,35+ci_edit_wnd_y_pos
call draw_volume_rectangle ; vertical scrollbar call draw_volume_rectangle ; vertical scrollbar border
call draw_scrollers call draw_scrollers
;------------------------------------------------ ;------------------------------------------------
mov eax,[Window_SizeX] mov eax,[Window_SizeX]
mov ebx,[Window_SizeY] mov ebx,[Window_SizeY]
@ -161,7 +138,7 @@ no_znak2:
mov esi,6 mov esi,6
sub eax,25+10 sub eax,25+10
sub ebx,25+10 sub ebx,25+10
call draw_volume_rectangle ; down and right small area call draw_volume_rectangle ; down and right small area
;------------------------------------------------ ;------------------------------------------------
.end: .end:
mcall SF_REDRAW,SSF_END_DRAW mcall SF_REDRAW,SSF_END_DRAW

View File

@ -33,7 +33,6 @@ draw_icons:
main_buttons: main_buttons:
mov eax,8
mov ebx,[Icon_X] mov ebx,[Icon_X]
mov ecx,[Icon_Y] mov ecx,[Icon_Y]
dec ebx dec ebx
@ -45,7 +44,7 @@ draw_icons:
mov edx,[counter] mov edx,[counter]
add edx,10 add edx,10
add edx,1000000000000000000000000000000b add edx,1000000000000000000000000000000b
mcall mcall SF_DEFINE_BUTTON
add [Icon_X],22 add [Icon_X],22
@ -63,7 +62,6 @@ draw_icons:
next_button_brush: next_button_brush:
mov eax,8
mov ebx,[Icon_X] mov ebx,[Icon_X]
mov ecx,[Icon_Y] mov ecx,[Icon_Y]
dec ebx dec ebx
@ -75,7 +73,7 @@ draw_icons:
mov edx,[counter] mov edx,[counter]
add edx,40 add edx,40
add edx,1000000000000000000000000000000b add edx,1000000000000000000000000000000b
mcall mcall SF_DEFINE_BUTTON
add [Icon_X],19 add [Icon_X],19
@ -92,7 +90,6 @@ draw_icons:
next_button_zoom: next_button_zoom:
mov eax,8
mov ebx,[Icon_X] mov ebx,[Icon_X]
mov ecx,[Icon_Y] mov ecx,[Icon_Y]
dec ebx dec ebx
@ -104,7 +101,7 @@ draw_icons:
mov edx,[counter] mov edx,[counter]
add edx,45 add edx,45
add edx,1000000000000000000000000000000b add edx,1000000000000000000000000000000b
mcall mcall SF_DEFINE_BUTTON
add [Icon_X],19 add [Icon_X],19
@ -117,7 +114,6 @@ draw_icons:
mov [Icon_X],7+105+1 mov [Icon_X],7+105+1
mov [Icon_Y],19+15+4+25+1 mov [Icon_Y],19+15+4+25+1
mov eax,8
mov ebx,[Icon_X] mov ebx,[Icon_X]
mov ecx,[Icon_Y] mov ecx,[Icon_Y]
dec ebx dec ebx
@ -128,13 +124,12 @@ draw_icons:
add ecx,21 add ecx,21
mov edx,51 mov edx,51
add edx,1000000000000000000000000000000b add edx,1000000000000000000000000000000b
mcall mcall SF_DEFINE_BUTTON
; button of color ; button of color
mov [Icon_X],7+128+1 mov [Icon_X],7+128+1
mov [Icon_Y],19+15+4+25+1 mov [Icon_Y],19+15+4+25+1
mov eax,8
mov ebx,[Icon_X] mov ebx,[Icon_X]
mov ecx,[Icon_Y] mov ecx,[Icon_Y]
dec ebx dec ebx
@ -145,12 +140,8 @@ draw_icons:
add ecx,20 add ecx,20
mov edx,52 mov edx,52
add edx,1000000000000000000000000000000b add edx,1000000000000000000000000000000b
mcall mcall SF_DEFINE_BUTTON
mov eax,13 mcall SF_DRAW_RECT, 136*65536+19,64*65536+19,[Color]
mov ebx,136*65536+19
mov ecx,64*65536+19
mov edx,[Color]
mcall
ret ret

View File

@ -1005,8 +1005,7 @@ TakeButtonInstruments:
cmp eax,45 cmp eax,45
jne no_1_ jne no_1_
mov [k],1 mov [k],1
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
and [Current_instrument],0 and [Current_instrument],0
call drawwin call drawwin
jmp still jmp still
@ -1017,8 +1016,7 @@ TakeButtonInstruments:
jne no_2_ jne no_2_
mov [k],2 mov [k],2
call drawwin call drawwin
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
and [Current_instrument],0 and [Current_instrument],0
jmp still jmp still
no_2_: no_2_:
@ -1029,8 +1027,7 @@ TakeButtonInstruments:
jne no_3_ jne no_3_
mov [k],3 mov [k],3
call drawwin call drawwin
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
and [Current_instrument],0 and [Current_instrument],0
jmp still jmp still
no_3_: no_3_:
@ -1040,8 +1037,7 @@ TakeButtonInstruments:
jne no_4_ jne no_4_
mov [k],4 mov [k],4
call drawwin call drawwin
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
and [Current_instrument],0 and [Current_instrument],0
jmp still jmp still
no_4_: no_4_:
@ -1051,8 +1047,7 @@ TakeButtonInstruments:
jne no_8_ jne no_8_
mov [k],8 mov [k],8
call drawwin call drawwin
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
and [Current_instrument],0 and [Current_instrument],0
jmp still jmp still
no_8_: no_8_:
@ -1062,8 +1057,7 @@ TakeButtonInstruments:
jne no_16_ jne no_16_
mov [k],16 mov [k],16
call drawwin call drawwin
mov [Scroll1CoordinatX],9 call scrollbar_move_00
mov [Scroll2CoordinatY],89
and [Current_instrument],0 and [Current_instrument],0
jmp still jmp still
no_16_: no_16_:

View File

@ -60,10 +60,6 @@ prepare_data_pointers:
mov [PointerToPalette],eax mov [PointerToPalette],eax
mov [ReserveArray],eax mov [ReserveArray],eax
;®¡­ã«¥­¨¥ áªà®««¨­£  call scrollbar_move_00 ;®¡­ã«¥­¨¥ áªà®««¨­£ 
and [PosX],0
and [PosY],0
mov [Scroll1CoordinatX],9 ;8+1
mov [Scroll2CoordinatY],89 ;20+15+1+50+3
ret ret
;--------------------------------------------------------- ;---------------------------------------------------------

View File

@ -267,7 +267,7 @@ PrintMousePos:
mov ecx,52 mov ecx,52
mov edx,18 mov edx,18
mov esi,4 mov esi,4
call draw_volume_rectangle call draw_volume_rectangle ; border for mouse x pos
mov eax,[Window_SizeX] mov eax,[Window_SizeX]
sub eax,75 sub eax,75
@ -275,7 +275,7 @@ PrintMousePos:
mov ecx,52 mov ecx,52
mov edx,18 mov edx,18
mov esi,4 mov esi,4
call draw_volume_rectangle call draw_volume_rectangle ; border for mouse y pos
mov eax,[Window_SizeX] mov eax,[Window_SizeX]
sub eax,70 sub eax,70
@ -344,10 +344,9 @@ draw_scrollers:
mov ebx,[Window_SizeY] mov ebx,[Window_SizeY]
sub ebx,22+10 sub ebx,22+10
mov ecx,[Window_SizeX] mov ecx,[Window_SizeX]
sub ecx,10+5+20+10+1 sub ecx,39+ci_scrollh_coord_x_min
mov edx,14+10 mov edx,14+10
mov esi,1 mov esi,1
mov [Scroll1CoordinatX],eax
mov [Scroll1CoordinatY],ebx mov [Scroll1CoordinatY],ebx
mov [Scroll1MaxSizeY],edx mov [Scroll1MaxSizeY],edx
mov [Scroll1MaxSizeX],ecx mov [Scroll1MaxSizeX],ecx
@ -363,17 +362,16 @@ draw_scrollers:
mov edi,[Scroll1MaxSizeX] mov edi,[Scroll1MaxSizeX]
sub edi,ecx sub edi,ecx
mov [Scroll1FreeX],edi mov [Scroll1FreeX],edi
call draw_volume_rectangle call draw_volume_rectangle ; horizontal scrollbar polzunok
mov eax,[Window_SizeX] mov eax,[Window_SizeX]
sub eax,22+10 sub eax,22+10
mov ebx,[Scroll2CoordinatY] mov ebx,[Scroll2CoordinatY]
mov ecx,14+10 mov ecx,14+10
mov edx,[Window_SizeY] mov edx,[Window_SizeY]
sub edx,20+15+1+49+10+20+11 sub edx,39+ci_scrollv_coord_y_min
mov esi,1 mov esi,1
mov [Scroll2CoordinatX],eax mov [Scroll2CoordinatX],eax
mov [Scroll2CoordinatY],ebx
mov [Scroll2MaxSizeX],ecx mov [Scroll2MaxSizeX],ecx
mov [Scroll2MaxSizeY],edx mov [Scroll2MaxSizeY],edx
@ -389,8 +387,7 @@ draw_scrollers:
mov edi,[Scroll2MaxSizeY] mov edi,[Scroll2MaxSizeY]
sub edi,edx sub edi,edx
mov [Scroll2FreeY],edi mov [Scroll2FreeY],edi
call draw_volume_rectangle ; vertical scrollbar polzunok
call draw_volume_rectangle
ret ret

View File

@ -243,14 +243,13 @@ big_pixel_x:
jnz screen_y jnz screen_y
fps: fps:
;mcall 18,14
mov ebx,[ScreenPointer] mov ebx,[ScreenPointer]
mov ecx,[WorkScreen_SizeX] mov ecx,[WorkScreen_SizeX]
mov edx,[WorkScreen_SizeY] mov edx,[WorkScreen_SizeY]
shl ecx,16 shl ecx,16
add ecx,edx add ecx,edx
mov edx,8*65536+20+15+49+5+1 mov edx,((ci_edit_wnd_x_pos+ci_edit_wnd_border) shl 16)\
+ (ci_edit_wnd_y_pos+ci_edit_wnd_border)
mcall SF_PUT_IMAGE mcall SF_PUT_IMAGE
ret ret
;---------------------------------------------------------- ;----------------------------------------------------------
@ -289,47 +288,49 @@ cleare_work_arrea:
;calculate position work screen on a picture ;calculate position work screen on a picture
;----------------------------------------------------------- ;-----------------------------------------------------------
CalculatePositionScreen: CalculatePositionScreen:
mov eax,[Picture_SizeX] mov eax,[Picture_SizeX]
mov ebx,[Picture_SizeY] sub eax,[CounterX]
mov ecx,[CounterX] cmp [PosX],eax
mov edx,[CounterY] jle @f
sub eax,ecx mov [PosX],eax
sub ebx,edx @@:
cmp [PosX],eax cmp [PosX],0
jle no_limit_screen_x jns @f
mov [PosX],eax mov [PosX],0
@@:
no_limit_screen_x: mov ebx,[Picture_SizeY]
cmp [PosY],ebx sub ebx,[CounterY]
jle no_limit_screen_y cmp [PosY],ebx
mov [PosY],ebx jle @f
mov [PosY],ebx
no_limit_screen_y: @@:
cmp [PosX],0 cmp [PosY],0
jns no_minimum_screen_x jns @f
mov [PosX],0 mov [PosY],0
@@:
no_minimum_screen_x:
cmp [PosY],0
jns no_minimum_screen_y
mov [PosY],0
no_minimum_screen_y:
ret ret
;----------------------------------------------------------- ;-----------------------------------------------------------
;-----------calculate cordinats on work picture-------------- ;-----------calculate cordinats on work picture--------------
;----------------------------------------------------------- ;-----------------------------------------------------------
GetScreenCordinats: GetScreenCordinats:
mov eax,[MouseX] mov eax,[MouseX]
mov ebx,[MouseY] mov ebx,[MouseY]
sub eax,9 sub eax,ci_edit_wnd_x_pos+ci_edit_wnd_border
sub ebx,87 cmp eax,0
mov ecx,[k] jge @f
xor eax,eax
@@:
sub ebx,ci_edit_wnd_y_pos+ci_edit_wnd_border
cmp ebx,0
jge @f
xor ebx,ebx
@@:
mov ecx,[k]
cdq cdq
idiv ecx idiv ecx
mov [ScreenX],eax mov [ScreenX],eax
mov eax,ebx mov eax,ebx
cdq cdq
idiv ecx idiv ecx
mov [ScreenY],eax mov [ScreenY],eax
ret ret