diff --git a/programs/media/animage/trunk/animage.asm b/programs/media/animage/trunk/animage.asm index 2e62862b81..25b0e9129c 100644 --- a/programs/media/animage/trunk/animage.asm +++ b/programs/media/animage/trunk/animage.asm @@ -45,6 +45,15 @@ include '../../../libio.inc' ;--------------------------------------------------------- ; *** константы для интерфейса *** +; *** constants for interface *** + +; корректировки на скин +ci_offs_skin_w equ 0 ; 5 ;корректировка на ширину рамки скина +ci_offs_skin_h equ 0 ;24 ;корректировка на высоту скина + +; главное окно +ci_wnd_min_siz_x equ 585 ;minimum size x +ci_wnd_min_siz_y equ 400 ;minimum size y ; окно редактора ci_edit_wnd_x_pos equ 5 ;координата x для окна редактора @@ -52,6 +61,7 @@ ci_edit_wnd_y_pos equ 87 ; ci_edit_wnd_border equ 3 ;рамка вокруг окна редактора ; скроллинги +ci_scroll_dim equ 22 ;размеры скроллингов ci_scrollh_coord_x_min equ (ci_edit_wnd_x_pos+3) ;минимальная позиция ползунка ;горизонтального скроллинга ci_scrollv_coord_y_min equ (ci_edit_wnd_y_pos+3) ;минимальная позиция ползунка @@ -118,11 +128,12 @@ include 'init_data.inc' push dword OpenDialog_data call [OpenDialog_Init] ;--------------------------------------------------------------------- +red: + call drawwin ;---------------------------------------------------------- ;---------------------MAIN LOOP---------------------------- ;---------------------------------------------------------- -red: - call drawwin +align 4 still: call event diff --git a/programs/media/animage/trunk/events_of_mouse.inc b/programs/media/animage/trunk/events_of_mouse.inc index ce7a0103c7..6ee4e214e4 100644 --- a/programs/media/animage/trunk/events_of_mouse.inc +++ b/programs/media/animage/trunk/events_of_mouse.inc @@ -2,14 +2,14 @@ ;-------------interraction MOUSE-------------- ;--------------------------------------------- mouse: - or ecx,-1 + or ecx,-1 mcall SF_THREAD_INFO,procinfo mov eax,[procinfo+70] ;staus of window - test eax,100b + test eax,100b jne still - call GetMouseCoordinats + call GetMouseCoordinats ;panel mov edx,[Window_SizeX] sub edx,5 @@ -23,10 +23,10 @@ mouse: cmp eax,5 jle no_panel - cmp eax,edx ;585 + cmp eax,edx jae no_panel - call GetMouseCoordinats + call GetMouseCoordinats mov [counter],7 mov edi,panel_text jmp panel_interraction @@ -40,7 +40,7 @@ no_panel: jmp panel_interraction no_redraw_panel: - call GetMouseCoordinats + call GetMouseCoordinats mov eax,[MouseX] mov ebx,[MouseY] mov ecx,[WorkScreen_SizeX] @@ -78,7 +78,7 @@ mouse_scroll: mov ebx,[Scroll1CoordinatY] mov ecx,[Scroll1MaxSizeX] inc ecx - mov edx,14+10 + mov edx,ci_scroll_dim-6 mov esi,7 call draw_volume_rectangle ; horizontal scrollbar clear @@ -128,7 +128,7 @@ no_horizontal: mov eax,[Scroll2CoordinatX] mov ebx,ci_scrollv_coord_y_min - mov ecx,14+10 + mov ecx,ci_scroll_dim-6 mov edx,[Scroll2MaxSizeY] inc edx mov esi,7 diff --git a/programs/media/animage/trunk/events_of_window.inc b/programs/media/animage/trunk/events_of_window.inc index d0a38df8b1..4b987b7e76 100644 --- a/programs/media/animage/trunk/events_of_window.inc +++ b/programs/media/animage/trunk/events_of_window.inc @@ -13,21 +13,22 @@ drawwin: mov [Window_CordinatX],eax mov [Window_CordinatY],ebx - cmp ecx,585 - jae @f - mov ecx,585 ;minimum size x + cmp ecx,ci_wnd_min_siz_x + jge @f + mov ecx,ci_wnd_min_siz_x @@: - cmp [Window_SizeY],400 - jae @f - mov edx,400 ;minimum size y + cmp edx,ci_wnd_min_siz_y + jge @f + mov edx,ci_wnd_min_siz_y @@: mov [Window_SizeX],ecx mov [Window_SizeY],edx - mov [MaxWorkScreen_SizeX],ecx mov [MaxWorkScreen_SizeY],edx - sub [MaxWorkScreen_SizeX],ci_edit_wnd_x_pos+2*ci_edit_wnd_border+34 - sub [MaxWorkScreen_SizeY],ci_edit_wnd_y_pos+2*ci_edit_wnd_border+34 + sub [MaxWorkScreen_SizeX],ci_edit_wnd_x_pos+2*ci_edit_wnd_border\ + +ci_scroll_dim+ci_offs_skin_w+5 + sub [MaxWorkScreen_SizeY],ci_edit_wnd_y_pos+2*ci_edit_wnd_border\ + +ci_scroll_dim+ci_offs_skin_h+5 cmp [MaxWorkScreen_SizeX],0 jns no_znak1 @@ -48,12 +49,12 @@ no_znak2: mov ecx,50 ;[Window_CordinatY] shl ebx,16 shl ecx,16 - add ebx,[Window_SizeX] - add ecx,[Window_SizeY] + add ebx, [Window_SizeX] + add ecx, [Window_SizeY] mcall SF_CREATE_WINDOW,,,0x53aabbcc,,name_of_program mov eax,[procinfo+70] ;staus of window - test eax,100b + test eax,100b jne .end ;------------------------------------------------ @@ -84,12 +85,15 @@ no_znak2: ;------------------------------------------------ mov ebx,[WorkScreen_SizeX] add ebx,ci_edit_wnd_x_pos+ci_edit_wnd_border + mov edx,[Window_SizeX] + sub edx,ebx + sub edx,ci_scroll_dim+5-ci_edit_wnd_border shl ebx,16 - mov bx,ci_edit_wnd_border ;ширина бордюра + mov bx,dx ;ширина бордюра mov ecx,ci_edit_wnd_y_pos+ci_edit_wnd_border mov edx,[Window_SizeY] - sub edx,ci_edit_wnd_y_pos+2*ci_edit_wnd_border+34 + sub edx,ci_edit_wnd_y_pos+2*ci_edit_wnd_border+ci_scroll_dim+5+ci_offs_skin_h shl ecx,16 mov cx,dx ;высота бордюра @@ -99,14 +103,17 @@ no_znak2: ;------------------------------------------------ mov ebx,ci_edit_wnd_x_pos mov edx,[Window_SizeX] - sub edx,25+10+ci_edit_wnd_x_pos + sub edx,ci_scroll_dim+5+ci_edit_wnd_x_pos shl ebx,16 mov bx,dx ;ширина бордюра mov ecx,[WorkScreen_SizeY] add ecx,ci_edit_wnd_y_pos+ci_edit_wnd_border + mov edx,[Window_SizeY] + sub edx,ecx + sub edx,ci_scroll_dim+5+ci_offs_skin_h;ci_edit_wnd_border shl ecx,16 - mov cx,ci_edit_wnd_border ;высота бордюра + mov cx,dx ;высота бордюра mcall SF_DRAW_RECT,,,0xc7cbcf ;бордюр под окном и над скроллингом ;------------------------------------------------ @@ -115,29 +122,29 @@ no_znak2: mov eax,ci_edit_wnd_x_pos mov ebx,[Window_SizeY] mov ecx,[Window_SizeX] - mov edx,20+10 + mov edx,ci_scroll_dim mov esi,3 - sub ecx,35+ci_edit_wnd_x_pos - sub ebx,25+10 + sub ecx,ci_scroll_dim+5+ci_edit_wnd_x_pos+ci_offs_skin_w + sub ebx,ci_scroll_dim+5+ci_offs_skin_h call draw_volume_rectangle ; horizontal scrollbar border ;------------------------------------------------ mov eax,[Window_SizeX] mov ebx,ci_edit_wnd_y_pos - mov ecx,20+10 + mov ecx,ci_scroll_dim mov edx,[Window_SizeY] mov esi,3 - sub eax,25+10 - sub edx,35+ci_edit_wnd_y_pos + sub eax,ci_scroll_dim+5+ci_offs_skin_w + sub edx,ci_scroll_dim+5+ci_edit_wnd_y_pos+ci_offs_skin_h call draw_volume_rectangle ; vertical scrollbar border call draw_scrollers ;------------------------------------------------ mov eax,[Window_SizeX] mov ebx,[Window_SizeY] - mov ecx,20+10 - mov edx,20+10 + mov ecx,ci_scroll_dim + mov edx,ci_scroll_dim mov esi,6 - sub eax,25+10 - sub ebx,25+10 + sub eax,ci_scroll_dim+5+ci_offs_skin_w + sub ebx,ci_scroll_dim+5+ci_offs_skin_h call draw_volume_rectangle ; down and right small area ;------------------------------------------------ .end: diff --git a/programs/media/animage/trunk/panel_engen.inc b/programs/media/animage/trunk/panel_engen.inc index 4a48ce04b1..251a9d5939 100644 --- a/programs/media/animage/trunk/panel_engen.inc +++ b/programs/media/animage/trunk/panel_engen.inc @@ -78,7 +78,7 @@ print_panel_menu: next_icon_delit1: mov edx,[counter] add edx,11100000000000000000000000000000b - mcall 8 + mcall SF_DEFINE_BUTTON inc [counter] cmp [counter],30 jl next_icon_delit1 @@ -89,7 +89,7 @@ next_icon_delit1: next_icon_delit2: mov edx,[counter] add edx,11100000000000000000000000000000b - mcall 8 + mcall SF_DEFINE_BUTTON inc [counter] cmp [counter],45 jl next_icon_delit2 @@ -100,7 +100,7 @@ next_icon_delit2: next_icon_delit3: mov edx,[counter] add edx,11100000000000000000000000000000b - mcall 8 + mcall SF_DEFINE_BUTTON inc [counter] cmp [counter],50 jl next_icon_delit3 @@ -108,12 +108,12 @@ next_icon_delit3: ;delit buttons of palette mov edx,51 add edx,11100000000000000000000000000000b - mcall 8 + mcall SF_DEFINE_BUTTON ;delit buttons of color mov edx,52 add edx,11100000000000000000000000000000b - mcall 8 + mcall SF_DEFINE_BUTTON pop [counter] @@ -196,14 +196,14 @@ no_columnus_menu_text: menu_still: - mcall 10 - mcall 2 - mcall 17 - call GetMouseClick - test eax,eax - jz calculate_counter_menu + mcall SF_WAIT_EVENT + mcall SF_GET_KEY + mcall SF_GET_BUTTON + call GetMouseClick + test eax,eax + jz calculate_counter_menu - call GetMouseCoordinats + call GetMouseCoordinats ;calculate menu counter mov eax,[counter] dec eax @@ -243,7 +243,7 @@ no_columnus_menu_text2: pop edi esi - mcall 5,15 + mcall SF_SLEEP,15 push [counter] pusha @@ -300,7 +300,7 @@ PrintMousePos: shl edx,16 add edx,20+15+6+6 and esi,0 - mcall 47,<4,0> + mcall SF_DRAW_NUMBER,<4,0> mov ecx,[ScreenY] add ecx,[PosY] @@ -342,10 +342,10 @@ draw_scrollers: mov edi,[CounterX] mov eax,[Scroll1CoordinatX] mov ebx,[Window_SizeY] - sub ebx,22+10 + sub ebx,(ci_scroll_dim-3)+5+ci_offs_skin_h mov ecx,[Window_SizeX] - sub ecx,39+ci_scrollh_coord_x_min - mov edx,14+10 + sub ecx,ci_scroll_dim+5+4+ci_scrollh_coord_x_min+ci_offs_skin_w + mov edx,ci_scroll_dim-6 mov esi,1 mov [Scroll1CoordinatY],ebx mov [Scroll1MaxSizeY],edx @@ -365,11 +365,11 @@ draw_scrollers: call draw_volume_rectangle ; horizontal scrollbar polzunok mov eax,[Window_SizeX] - sub eax,22+10 + sub eax,(ci_scroll_dim-3)+5+ci_offs_skin_w mov ebx,[Scroll2CoordinatY] - mov ecx,14+10 + mov ecx,ci_scroll_dim-6 mov edx,[Window_SizeY] - sub edx,39+ci_scrollv_coord_y_min + sub edx,ci_scroll_dim+5+4+ci_scrollv_coord_y_min+ci_offs_skin_h mov esi,1 mov [Scroll2CoordinatX],eax mov [Scroll2MaxSizeX],ecx