ColorDialog - history of selected colors.

git-svn-id: svn://kolibrios.org@3473 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2013-04-16 22:39:51 +00:00
parent d9e9bba534
commit c50ad68d88
2 changed files with 159 additions and 10 deletions

View File

@ -58,6 +58,14 @@
; ;
; Color value ; +20 ; Color value ; +20
; dd 0 ; dd 0
; First start flag ; +24
; dd 0 ; 0 - first start, 1 - subsequent starts
;
; Old colors ; +28
; rd 10
;
; Free area ; +68
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
use32 use32
org 0x0 org 0x0
@ -108,13 +116,13 @@ START:
mcall 40,0x27 mcall 40,0x27
; mcall 40,0x7 ; mcall 40,0x7
call get_communication_area call get_communication_area
call get_active_pocess call get_active_pocess
call clear_colors_history
;--------------------------------------
load_libraries l_libs_start,end_l_libs load_libraries l_libs_start,end_l_libs
test eax,eax test eax,eax
jnz button.exit_2 jnz button.exit_2
;--------------------------------------
xor eax,eax xor eax,eax
mov al,p_size_x mov al,p_size_x
mov [palette_SIZE_X],eax mov [palette_SIZE_X],eax
@ -180,18 +188,45 @@ button:
cmp ah, 4 cmp ah, 4
je color_button je color_button
cmp ah, 30
jb @f
cmp ah, 39
ja @f
sub ah,30
movzx eax,ah
shl eax,2
add eax,[communication_area]
add eax,28
mov eax,[eax]
mov [selected_color],eax
call prepare_scrollbars_position_from_color
call draw_selected_color
call draw_scrollbars
jmp still
;--------------------------------------
align 4
@@:
cmp ah, 1 cmp ah, 1
jne still jne still
;--------------------------------------
align 4
.exit: .exit:
mov eax,[communication_area] mov eax,[communication_area]
mov [eax],word 3 mov [eax],word 3
jmp @f
; dps "CD flag value: cancel " ; dps "CD flag value: cancel "
;--------------------------------------
align 4
.exit_1: .exit_1:
;--------------------------------------
mov ax,[eax] call scroll_colors_history
and eax,0xffff ;--------------------------------------
align 4
@@:
; mov ax,[eax]
; and eax,0xffff
; dps "CD flag value: " ; dps "CD flag value: "
; dpd eax ; dpd eax
; newline ; newline
@ -209,9 +244,12 @@ button:
shl eax,16 shl eax,16
add eax,[ecx+46] add eax,[ecx+46]
mov [ebx+8],eax mov [ebx+8],eax
;--------------------------------------
align 4
.exit_2: .exit_2:
mcall -1 mcall -1
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4
get_window_param: get_window_param:
mcall 9,procinfo,-1 mcall 9,procinfo,-1
mov eax,[ebx+66] mov eax,[ebx+66]
@ -238,7 +276,7 @@ get_communication_area:
mov ebx,[eax+4] mov ebx,[eax+4]
; cmp bx,word x_minimal_size ;300 ; cmp bx,word x_minimal_size ;300
; jb @f ; jb @f
mov bx,420 mov bx,450
mov [window_x],ebx mov [window_x],ebx
mov ebx,[eax+8] mov ebx,[eax+8]
; cmp bx,word y_minimal_size ;200 ; cmp bx,word y_minimal_size ;200
@ -262,6 +300,38 @@ get_active_pocess:
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
clear_colors_history:
mov edi,[communication_area]
cmp [edi+24],dword 1
je @f
mov [edi+24],dword 1
add edi,28
mov ecx,10
cld
mov eax,0xffffff
rep stosd
@@:
ret
;---------------------------------------------------------------------
align 4
scroll_colors_history:
mov edi,[communication_area]
add edi,28
mov eax,[selected_color]
cmp [edi],eax
je @f
mov ecx,9
mov esi,edi
add esi,32
add edi,36
std
rep movsd
mov edi,[communication_area]
mov [edi+28],eax
@@:
ret
;---------------------------------------------------------------------
align 4
palette_button: palette_button:
mcall 37,1 mcall 37,1
and eax,0xffff and eax,0xffff
@ -406,6 +476,58 @@ draw_scrollbars:
call [scrollbar_ver_draw] call [scrollbar_ver_draw]
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
draw_button_row:
mov edx,0x60000000 + 30 ; BUTTON ROW
; mov ebx,220*65536+14
mov ebx,(c_start_x+c_size_x*2+10*3)*65536+14
mov ecx,20*65536+14
mov eax,8
;-----------------------------------
.newb:
mcall
add ecx,25*65536
inc edx
cmp edx,0x60000000 + 39
jbe .newb
ret
;---------------------------------------------------------------------
draw_colours:
mov edi,10
mov esi,[communication_area]
add esi,28
; mov ebx,220*65536+14
mov ebx,(c_start_x+c_size_x*2+10*3)*65536+14
mov ecx,20*65536+14
mov eax,13
mov [frame_data.draw_text_flag],dword 0
;--------------------------------------
newcol:
mov edx,[esi]
mcall
push ebx ecx
sub ebx,2 shl 16
add bx,4
sub ecx,2 shl 16
add cx,4
mov [frame_data.x],ebx
mov [frame_data.y],ecx
push dword frame_data
call [Frame_draw]
pop ecx ebx
add ecx,25*65536
add esi,4
dec edi
jnz newcol
ret
;----------------------------------------------------------------------
align 4 align 4
draw_window: draw_window:
mcall 12,1 mcall 12,1
@ -425,6 +547,8 @@ draw_window:
mov [scroll_bar_data_green.all_redraw],eax mov [scroll_bar_data_green.all_redraw],eax
mov [scroll_bar_data_blue.all_redraw],eax mov [scroll_bar_data_blue.all_redraw],eax
call draw_scrollbars call draw_scrollbars
call draw_button_row
call draw_colours
mcall 12,2 mcall 12,2
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------

View File

@ -71,6 +71,10 @@ scrollbar_ver_mouse dd aScrollbar_ver_mouse
;PathShow_prepare dd sz_PathShow_prepare ;PathShow_prepare dd sz_PathShow_prepare
;PathShow_draw dd sz_PathShow_draw ;PathShow_draw dd sz_PathShow_draw
;Version_path_show dd szVersion_path_show ;Version_path_show dd szVersion_path_show
Frame_draw dd sz_Frame_draw
;Version_frame dd szVersion_frame
dd 0 dd 0
dd 0 dd 0
@ -113,6 +117,9 @@ aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
;sz_PathShow_prepare db 'PathShow_prepare',0 ;sz_PathShow_prepare db 'PathShow_prepare',0
;sz_PathShow_draw db 'PathShow_draw',0 ;sz_PathShow_draw db 'PathShow_draw',0
;szVersion_path_show db 'version_PathShow',0 ;szVersion_path_show db 'version_PathShow',0
sz_Frame_draw db 'frame_draw',0
;szVersion_frame db 'version_frame',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
scroll_bar_data_red: scroll_bar_data_red:
@ -216,3 +223,21 @@ scroll_bar_data_blue:
.all_redraw dd 1 ;+80 .all_redraw dd 1 ;+80
.ar_offset dd 10 ;+84 .ar_offset dd 10 ;+84
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
frame_data:
.type dd 0 ;+0
.x:
.x_size dw 0 ;+4
.x_start dw 0 ;+6
.y:
.y_size dw 0 ;+8
.y_start dw 0 ;+10
.ext_fr_col dd 0x0 ;+12
.int_fr_col dd 0xffffff ;+16
.draw_text_flag dd 1 ;+20
.text_pointer dd 0 ;+24
.text_position dd 0 ;+28
.font_number dd 0 ;+32
.font_size_y dd 9 ;+36
.font_color dd 0x0 ;+40
.font_backgr_color dd 0xffffff ;+44
;---------------------------------------------------------------------