From ea0a41f0325e021a03cbdcf0ed051942e4dd478d Mon Sep 17 00:00:00 2001 From: "Marat Zakiyanov (Mario79)" Date: Tue, 26 Mar 2013 04:54:50 +0000 Subject: [PATCH] ColorDialog - pre alpha version. git-svn-id: svn://kolibrios.org@3417 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/colrdial/color_dialog.asm | 102 +++++++++++++++++++++- programs/system/colrdial/color_dialog.bat | 4 +- programs/system/colrdial/u_data.inc | 13 ++- 3 files changed, 113 insertions(+), 6 deletions(-) diff --git a/programs/system/colrdial/color_dialog.asm b/programs/system/colrdial/color_dialog.asm index a5406a63e8..ac57bc2dba 100644 --- a/programs/system/colrdial/color_dialog.asm +++ b/programs/system/colrdial/color_dialog.asm @@ -25,6 +25,40 @@ ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;***************************************************************************** +;--------------------------------------------------------------------- +;Some documentation for memory +; +;area name db 'FFFFFFFF_color_dialog',0 ; FFFFFFFF = PID +; +; communication area data +; flag ; +0 +; dw 0 ; 0 - empty, 1 - OK, color selected +; 2 - use another method/not found program, 3 - cancel +; +; type of dialog: 0-Palette&Tone +; dw 0 ; +2 +; +; window X size ; +4 +; dw 0 +; +; window X position ; +6 +; dw 0 +; +; window y size ; +8 +; dw 0 +; +; window Y position ; +10 +; dw 0 +; +; ColorDialog WINDOW SLOT ; +12 +; dd 0 +; +; Color type ; +16 +; dd 0 +; +; Color value ; +20 +; dd 0 +;--------------------------------------------------------------------- use32 org 0x0 @@ -34,11 +68,12 @@ dd IM_END dd I_END dd stacktop - dd 0x0 + dd param dd 0x0 ;--------------------------------------------------------------------- include '../../macros.inc' ;include 'lang.inc' +;include 'debug.inc' ;--------------------------------------------------------------------- p_start_x = 10 p_start_y = 10 @@ -64,6 +99,11 @@ c_size_y = 20 START: mcall 68,11 + mcall 66,1,1 + mcall 40,0x27 + call get_communication_area + + call get_active_pocess xor eax,eax mov al,p_size_x @@ -120,14 +160,64 @@ button: cmp ah, 3 je tone_button + + cmp ah, 4 + je color_button cmp ah, 1 jne still .exit: + mov eax,[communication_area] + mov [eax],word 3 +; dps "CD flag value: cancel " + +.exit_1: + + mov ax,[eax] + and eax,0xffff +; dps "CD flag value: " +; dpd eax +; newline + mcall -1 ;--------------------------------------------------------------------- align 4 +get_communication_area: + xor eax,eax + mov al,[param] + test eax,eax + jz @f + mcall 68,22,param,,0x01 + mov [communication_area],eax +; movzx ebx,word [eax+2] +; mov [color_dialog_type],ebx + +; mov ebx,[eax+4] +; cmp bx,word x_minimal_size ;300 +; jb @f +; mov [window_x],ebx +; mov ebx,[eax+8] +; cmp bx,word y_minimal_size ;200 +; jb @f +; mov [window_y],ebx +@@: + ret +;--------------------------------------------------------------------- +align 4 +get_active_pocess: + mcall 9,procinfo,-1 + mov ecx,[ebx+30] ; PID + mcall 18,21 + mov [active_process],eax ; WINDOW SLOT + mov ebx,[communication_area] + test ebx,ebx + jz .1 + mov [ebx+12],eax ; WINDOW SLOT to com. area +.1: + ret +;--------------------------------------------------------------------- +align 4 palette_button: mcall 37,1 and eax,0xffff @@ -161,6 +251,15 @@ tone_button: jmp still ;--------------------------------------------------------------------- align 4 +color_button: + mov eax,[communication_area] + mov [eax],word 1 + mov ebx,[selected_color] + mov [eax+20],ebx +; dps "CD flag value: OK " + jmp button.exit_1 +;--------------------------------------------------------------------- +align 4 key: mcall 2 jmp still @@ -168,6 +267,7 @@ key: align 4 draw_selected_color: mcall 13,,,[selected_color] + mcall 8,,,0x60000004 ret ;--------------------------------------------------------------------- align 4 diff --git a/programs/system/colrdial/color_dialog.bat b/programs/system/colrdial/color_dialog.bat index 330b608af8..aa4c2fabd7 100644 --- a/programs/system/colrdial/color_dialog.bat +++ b/programs/system/colrdial/color_dialog.bat @@ -1,6 +1,6 @@ @erase lang.inc @echo lang fix en >lang.inc -@fasm color_dialog.asm color_dialog -@kpack color_dialog +@fasm color_dialog.asm colrdial +@kpack colrdial @erase lang.inc @pause \ No newline at end of file diff --git a/programs/system/colrdial/u_data.inc b/programs/system/colrdial/u_data.inc index 845166b31a..e2b18b4db2 100644 --- a/programs/system/colrdial/u_data.inc +++ b/programs/system/colrdial/u_data.inc @@ -3,6 +3,9 @@ align 4 palette_area rd 1 tone_area rd 1 part_of_size_y rd 1 +active_process rd 1 +;color_dialog_type rd 1 +communication_area rd 1 ;-------------------------------------- offset_y: .red rd 1 @@ -32,9 +35,13 @@ palette_SIZE_X rd 1 tone_SIZE_Y rd 1 tone_SIZE_X rd 1 ;--------------------------------------------------------------------- -;align 4 -;procinfo: -; rb 1024 +align 4 +procinfo: + rb 1024 +;--------------------------------------------------------------------- +align 4 +param: + rb 256 ;--------------------------------------------------------------------- align 4 rb 4096