mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-25 16:16:50 +03:00
make pencil startup instrument,
change cursors on work area git-svn-id: svn://kolibrios.org@6364 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
fe26455cec
commit
ccef80df60
@ -116,7 +116,7 @@ include 'init_data.inc'
|
|||||||
|
|
||||||
call drawwin
|
call drawwin
|
||||||
;---------------------------------------------------------
|
;---------------------------------------------------------
|
||||||
;---------Check loading of file from parameters-----------
|
;---------check loading of file from parameters-----------
|
||||||
;---------------------------------------------------------
|
;---------------------------------------------------------
|
||||||
mov eax,file_path
|
mov eax,file_path
|
||||||
cmp [eax],byte 0
|
cmp [eax],byte 0
|
||||||
@ -139,14 +139,18 @@ include 'init_data.inc'
|
|||||||
;OpenDialog initialisation
|
;OpenDialog initialisation
|
||||||
stdcall [OpenDialog_Init], OpenDialog_data
|
stdcall [OpenDialog_Init], OpenDialog_data
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
|
mov [Current_instrument],10 ;pencil
|
||||||
|
call TakeButtonInstruments ;set startup instrument
|
||||||
|
|
||||||
|
align 4
|
||||||
red:
|
red:
|
||||||
call drawwin
|
call drawwin
|
||||||
;----------------------------------------------------------
|
;----------------------------------------------------------
|
||||||
;---------------------MAIN LOOP----------------------------
|
;---------------------main loop----------------------------
|
||||||
;----------------------------------------------------------
|
;----------------------------------------------------------
|
||||||
align 4
|
align 4
|
||||||
still:
|
still:
|
||||||
call event
|
mcall SF_WAIT_EVENT
|
||||||
|
|
||||||
cmp eax,1
|
cmp eax,1
|
||||||
je red
|
je red
|
||||||
@ -201,7 +205,7 @@ include 'brushes.inc'
|
|||||||
include 'spray.inc'
|
include 'spray.inc'
|
||||||
include 'width_lines.inc'
|
include 'width_lines.inc'
|
||||||
;----------------------------------------------------------
|
;----------------------------------------------------------
|
||||||
;-------------------ICON"S picture-------------------------
|
;-------------------icon's picture-------------------------
|
||||||
;----------------------------------------------------------
|
;----------------------------------------------------------
|
||||||
align 4
|
align 4
|
||||||
panel_picture:
|
panel_picture:
|
||||||
@ -225,6 +229,7 @@ file 'spray.cur'
|
|||||||
zoom_cursor:
|
zoom_cursor:
|
||||||
file 'zoom.cur'
|
file 'zoom.cur'
|
||||||
;----------------------------------------------------------
|
;----------------------------------------------------------
|
||||||
|
align 4
|
||||||
IM_END:
|
IM_END:
|
||||||
;-----------------------------------------------------------
|
;-----------------------------------------------------------
|
||||||
;------------variables and data of program------------------
|
;------------variables and data of program------------------
|
||||||
@ -241,13 +246,12 @@ PointerToEditBufer rd 1
|
|||||||
PointerToSpriteBufer rd 1
|
PointerToSpriteBufer rd 1
|
||||||
PointerToPalette rd 1 ;㪠§ â¥«ì ¯¨«¨âàã (㦥 ¤«ï á®åà ¥¨ï ¢ *.bmp)
|
PointerToPalette rd 1 ;㪠§ â¥«ì ¯¨«¨âàã (㦥 ¤«ï á®åà ¥¨ï ¢ *.bmp)
|
||||||
Color rd 1
|
Color rd 1
|
||||||
|
SColor rd 1
|
||||||
Number_Brush rd 1
|
Number_Brush rd 1
|
||||||
Brush_SizeX rd 1
|
Brush_SizeX rd 1
|
||||||
Brush_SizeY rd 1
|
Brush_SizeY rd 1
|
||||||
Current_instrument rd 1
|
Current_instrument rd 1
|
||||||
Last_instrument rd 1
|
Last_instrument rd 1
|
||||||
Activate_instrument rb 1
|
|
||||||
SColor rd 1
|
|
||||||
OldX rd 1
|
OldX rd 1
|
||||||
OldY rd 1
|
OldY rd 1
|
||||||
|
|
||||||
@ -279,7 +283,6 @@ Icon_X rd 1
|
|||||||
Icon_Y rd 1
|
Icon_Y rd 1
|
||||||
counter rd 1
|
counter rd 1
|
||||||
counter2 rd 1
|
counter2 rd 1
|
||||||
Panel_flag rb 1
|
|
||||||
menu_counter rd 1
|
menu_counter rd 1
|
||||||
counter_11 rd 1
|
counter_11 rd 1
|
||||||
number_panel rd 1
|
number_panel rd 1
|
||||||
@ -299,45 +302,45 @@ Scroll2MaxSizeY rd 1
|
|||||||
Scroll2SizeY rd 1
|
Scroll2SizeY rd 1
|
||||||
Scroll2FreeY rd 1
|
Scroll2FreeY rd 1
|
||||||
|
|
||||||
;extended_memory rd 1
|
|
||||||
type rw 1
|
|
||||||
x rd 1
|
x rd 1
|
||||||
y rd 1
|
y rd 1
|
||||||
save_flag rb 1
|
|
||||||
exit_from_work_arrea rb 1
|
|
||||||
|
|
||||||
Radius rd 1
|
Radius rd 1
|
||||||
Dx_ rd 1
|
Dx_ rd 1
|
||||||
Dy_ rd 1
|
Dy_ rd 1
|
||||||
line_width rd 1
|
line_width rd 1
|
||||||
lastik_is_active rb 1
|
|
||||||
a_ellips rd 1
|
a_ellips rd 1
|
||||||
b_ellips rd 1
|
b_ellips rd 1
|
||||||
instrument_used rb 1
|
|
||||||
used_OldX rd 1
|
used_OldX rd 1 ;for draw hard contour
|
||||||
used_OldY rd 1
|
used_OldY rd 1
|
||||||
rectangular_shade_x rd 1
|
rectangular_shade_x rd 1 ;ª®®à¤¨ â x ®¡« á⨠¤«ï ª®¯¨à®¢ ¨ï
|
||||||
rectangular_shade_y rd 1
|
rectangular_shade_y rd 1
|
||||||
crossing_old_x rd 1
|
crossing_old_x rd 1
|
||||||
crossing_old_y rd 1
|
crossing_old_y rd 1
|
||||||
crossing rd 1
|
crossing rd 1
|
||||||
finishing_crossing rd 1
|
finishing_crossing rd 1
|
||||||
number_undo rd 1
|
number_undo rd 1
|
||||||
DrawSprite_flag rb 1
|
|
||||||
Paste_flag rb 1
|
|
||||||
SpriteSizeX rd 1
|
SpriteSizeX rd 1
|
||||||
SpriteSizeY rd 1
|
SpriteSizeY rd 1
|
||||||
SpriteCoordinatX rd 1
|
SpriteCoordinatX rd 1
|
||||||
SpriteCoordinatY rd 1
|
SpriteCoordinatY rd 1
|
||||||
SpriteOldCoordinatX rd 1
|
SpriteOldCoordinatX rd 1
|
||||||
SpriteOldCoordinatY rd 1
|
SpriteOldCoordinatY rd 1
|
||||||
|
|
||||||
|
CursorsID rd 10
|
||||||
|
|
||||||
|
Activate_instrument rb 1
|
||||||
|
save_flag rb 1
|
||||||
|
exit_from_work_arrea rb 1
|
||||||
|
lastik_is_active rb 1
|
||||||
|
instrument_used rb 1
|
||||||
|
DrawSprite_flag rb 1
|
||||||
|
Paste_flag rb 1
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
IncludeUGlobals
|
IncludeUGlobals
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
align 4
|
align 4
|
||||||
CursorsID rd 10
|
|
||||||
;---------------------------------------------------------------------
|
|
||||||
align 4
|
|
||||||
file_path rb 4096
|
file_path rb 4096
|
||||||
filename_area rb 256
|
filename_area rb 256
|
||||||
temp_dir_pach rb 4096
|
temp_dir_pach rb 4096
|
||||||
|
@ -8,84 +8,49 @@ load_cursors:
|
|||||||
|
|
||||||
mov [PointerToCursorsID],eax
|
mov [PointerToCursorsID],eax
|
||||||
|
|
||||||
mov eax, 37
|
mcall SF_MOUSE_GET, SSF_LOAD_CURSOR, brush_cursor, 1
|
||||||
mov ebx, 4
|
|
||||||
mov ecx,brush_cursor
|
|
||||||
mov edx,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov ebx,[PointerToCursorsID]
|
mov ebx,[PointerToCursorsID]
|
||||||
mov [ebx],eax
|
mov [ebx],eax
|
||||||
add [PointerToCursorsID],4
|
add [PointerToCursorsID],4
|
||||||
|
|
||||||
mov eax, 37
|
mcall SF_MOUSE_GET, SSF_LOAD_CURSOR, flood_fill_cursor, 1
|
||||||
mov ebx, 4
|
|
||||||
mov ecx,flood_fill_cursor
|
|
||||||
mov edx,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov ebx,[PointerToCursorsID]
|
mov ebx,[PointerToCursorsID]
|
||||||
mov [ebx],eax
|
mov [ebx],eax
|
||||||
add [PointerToCursorsID],4
|
add [PointerToCursorsID],4
|
||||||
|
|
||||||
mov eax, 37
|
mcall SF_MOUSE_GET, SSF_LOAD_CURSOR, lastik_cursor, 1
|
||||||
mov ebx, 4
|
|
||||||
mov ecx,lastik_cursor
|
|
||||||
mov edx,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov ebx,[PointerToCursorsID]
|
mov ebx,[PointerToCursorsID]
|
||||||
mov [ebx],eax
|
mov [ebx],eax
|
||||||
add [PointerToCursorsID],4
|
add [PointerToCursorsID],4
|
||||||
|
|
||||||
|
mcall SF_MOUSE_GET, SSF_LOAD_CURSOR, other_cursor, 1
|
||||||
mov eax, 37
|
|
||||||
mov ebx, 4
|
|
||||||
mov ecx,other_cursor
|
|
||||||
mov edx,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
|
|
||||||
mov ebx,[PointerToCursorsID]
|
mov ebx,[PointerToCursorsID]
|
||||||
mov [ebx],eax
|
mov [ebx],eax
|
||||||
add [PointerToCursorsID],4
|
add [PointerToCursorsID],4
|
||||||
|
|
||||||
mov eax, 37
|
mcall SF_MOUSE_GET, SSF_LOAD_CURSOR, pencil_cursor, 1
|
||||||
mov ebx, 4
|
|
||||||
mov ecx,pencil_cursor
|
|
||||||
mov edx,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
|
|
||||||
mov ebx,[PointerToCursorsID]
|
mov ebx,[PointerToCursorsID]
|
||||||
mov [ebx],eax
|
mov [ebx],eax
|
||||||
add [PointerToCursorsID],4
|
add [PointerToCursorsID],4
|
||||||
|
|
||||||
mov eax, 37
|
mcall SF_MOUSE_GET, SSF_LOAD_CURSOR, pipette_cursor, 1
|
||||||
mov ebx, 4
|
|
||||||
mov ecx,pipette_cursor
|
|
||||||
mov edx,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov ebx,[PointerToCursorsID]
|
mov ebx,[PointerToCursorsID]
|
||||||
mov [ebx],eax
|
mov [ebx],eax
|
||||||
add [PointerToCursorsID],4
|
add [PointerToCursorsID],4
|
||||||
|
|
||||||
mov eax, 37
|
mcall SF_MOUSE_GET, SSF_LOAD_CURSOR, spray_cursor, 1
|
||||||
mov ebx, 4
|
|
||||||
mov ecx,spray_cursor
|
|
||||||
mov edx,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov ebx,[PointerToCursorsID]
|
mov ebx,[PointerToCursorsID]
|
||||||
mov [ebx],eax
|
mov [ebx],eax
|
||||||
add [PointerToCursorsID],4
|
add [PointerToCursorsID],4
|
||||||
|
|
||||||
mov eax, 37
|
mcall SF_MOUSE_GET, SSF_LOAD_CURSOR, zoom_cursor, 1
|
||||||
mov ebx, 4
|
|
||||||
mov ecx,zoom_cursor
|
|
||||||
mov edx,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov ebx,[PointerToCursorsID]
|
mov ebx,[PointerToCursorsID]
|
||||||
mov [ebx],eax
|
mov [ebx],eax
|
||||||
@ -280,15 +245,16 @@ set_cursor:
|
|||||||
|
|
||||||
che:
|
che:
|
||||||
|
|
||||||
|
cmp eax,8 ;cursors count
|
||||||
|
jg no_change_cursor
|
||||||
|
|
||||||
dec eax
|
dec eax
|
||||||
shl eax,2
|
shl eax,2
|
||||||
mov ebx,[PointerToCursorsID]
|
mov ebx,[PointerToCursorsID]
|
||||||
add eax,ebx
|
add eax,ebx
|
||||||
mov ecx,[eax]
|
mov ecx,[eax]
|
||||||
|
|
||||||
mov eax, 37
|
mcall SF_MOUSE_GET, SSF_SET_CURSOR
|
||||||
mov ebx, 5
|
|
||||||
mcall
|
|
||||||
|
|
||||||
no_change_cursor:
|
no_change_cursor:
|
||||||
|
|
||||||
|
@ -1,11 +1,3 @@
|
|||||||
;----------------------------------------------------------
|
|
||||||
;---------------------system events------------------------
|
|
||||||
;----------------------------------------------------------
|
|
||||||
align 4
|
|
||||||
event:
|
|
||||||
mcall SF_WAIT_EVENT
|
|
||||||
ret
|
|
||||||
|
|
||||||
;----------------------------------------------------------
|
;----------------------------------------------------------
|
||||||
;---------------------sound of events----------------------
|
;---------------------sound of events----------------------
|
||||||
;----------------------------------------------------------
|
;----------------------------------------------------------
|
||||||
|
@ -30,15 +30,6 @@ buttons:
|
|||||||
mov [Current_instrument],eax
|
mov [Current_instrument],eax
|
||||||
call button_handler_main_menu
|
call button_handler_main_menu
|
||||||
|
|
||||||
; set cursor for current instrument
|
|
||||||
pushad
|
|
||||||
|
|
||||||
mov eax,CursorsID
|
|
||||||
mov ebx,[Current_instrument]
|
|
||||||
|
|
||||||
call set_cursor
|
|
||||||
popad
|
|
||||||
|
|
||||||
cmp eax,10
|
cmp eax,10
|
||||||
jl still
|
jl still
|
||||||
|
|
||||||
|
@ -12,33 +12,6 @@ mouse:
|
|||||||
jne still
|
jne still
|
||||||
|
|
||||||
call GetMouseCoordinats
|
call GetMouseCoordinats
|
||||||
;panel
|
|
||||||
mov edx,[Window_SizeX]
|
|
||||||
sub edx,5
|
|
||||||
|
|
||||||
;cmp ebx,0
|
|
||||||
;jle no_panel
|
|
||||||
|
|
||||||
cmp ebx,ci_panel_y_pos
|
|
||||||
jae no_panel
|
|
||||||
|
|
||||||
cmp eax,5
|
|
||||||
jle no_panel
|
|
||||||
|
|
||||||
cmp eax,edx
|
|
||||||
jae no_panel
|
|
||||||
|
|
||||||
call GetMouseCoordinats
|
|
||||||
jmp panel_interraction
|
|
||||||
|
|
||||||
no_panel:
|
|
||||||
cmp [Panel_flag],0
|
|
||||||
jz no_redraw_panel
|
|
||||||
|
|
||||||
jmp panel_interraction
|
|
||||||
|
|
||||||
no_redraw_panel:
|
|
||||||
call GetMouseCoordinats
|
|
||||||
mov eax,[MouseX]
|
mov eax,[MouseX]
|
||||||
mov ebx,[MouseY]
|
mov ebx,[MouseY]
|
||||||
mov ecx,[WorkScreen_SizeX]
|
mov ecx,[WorkScreen_SizeX]
|
||||||
@ -58,7 +31,7 @@ mouse_scroll:
|
|||||||
;scrollers
|
;scrollers
|
||||||
call GetMouseClick
|
call GetMouseClick
|
||||||
cmp eax,1
|
cmp eax,1
|
||||||
jne no_click
|
jne still
|
||||||
|
|
||||||
call GetMouseCoordinats
|
call GetMouseCoordinats
|
||||||
;interraction with horizontal scroller
|
;interraction with horizontal scroller
|
||||||
@ -169,8 +142,6 @@ no_vertical:
|
|||||||
call CalculatePositionScreen
|
call CalculatePositionScreen
|
||||||
call draw_scrollers
|
call draw_scrollers
|
||||||
call MovePictureToWorkScreen
|
call MovePictureToWorkScreen
|
||||||
|
|
||||||
no_click:
|
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
no_scrollers:
|
no_scrollers:
|
||||||
@ -178,8 +149,8 @@ no_scrollers:
|
|||||||
mov ebx,[MouseY]
|
mov ebx,[MouseY]
|
||||||
mov ecx,[Window_SizeX]
|
mov ecx,[Window_SizeX]
|
||||||
mov edx,[Window_SizeY]
|
mov edx,[Window_SizeY]
|
||||||
sub ecx,36
|
sub ecx,ci_scroll_dim+ci_edit_wnd_border+5+ci_offs_skin_w
|
||||||
sub edx,35
|
sub edx,ci_scroll_dim+ci_edit_wnd_border+5+ci_offs_skin_h
|
||||||
|
|
||||||
cmp eax,ci_scrollh_coord_x_min
|
cmp eax,ci_scrollh_coord_x_min
|
||||||
jle not_work_arrea
|
jle not_work_arrea
|
||||||
@ -196,11 +167,18 @@ no_scrollers:
|
|||||||
|
|
||||||
not_work_arrea:
|
not_work_arrea:
|
||||||
mov [exit_from_work_arrea],1
|
mov [exit_from_work_arrea],1
|
||||||
|
mcall SF_MOUSE_GET, SSF_SET_CURSOR, 0 ;set standart cursor
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
mouse_in_work_arrea:
|
mouse_in_work_arrea:
|
||||||
call GetScreenCordinats
|
call GetScreenCordinats
|
||||||
call PrintMousePos
|
call PrintMousePos
|
||||||
|
|
||||||
|
;set cursor for current instrument
|
||||||
|
mov eax,CursorsID
|
||||||
|
mov ebx,[Current_instrument]
|
||||||
|
call set_cursor
|
||||||
|
|
||||||
call GetMouseClick
|
call GetMouseClick
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jz no_use_instruments
|
jz no_use_instruments
|
||||||
@ -208,7 +186,7 @@ mouse_in_work_arrea:
|
|||||||
cmp [Activate_instrument],0
|
cmp [Activate_instrument],0
|
||||||
jnz no_undo___
|
jnz no_undo___
|
||||||
;------------begin copy for undo-------------
|
;------------begin copy for undo-------------
|
||||||
;copy bufer number 2 to bufer number 0
|
;copy bufer_0 -> bufer_2
|
||||||
mov edi,[PointerToCopyPicture2]
|
mov edi,[PointerToCopyPicture2]
|
||||||
mov esi,[PointerToPicture]
|
mov esi,[PointerToPicture]
|
||||||
mov ecx,[Picture_SizeX]
|
mov ecx,[Picture_SizeX]
|
||||||
@ -221,7 +199,6 @@ mouse_in_work_arrea:
|
|||||||
mov ecx,ebx
|
mov ecx,ebx
|
||||||
and ecx,3
|
and ecx,3
|
||||||
rep movsb
|
rep movsb
|
||||||
;call MovePictureToWorkScreen
|
|
||||||
;rotate bufers +1
|
;rotate bufers +1
|
||||||
and [number_undo],0 ;erase all undo
|
and [number_undo],0 ;erase all undo
|
||||||
mov eax,[PointerToPicture]
|
mov eax,[PointerToPicture]
|
||||||
|
@ -218,7 +218,7 @@ no_file:
|
|||||||
jne no_undo
|
jne no_undo
|
||||||
|
|
||||||
cmp [number_undo],2 ;2 - maximum undo count
|
cmp [number_undo],2 ;2 - maximum undo count
|
||||||
jge no_undo
|
jge end_menu
|
||||||
|
|
||||||
;rotate bufers -1
|
;rotate bufers -1
|
||||||
inc [number_undo]
|
inc [number_undo]
|
||||||
@ -238,7 +238,7 @@ no_undo:
|
|||||||
jne no_redo
|
jne no_redo
|
||||||
|
|
||||||
cmp [number_undo],0
|
cmp [number_undo],0
|
||||||
je no_redo
|
je end_menu
|
||||||
|
|
||||||
;rotate bufers +1
|
;rotate bufers +1
|
||||||
dec [number_undo]
|
dec [number_undo]
|
||||||
@ -258,9 +258,9 @@ no_redo:
|
|||||||
jne no_copy
|
jne no_copy
|
||||||
|
|
||||||
cmp [instrument_used],1
|
cmp [instrument_used],1
|
||||||
jne no_copy
|
jne end_menu
|
||||||
cmp [Activate_instrument],0
|
cmp [Activate_instrument],0
|
||||||
jne no_copy
|
jne end_menu
|
||||||
|
|
||||||
mov eax,[OldX]
|
mov eax,[OldX]
|
||||||
mov ebx,[OldY]
|
mov ebx,[OldY]
|
||||||
|
@ -1,9 +1,3 @@
|
|||||||
;-------------------------------------------------
|
|
||||||
;-----interraction panel with user----------------
|
|
||||||
;-------------------------------------------------
|
|
||||||
panel_interraction:
|
|
||||||
and [Panel_flag],0
|
|
||||||
jmp still
|
|
||||||
;---------------------------------------------------------
|
;---------------------------------------------------------
|
||||||
;-----draw panel menu(main engin of panel)----------------
|
;-----draw panel menu(main engin of panel)----------------
|
||||||
;---------------------------------------------------------
|
;---------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user