zSea rc5 - use ColorDialog to select color for "background image to the proportional stretching with inscribing"

git-svn-id: svn://kolibrios.org@3423 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2013-03-26 19:24:13 +00:00
parent 96c76fb3ca
commit 3d1cba8d8d
4 changed files with 90 additions and 19 deletions

View File

@ -110,7 +110,7 @@ background:
add eax,[stretch_img_high]
push dword eax ; eax - crop size
push dword 0 ; edi - background color
push dword [background_color] ; edi - background color
push dword 1 ; esi - filtering
push dword 0 ; edx - scaling mode
push dword [stretch_start_coordinates] ; ecx - start_coordinates
@ -177,7 +177,7 @@ background:
push dword 0 ; eax - crop size
push dword 0 ; edi - background color
push dword [background_color] ; edi - background color
push dword 1 ; esi - filtering
push dword 0 ; edx - scaling mode
push dword [stretch_start_coordinates] ; ecx - start_coordinates
@ -218,7 +218,7 @@ background:
sub ecx,44
mov edi,eax
add edi,44
mov eax,0xaaaaaa
mov eax,[background_color] ;0xaaaaaa
cld
@@:
stosb

View File

@ -38,7 +38,7 @@ lsz fitext,\
db 0
;---------------------------------------------------------------------
Authors_text:
.1: db 'zSea version: 1.00 RC4 Date: 25/09/2011',0
.1: db 'zSea version: 1.00 RC5 Date: 26/03/2013',0
.2: db 'Authors:',0
.3: db 'Marat Zakiyanov aka Mario(Mario79)',0
.4: db 'zSea program, modules: cnv_bmp.obj,',0
@ -90,6 +90,12 @@ lsz bgrdtext,\
de, 'Als hintergrund'
db 0
;---------------------------------
lsz scc_text,\
en, 'Position:',\
ru, '<27>®§¨æ¨ï:',\
de, 'Position:'
db 0
;---------------------------------
lsz sorttext,\
en, 'Directory sorting mode:',\
ru, '<27>¥¦¨¬ á®àâ¨à®¢ª¨ ¤¨à¥ªâ®à¨¨:',\
@ -118,6 +124,12 @@ lsz optiontext,\
; ru, '<27> áâï­ãâì',\
; de, 'Gestreckt'
;---------------------------------
lsz color_btn,\
en, 'Background color:',\
ru, '–¢¥â ä®­ :',\
de, 'Hintergrundfarbe:'
db 0
;---------------------------------
lsz ok_btn,\
en, 'Ok',\
ru, 'Ok',\
@ -617,11 +629,18 @@ align 4
ProcLib_import:
OpenDialog_Init dd aOpenDialog_Init
OpenDialog_Start dd aOpenDialog_Start
ColorDialog_Init dd aColorDialog_Init
ColorDialog_Start dd aColorDialog_Start
;OpenDialog__Version dd aOpenDialog_Version
dd 0
dd 0
aOpenDialog_Init db 'OpenDialog_init',0
aOpenDialog_Start db 'OpenDialog_start',0
aColorDialog_Init db 'ColorDialog_init',0
aColorDialog_Start db 'ColorDialog_start',0
;aOpenDialog_Version db 'Version_OpenDialog',0
;---------------------------------------------------------------------
align 4
@ -891,10 +910,10 @@ mouse_dd rd 1
;---------------------------------------------------------------------
align 4
; option_boxes_bcgr:
op1 option_box option_group1,60,40,6,12,0xFFFFFF,0,0xffffff,op_text.1,op_text.e1-op_text.1
op2 option_box option_group1,60,55,6,12,0xFFFFFF,0,0xffffff,op_text.2,op_text.e2-op_text.2
op3 option_box option_group1,60,70,6,12,0xFFFFFF,0,0xffffff,op_text.3,op_text.e3-op_text.3
op4 option_box option_group1,60,85,6,12,0xFFFFFF,0,0xffffff,op_text.4,op_text.e4-op_text.4
op1 option_box option_group1,60,45,6,12,0xFFFFFF,0,0xffffff,op_text.1,op_text.e1-op_text.1
op2 option_box option_group1,60,60,6,12,0xFFFFFF,0,0xffffff,op_text.2,op_text.e2-op_text.2
op3 option_box option_group1,60,75,6,12,0xFFFFFF,0,0xffffff,op_text.3,op_text.e3-op_text.3
op4 option_box option_group1,60,90,6,12,0xFFFFFF,0,0xffffff,op_text.4,op_text.e4-op_text.4
;option_boxes_bcgr_end:
op_text:
@ -1717,6 +1736,28 @@ communication_area_default_pach:
db '/rd/1',0
;communication_area dd 0
;---------------------------------------------------------------------
ColorDialog_data:
.type dd 0
.procinfo dd procinfo ;+4
.com_area_name dd cd_communication_area_name ;+8
.com_area dd 0 ;+12
.start_path dd colordialog_path ;+16
.draw_window dd thread4.draw_window ;+20
.status dd 0 ;+24
.x:
.x_size dw 420 ;+28 ; Window X size
.x_start dw 10 ;+30 ; Window X position
.y:
.y_size dw 320 ;+32 ; Window y size
.y_start dw 10 ;+34 ; Window Y position
.color_type dd 0 ;+36 ; 0- RGB, 1 or other - reserved
.color dd 0 ;+40 ; Selected color
cd_communication_area_name:
db 'FFFFFFFF_color_dialog',0
colordialog_path:
db '/rd/1/colrdial',0
;---------------------------------------------------------------------
; clear bacground thread
clear_thread_stack:
dd 0

View File

@ -306,8 +306,13 @@ thread4: ; start of bgrd thread
;---------------------------------------------------------------------
.button: ; button
mcall 17 ; get id
cmp ah,1 ; button id=1 ?
jne .noclose
cmp ah,4
je .kok
cmp ah,5
je .start_ColorDialog
; cmp ah,1 ; button id=1 ?
; jne .noclose
.close:
xor dword [status],8
xor eax,eax
@ -320,6 +325,21 @@ thread4: ; start of bgrd thread
.kok:
call background
jmp .close
;---------------------------------------------------------------------
.start_ColorDialog:
push dword ColorDialog_data
call [ColorDialog_Start]
call clear_control_key_flag
; 2 - use another method/not found program
cmp [ColorDialog_data.status],2
je .still
; 1 - OK, color selected
cmp [ColorDialog_data.status],1
jne .still
mov eax,[ColorDialog_data.color]
mov [background_color],eax
jmp .still
;---------------------------------------------------------------------
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
@ -328,12 +348,19 @@ thread4: ; start of bgrd thread
mcall 12,1
xor eax,eax
xor esi,esi
mcall ,<100,300>,<100,150>,0x13909090,,labelt4
mcall 8,<70,40>,<110,20>,4,0xdddddd
mcall 4,<46,28>,0xffffff,bgrdtext,bgrdtext.size
add ebx,40*65536+88
mcall ,<100,300>,<100,170>,0x13909090,,labelt4
mcall 8,<60,40>,<120,20>,4,0xdddddd
mcall ,<220,40>,<120,20>,5,[background_color] ; 0xdddddd
mcall 4,<36,28>,0xffffff,bgrdtext,bgrdtext.size
push ebx
add ebx,170*65536
mcall ,,,scc_text,scc_text.size
pop ebx
add ebx,40*65536+98
xor ecx,ecx
mcall ,,,ok_btn,ok_btn.size
add ebx,40*65536
mcall ,,0xffffff,color_btn,color_btn.size
call .option_boxes_redraw
; mcall 47,0x80000,[PID4],<200, 5>,0xffffff
mcall 12,2
@ -351,7 +378,7 @@ thread4: ; start of bgrd thread
mov edx,0xffff80
@@:
mcall 13,<59,14>,<39,59>,
mcall 13,<59,14>,<44,59>,
push dword option_boxes_bcgr
call [option_box_draw]
ret

View File

@ -1,6 +1,6 @@
;*****************************************************************************
; zSea - advanced image viewer for KolibriOS
; Copyright (c) 2008-2011, Marat Zakiyanov aka Mario79, aka Mario
; Copyright (c) 2008-2013, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
@ -25,7 +25,7 @@
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*****************************************************************************
; v.1.0 rñ4 25.09.2011
; v.1.0 rń5 26.03.2013
;******************************************************************************
use32
org 0x0
@ -42,11 +42,10 @@ include 'lang.inc'
;include 'macros.inc'
;include 'editbox_ex.mac'
;include 'proc32.inc'
include '../../macros.inc'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../proc32.inc'
include 'debug.inc'
;include 'load_lib.mac'
include '../../develop/libraries/box_lib/load_lib.mac'
@use_library ;use load lib macros
@ -99,6 +98,10 @@ START: ; start of execution
push dword OpenDialog_data
call [OpenDialog_Init]
;init_ColorDialog ColorDialog_data
push dword ColorDialog_data
call [ColorDialog_Init]
call get_filter_data
;-----------------------------------------------------