develop/libraries/box_lib: Post-SVN tidy
Some checks failed
Build system / Check kernel codestyle (pull_request) Successful in 25s
Build system / Build (pull_request) Failing after 35s

- Move source code from `trunk` into program root directory.
- Update build files and ASM include paths.
- Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden.
This commit is contained in:
2025-05-24 20:04:47 +01:00
parent c8cc441230
commit 37eb932a69
86 changed files with 20910 additions and 20743 deletions

View File

@@ -1,422 +1,424 @@
;*****************************************************************************
; Example for Box_lib: scrollbar, menubar, dinamic_button
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;******************************************************************************
; import_boxlib procedure written by <Lrz>
;---------------------------------------------------------------------
use32
org 0
db 'MENUET01'
dd 1
dd START
dd IM_END
dd I_END
dd stacktop
dd 0
dd path
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../load_lib.mac'
@use_library
;---------------------------------------------------------------------
;--- Start of program ----------------------------------------------
;---------------------------------------------------------------------
START:
mcall 68,11
mcall 66,1,1
mcall 40,0x27
;---------------------------------------------------------------------
load_libraries l_libs_start,end_l_libs
test eax,eax
jnz button.exit
; unpack deflate
mov eax,[unpack_DeflateUnpack2]
mov [deflate_unpack],eax
; OpenDialog initialisation
push dword OpenDialog_data
call [OpenDialog_Init]
mov edi,filename_area
mov esi,start_temp_file_name
xor eax,eax
cld
@@:
lodsb
stosb
test eax,eax
jnz @b
; mov ebx,icons_file_name
; mov esi,path
; mov edi,file_name
copy_path icons_file_name,path,library_path,0
mcall 70,fileinfo
mov [fileinfo+0],dword 0
mov ecx,[file_info+32]
mov [fileinfo+12],ecx
mov [img_size],ecx
mcall 68,12
mov [fileinfo+16],eax
mov [image_file],eax
mcall 70,fileinfo
xor eax,eax
mov [return_code],eax
; mov eax,image_file
push image_file
call [cnv_png_import.Start]
mov ecx,[image_file]
mcall 68,13,
cmp [return_code],dword 0
jne button.exit
mov ebx,[raw_pointer]
mov eax,[ebx+4]
; set of button size
mov [dinamic_button_data_1.size_x],ax
mov [dinamic_button_data_1.size_y],ax
mov [dinamic_button_data_2.size_x],ax
mov [dinamic_button_data_2.size_y],ax
mov eax,[ebx+12]
; set of RAW resolution to pixel
mov [dinamic_button_data_1.resolution_raw],eax
mov [dinamic_button_data_2.resolution_raw],eax
mov eax,[ebx+20]
add eax,ebx
; set RAW palette, use else resolution 8bit or less
mov [dinamic_button_data_1.palette_raw],eax
mov [dinamic_button_data_2.palette_raw],eax
mov eax,[ebx+28]
add eax,ebx
; set RAW area for passive button
mov [dinamic_button_data_1.passive_raw],eax
mov [dinamic_button_data_2.passive_raw],eax
mov ecx,[ebx+4]
imul ecx,[ebx+4]
imul ecx,[ebx+12]
shr ecx,3
add eax,ecx
; set RAW area for active button
mov [dinamic_button_data_1.active_raw],eax
mov [dinamic_button_data_2.active_raw],eax
add eax,ecx
; RAW area for click button
mov [dinamic_button_data_1.click_raw],eax
mov [dinamic_button_data_2.click_raw],eax
;---------------------------------------------------------------------
red:
call draw_window
still:
mcall 10
cmp eax,1
je red
cmp eax,2
je key
cmp eax,3
je button
cmp eax,6
je mouse
jmp still
;---------------------------------------------------------------------
key:
mcall 2
jmp still
;---------------------------------------------------------------------
button:
mcall 17
cmp ah,1
jne still
.exit:
mcall -1
;---------------------------------------------------------------------
mouse:
;-----------------------------------------------
cmp [scroll_bar_data_horizontal.delta2],0
jne .horizontal
.vertical:
mov eax,[scroll_bar_data_vertical.max_area]
cmp eax,[scroll_bar_data_vertical.cur_area]
jbe .horizontal
; mouse event for Vertical ScrollBar
push dword scroll_bar_data_vertical
call [scrollbar_ver_mouse]
mov eax,scroll_bar_data_vertical.redraw
xor ebx,ebx
cmp [eax],ebx
je @f
mov [eax],ebx
jmp .draw_cube
@@:
cmp [scroll_bar_data_vertical.delta2],0
jne still
.horizontal:
mov eax,[scroll_bar_data_horizontal.max_area]
cmp eax,[scroll_bar_data_horizontal.cur_area]
jbe .other
; mouse event for Horizontal ScrollBar
push dword scroll_bar_data_horizontal
call [scrollbar_hor_mouse]
mov eax,scroll_bar_data_horizontal.redraw
xor ebx,ebx
cmp [eax],ebx
je .other
mov [eax],ebx
.draw_cube:
call draw_cube
jmp still
.other:
cmp [scroll_bar_data_vertical.delta2],0
jne still
cmp [scroll_bar_data_horizontal.delta2],0
jne still
;-----------------------------------------------
.menu_bar_1:
call .set_mouse_flag
@@:
; mouse event for Menu 1
push dword menu_data_1
call [menu_bar_mouse]
cmp [menu_data_1.click],dword 1
jne .menu_bar_2
cmp [menu_data_1.cursor_out],dword 0
jne analyse_out_menu_1
jmp .menu_bar_1
;--------------------------------------------
.menu_bar_2:
; mouse event for Menu 2
push dword menu_data_2
call [menu_bar_mouse]
cmp [menu_data_2.click],dword 1
jne .mouse_dinamic_button
cmp [menu_data_2.cursor_out],dword 0
jne analyse_out_menu_2
jmp .menu_bar_1
;--------------------------------------------
.mouse_dinamic_button:
; mouse event for Dinamic Button 1
push dword dinamic_button_data_1
call [dinamic_button_mouse]
mov eax,dinamic_button_data_1.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp about
@@:
; mouse event for Dinamic Button 2
push dword dinamic_button_data_2
call [dinamic_button_mouse]
mov eax,dinamic_button_data_2.click
cmp [eax],dword 1
jne still ;@f
mov [eax],dword 0
jmp button.exit
;---------------------------------------------------------------------
.set_mouse_flag:
xor eax,eax
inc eax
mov [menu_data_1.get_mouse_flag],eax
mov [menu_data_2.get_mouse_flag],eax
ret
;---------------------------------------------------------------------
analyse_out_menu_1:
; analyse result of Menu 1
mov eax,[menu_data_1.cursor_out]
cmp eax,dword 1
je OpenDialog_start_0
cmp eax,dword 2
je OpenDialog_start_1
cmp eax,dword 3
je OpenDialog_start_2
cmp eax,dword 4
je button.exit
jmp still
;---------------------------------------------------------------------
analyse_out_menu_2:
; analyse result of Menu 2
cmp [menu_data_2.cursor_out],dword 2
je about
jmp still
;---------------------------------------------------------------------
about:
mcall 51,1,thread3,thread
jmp still
;---------------------------------------------------------------------
OpenDialog_start_0:
mov [OpenDialog_data.type],0
jmp OpenDialog_start
OpenDialog_start_1:
mov [OpenDialog_data.type],1
jmp OpenDialog_start
OpenDialog_start_2:
mov [OpenDialog_data.type],2
OpenDialog_start:
; mov ebx,open_dialog_name
; mov esi,path
; mov edi,library_path
; call copy_file_path
; copy_path open_dialog_name,path,library_path,0
push dword OpenDialog_data
call [OpenDialog_Start]
cmp [OpenDialog_data.status],2 ; OpenDialog does not start
je still ; some kind of alternative, instead OpenDialog
cmp [OpenDialog_data.status],1
jne still ; OpenDialog user say cancel
; copy path
; prepare path - PathShow
push dword PathShow_data_1
call [PathShow_prepare]
call draw_window
jmp still ; OpenDialog user selected the target file
; [OpenDialog_data.openfile_pach] pointer of area the target file
;---------------------------------------------------------------------
;---------------------------------------------------------------------
draw_window:
mcall 12,1
mcall 0,<0,400>,<0,400>,0x03AABBCC,0x805080D0,0x005080D0
mcall 71,1,header_1
;---------------------------------------------
; draw for Menu 1
push dword menu_data_1
call [menu_bar_draw]
; draw for Menu 2
push dword menu_data_2
call [menu_bar_draw]
;---------------------------------------------
; draw for Dinamic Button 1
push dword dinamic_button_data_1
call [dinamic_button_draw]
; draw for Dinamic Button 2
push dword dinamic_button_data_2
call [dinamic_button_draw]
;---------------------------------------------
mcall 13,<170,200>,<25,15>,0xffffb0
; mov bx,28
; add ebx,2 shl 16
; mcall 4,,0xC0000000,text_work_area,,0xffffb0
; draw for PathShow
push dword PathShow_data_1
call [PathShow_draw]
;---------------------------------------------
; set all_redraw flag for draw all ScrollBar
; In some cases it is necessity to draw only the area
; of moving of a "runner", for acceleration of output -
; in this case the flag needs to be reset to 0 (zero).
xor eax,eax
inc eax
mov [scroll_bar_data_vertical.all_redraw],eax
mov [scroll_bar_data_horizontal.all_redraw],eax
; draw for Vertical ScrollBar
push dword scroll_bar_data_vertical
call [scrollbar_ver_draw]
; draw for Horizontal ScrollBar
push dword scroll_bar_data_horizontal
call [scrollbar_hor_draw]
; reset all_redraw flag
xor eax,eax
mov [scroll_bar_data_vertical.all_redraw],eax
mov [scroll_bar_data_horizontal.all_redraw],eax
;---------------------------------------------
call draw_cube
mcall 12,2
ret
;---------------------------------------------------------------------
draw_cube:
mcall 13,<30,301>,<50,301>,0xafafaf
mov ecx,[scroll_bar_data_vertical.position]
add ecx,50
shl ecx,16
mov cx,30
mov ebx,[scroll_bar_data_horizontal.position]
add ebx,30
shl ebx,16
mov bx,30
mcall 13,,,0x0
ret
;---------------------------------------------------------------------
include 'data.inc'
include 'w_about.inc'
;---------------------------------------------------------------------
IM_END:
rb 1024
thread:
;---------------------------------------------------------------------
rb 1024
stacktop:
;---------------------------------------------------------------------
path:
rb 4096
;---------------------------------------------------------------------
openfile_pach:
rb 4096
;---------------------------------------------------------------------
file_name:
library_path:
rb 4096
;---------------------------------------------------------------------
plugin_pach:
rb 4096
;---------------------------------------------------------------------
text_work_area:
rb 4096
;---------------------------------------------------------------------
filename_area:
rb 256
;---------------------------------------------------------------------
file_info:
rb 40
;---------------------------------------------------------------------
procinfo:
rb 1024
;---------------------------------------------------------------------
I_END:
; SPDX-License-Identifier: NOASSERTION
;
;*****************************************************************************
; Example for Box_lib: scrollbar, menubar, dinamic_button
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;******************************************************************************
; import_boxlib procedure written by <Lrz>
;---------------------------------------------------------------------
use32
org 0
db 'MENUET01'
dd 1
dd START
dd IM_END
dd I_END
dd stacktop
dd 0
dd path
include '../../../../macros.inc'
include '../../../../KOSfuncs.inc'
include '../../../../load_lib.mac'
@use_library
;---------------------------------------------------------------------
;--- Start of program ----------------------------------------------
;---------------------------------------------------------------------
START:
mcall 68,11
mcall 66,1,1
mcall 40,0x27
;---------------------------------------------------------------------
load_libraries l_libs_start,end_l_libs
test eax,eax
jnz button.exit
; unpack deflate
mov eax,[unpack_DeflateUnpack2]
mov [deflate_unpack],eax
; OpenDialog initialisation
push dword OpenDialog_data
call [OpenDialog_Init]
mov edi,filename_area
mov esi,start_temp_file_name
xor eax,eax
cld
@@:
lodsb
stosb
test eax,eax
jnz @b
; mov ebx,icons_file_name
; mov esi,path
; mov edi,file_name
copy_path icons_file_name,path,library_path,0
mcall 70,fileinfo
mov [fileinfo+0],dword 0
mov ecx,[file_info+32]
mov [fileinfo+12],ecx
mov [img_size],ecx
mcall 68,12
mov [fileinfo+16],eax
mov [image_file],eax
mcall 70,fileinfo
xor eax,eax
mov [return_code],eax
; mov eax,image_file
push image_file
call [cnv_png_import.Start]
mov ecx,[image_file]
mcall 68,13,
cmp [return_code],dword 0
jne button.exit
mov ebx,[raw_pointer]
mov eax,[ebx+4]
; set of button size
mov [dinamic_button_data_1.size_x],ax
mov [dinamic_button_data_1.size_y],ax
mov [dinamic_button_data_2.size_x],ax
mov [dinamic_button_data_2.size_y],ax
mov eax,[ebx+12]
; set of RAW resolution to pixel
mov [dinamic_button_data_1.resolution_raw],eax
mov [dinamic_button_data_2.resolution_raw],eax
mov eax,[ebx+20]
add eax,ebx
; set RAW palette, use else resolution 8bit or less
mov [dinamic_button_data_1.palette_raw],eax
mov [dinamic_button_data_2.palette_raw],eax
mov eax,[ebx+28]
add eax,ebx
; set RAW area for passive button
mov [dinamic_button_data_1.passive_raw],eax
mov [dinamic_button_data_2.passive_raw],eax
mov ecx,[ebx+4]
imul ecx,[ebx+4]
imul ecx,[ebx+12]
shr ecx,3
add eax,ecx
; set RAW area for active button
mov [dinamic_button_data_1.active_raw],eax
mov [dinamic_button_data_2.active_raw],eax
add eax,ecx
; RAW area for click button
mov [dinamic_button_data_1.click_raw],eax
mov [dinamic_button_data_2.click_raw],eax
;---------------------------------------------------------------------
red:
call draw_window
still:
mcall 10
cmp eax,1
je red
cmp eax,2
je key
cmp eax,3
je button
cmp eax,6
je mouse
jmp still
;---------------------------------------------------------------------
key:
mcall 2
jmp still
;---------------------------------------------------------------------
button:
mcall 17
cmp ah,1
jne still
.exit:
mcall -1
;---------------------------------------------------------------------
mouse:
;-----------------------------------------------
cmp [scroll_bar_data_horizontal.delta2],0
jne .horizontal
.vertical:
mov eax,[scroll_bar_data_vertical.max_area]
cmp eax,[scroll_bar_data_vertical.cur_area]
jbe .horizontal
; mouse event for Vertical ScrollBar
push dword scroll_bar_data_vertical
call [scrollbar_ver_mouse]
mov eax,scroll_bar_data_vertical.redraw
xor ebx,ebx
cmp [eax],ebx
je @f
mov [eax],ebx
jmp .draw_cube
@@:
cmp [scroll_bar_data_vertical.delta2],0
jne still
.horizontal:
mov eax,[scroll_bar_data_horizontal.max_area]
cmp eax,[scroll_bar_data_horizontal.cur_area]
jbe .other
; mouse event for Horizontal ScrollBar
push dword scroll_bar_data_horizontal
call [scrollbar_hor_mouse]
mov eax,scroll_bar_data_horizontal.redraw
xor ebx,ebx
cmp [eax],ebx
je .other
mov [eax],ebx
.draw_cube:
call draw_cube
jmp still
.other:
cmp [scroll_bar_data_vertical.delta2],0
jne still
cmp [scroll_bar_data_horizontal.delta2],0
jne still
;-----------------------------------------------
.menu_bar_1:
call .set_mouse_flag
@@:
; mouse event for Menu 1
push dword menu_data_1
call [menu_bar_mouse]
cmp [menu_data_1.click],dword 1
jne .menu_bar_2
cmp [menu_data_1.cursor_out],dword 0
jne analyse_out_menu_1
jmp .menu_bar_1
;--------------------------------------------
.menu_bar_2:
; mouse event for Menu 2
push dword menu_data_2
call [menu_bar_mouse]
cmp [menu_data_2.click],dword 1
jne .mouse_dinamic_button
cmp [menu_data_2.cursor_out],dword 0
jne analyse_out_menu_2
jmp .menu_bar_1
;--------------------------------------------
.mouse_dinamic_button:
; mouse event for Dinamic Button 1
push dword dinamic_button_data_1
call [dinamic_button_mouse]
mov eax,dinamic_button_data_1.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp about
@@:
; mouse event for Dinamic Button 2
push dword dinamic_button_data_2
call [dinamic_button_mouse]
mov eax,dinamic_button_data_2.click
cmp [eax],dword 1
jne still ;@f
mov [eax],dword 0
jmp button.exit
;---------------------------------------------------------------------
.set_mouse_flag:
xor eax,eax
inc eax
mov [menu_data_1.get_mouse_flag],eax
mov [menu_data_2.get_mouse_flag],eax
ret
;---------------------------------------------------------------------
analyse_out_menu_1:
; analyse result of Menu 1
mov eax,[menu_data_1.cursor_out]
cmp eax,dword 1
je OpenDialog_start_0
cmp eax,dword 2
je OpenDialog_start_1
cmp eax,dword 3
je OpenDialog_start_2
cmp eax,dword 4
je button.exit
jmp still
;---------------------------------------------------------------------
analyse_out_menu_2:
; analyse result of Menu 2
cmp [menu_data_2.cursor_out],dword 2
je about
jmp still
;---------------------------------------------------------------------
about:
mcall 51,1,thread3,thread
jmp still
;---------------------------------------------------------------------
OpenDialog_start_0:
mov [OpenDialog_data.type],0
jmp OpenDialog_start
OpenDialog_start_1:
mov [OpenDialog_data.type],1
jmp OpenDialog_start
OpenDialog_start_2:
mov [OpenDialog_data.type],2
OpenDialog_start:
; mov ebx,open_dialog_name
; mov esi,path
; mov edi,library_path
; call copy_file_path
; copy_path open_dialog_name,path,library_path,0
push dword OpenDialog_data
call [OpenDialog_Start]
cmp [OpenDialog_data.status],2 ; OpenDialog does not start
je still ; some kind of alternative, instead OpenDialog
cmp [OpenDialog_data.status],1
jne still ; OpenDialog user say cancel
; copy path
; prepare path - PathShow
push dword PathShow_data_1
call [PathShow_prepare]
call draw_window
jmp still ; OpenDialog user selected the target file
; [OpenDialog_data.openfile_pach] pointer of area the target file
;---------------------------------------------------------------------
;---------------------------------------------------------------------
draw_window:
mcall 12,1
mcall 0,<0,400>,<0,400>,0x03AABBCC,0x805080D0,0x005080D0
mcall 71,1,header_1
;---------------------------------------------
; draw for Menu 1
push dword menu_data_1
call [menu_bar_draw]
; draw for Menu 2
push dword menu_data_2
call [menu_bar_draw]
;---------------------------------------------
; draw for Dinamic Button 1
push dword dinamic_button_data_1
call [dinamic_button_draw]
; draw for Dinamic Button 2
push dword dinamic_button_data_2
call [dinamic_button_draw]
;---------------------------------------------
mcall 13,<170,200>,<25,15>,0xffffb0
; mov bx,28
; add ebx,2 shl 16
; mcall 4,,0xC0000000,text_work_area,,0xffffb0
; draw for PathShow
push dword PathShow_data_1
call [PathShow_draw]
;---------------------------------------------
; set all_redraw flag for draw all ScrollBar
; In some cases it is necessity to draw only the area
; of moving of a "runner", for acceleration of output -
; in this case the flag needs to be reset to 0 (zero).
xor eax,eax
inc eax
mov [scroll_bar_data_vertical.all_redraw],eax
mov [scroll_bar_data_horizontal.all_redraw],eax
; draw for Vertical ScrollBar
push dword scroll_bar_data_vertical
call [scrollbar_ver_draw]
; draw for Horizontal ScrollBar
push dword scroll_bar_data_horizontal
call [scrollbar_hor_draw]
; reset all_redraw flag
xor eax,eax
mov [scroll_bar_data_vertical.all_redraw],eax
mov [scroll_bar_data_horizontal.all_redraw],eax
;---------------------------------------------
call draw_cube
mcall 12,2
ret
;---------------------------------------------------------------------
draw_cube:
mcall 13,<30,301>,<50,301>,0xafafaf
mov ecx,[scroll_bar_data_vertical.position]
add ecx,50
shl ecx,16
mov cx,30
mov ebx,[scroll_bar_data_horizontal.position]
add ebx,30
shl ebx,16
mov bx,30
mcall 13,,,0x0
ret
;---------------------------------------------------------------------
include 'data.inc'
include 'w_about.inc'
;---------------------------------------------------------------------
IM_END:
rb 1024
thread:
;---------------------------------------------------------------------
rb 1024
stacktop:
;---------------------------------------------------------------------
path:
rb 4096
;---------------------------------------------------------------------
openfile_pach:
rb 4096
;---------------------------------------------------------------------
file_name:
library_path:
rb 4096
;---------------------------------------------------------------------
plugin_pach:
rb 4096
;---------------------------------------------------------------------
text_work_area:
rb 4096
;---------------------------------------------------------------------
filename_area:
rb 256
;---------------------------------------------------------------------
file_info:
rb 40
;---------------------------------------------------------------------
procinfo:
rb 1024
;---------------------------------------------------------------------
I_END:

View File

@@ -1,194 +1,200 @@
;§ £®«®¢®ª ¯à¨«®¦¥­¨ï
use32 ; âà ­á«ïâ®à, ¨á¯®«ì§ãî騩 32 à §à來ëå ª®¬ ­¤ë
org 0 ; ¡ §®¢ë©  ¤à¥á ª®¤ , ¢á¥£¤  0
db 'MENUET01' ; ¨¤¥­â¨ä¨ª â®à ¨á¯®«­ï¥¬®£® ä ©«  (8 ¡ ©â)
dd 1 ; ¢¥àá¨ï ä®à¬ â  § £®«®¢ª  ¨á¯®«­ï¥¬®£® ä ©« 
dd start ;  ¤à¥á, ­  ª®â®àë© á¨á⥬  ¯¥à¥¤ ñâ ã¯à ¢«¥­¨¥
; ¯®á«¥ § £à㧪¨ ¯à¨«®¦¥­¨ï ¢ ¯ ¬ïâì
dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
dd mem ; Ž¡ê¥¬ ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨, ¤«ï á⥪  ®â¢¥¤¥¬ 0å100 ¡ ©â ¨ ¢ë஢­¨¬ ­  £à­¨æã 4 ¡ ©â 
dd mem ; à á¯®«®¦¨¬ ¯®§¨æ¨î á⥪  ¢ ®¡« á⨠¯ ¬ïâ¨, áà §ã §  ⥫®¬ ¯à®£à ¬¬ë. ‚¥à設  á⥪  ¢ ¤¨ ¯ §®­¥ ¯ ¬ïâ¨, 㪠§ ­­®¬ ¢ëè¥
dd 0 ; 㪠§ â¥«ì ­  áâபã á ¯ à ¬¥âà ¬¨.
dd cur_dir_path ; 㪠§ â¥«ì ­   ¤à¥á, ªã¤  ¯®¬¥é ¥âáï áâப , ᮤ¥à¦ é ï ¯ãâì ¤® ¯à®£à ¬¬ë ¢ ¬®¬¥­â § ¯ã᪠.
include '../../../../../macros.inc'
include '../../trunk/box_lib.mac'
include '../../../../../KOSfuncs.inc'
include '../../../../../load_lib.mac'
@use_library ;use load lib macros
start:
;universal load library/librarys
sys_load_library library_name, library_path, system_path, myimport
;if return code =-1 then exit, else nornary work
cmp eax,-1
jz exit
mcall SF_SET_EVENTS_MASK,0x80000027 ;ãáâ ­®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩
push dword check1 ;¯®¤áçñâ ¤¨­ë ⥪áâ  ¤«ï Checkbox'®¢
call [init_checkbox]
push dword check2
call [init_checkbox]
red_win:
call draw_window ;¯¥à¢®­ ç «ì­® ­¥®¡å®¤¨¬® ­ à¨á®¢ âì ®ª­®
align 4
still: ;®á­®¢­®© ®¡à ¡®â稪
mcall SF_WAIT_EVENT
dec eax
jz red_win
dec eax
jz key
dec eax
jz button
push dword edit1
call [edit_box_mouse]
push dword edit2
call [edit_box_mouse]
push dword check1
call [check_box_mouse]
push dword check2
call [check_box_mouse]
push dword Option_boxs
call [option_box_mouse]
push dword Option_boxs2
call [option_box_mouse]
jmp still ;¥á«¨ ­¨ç¥£® ¨§ ¯¥à¥ç¨á«¥­­®£® â® á­®¢  ¢ 横«
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
button:
mcall SF_GET_BUTTON
test ah,ah ;¥á«¨ ¢ ah 0, â® ¯¥à¥©â¨ ­  ®¡à ¡®â稪 ᮡë⨩ still
jz still
exit:
mcall SF_TERMINATE_PROCESS
key:
mcall SF_GET_KEY
push dword edit1
call [edit_box_key]
push dword edit2
call [edit_box_key]
jmp still
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
align 4
draw_window: ;à¨á®¢ ­¨¥ ®ª­  ¯à¨«®¦¥­¨ï
mcall SF_REDRAW, SSF_BEGIN_DRAW
mcall SF_CREATE_WINDOW,(50*65536+390),(30*65536+200),0x33AABBCC,0x805080DD,hed
push dword edit1
call [edit_box_draw]
push dword edit2
call [edit_box_draw]
push dword check1
call [check_box_draw]
push dword check2
call [check_box_draw]
push dword Option_boxs
call [option_box_draw]
push dword Option_boxs2
call [option_box_draw]
mcall SF_REDRAW, SSF_END_DRAW
ret
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;DATA ¤ ­­ë¥
;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨.
system_path db '/sys/lib/'
library_name db 'box_lib.obj',0
; …᫨ ¥áâì ¦¥« ­¨¥ ࠧꥤ¨­¨âì, â® ­ã¦­® ¨á¯®«ì§®¢ âì á«¥¤ãîé¨î ª®­áâàãªæ¨î
;system_path db '/sys/lib/box_lib.obj',0
;... «î¡ ï ¯®á«¥¤®¢ â¥«ì­®áâì ¤àã£¨å ª®¬ ­¤ ¨ ®¯à¥¤¥«¥­¨©.
;library_name db 'box_lib.obj',0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
myimport:
edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse
version_ed dd aVersion_ed
init_checkbox dd aInit_checkbox
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
version_ch dd aVersion_ch
option_box_draw dd aOption_box_draw
option_box_mouse dd aOption_box_mouse
version_op dd aVersion_op
dd 0,0
aEdit_box_draw db 'edit_box_draw',0
aEdit_box_key db 'edit_box_key',0
aEdit_box_mouse db 'edit_box_mouse',0
aVersion_ed db 'version_ed',0
aInit_checkbox db 'init_checkbox2',0
aCheck_box_draw db 'check_box_draw2',0
aCheck_box_mouse db 'check_box_mouse2',0
aVersion_ch db 'version_ch2',0
aOption_box_draw db 'option_box_draw',0
aOption_box_mouse db 'option_box_mouse',0
aVersion_op db 'version_op',0
check1 check_box2 (10 shl 16 + 12),(45 shl 16 + 12),5,0x80AABBCC,0,0,check_text1,ch_flag_en
check2 check_box2 (10 shl 16 + 12),(60 shl 16 + 12),6,0x80AABBCC,0,0,check_text2
edit1 edit_box 350,3,5,0xffffff,0x6f9480,0,0xAABBCC,0,308,hed,mouse_dd,ed_focus,hed_end-hed-1,hed_end-hed-1
edit2 edit_box 350,3,25,0xffffff,0x6a9480,0,0,0,99,ed_buffer,mouse_dd,ed_figure_only
op1 option_box option_group1,10,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
op2 option_box option_group1,10,105,6,12,0xFFFFFF,0,0,op_text.2,op_text.e2-op_text.2
op3 option_box option_group1,10,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
op11 option_box option_group2,120,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
op12 option_box option_group2,120,105,6,12,0xffffff,0,0,op_text.2,op_text.e2-op_text.2
op13 option_box option_group2,120,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
option_group1 dd op1 ;㪠§ â¥«¨, ®­¨ ®â®¡à ¦ îâáï ¯® 㬮«ç ­¨î, ª®£¤  ¢ë¢®¤¨âáï
option_group2 dd op12 ;¯à¨«®¦¥­¨¥
Option_boxs dd op1,op2,op3,0
Option_boxs2 dd op11,op12,op13,0
hed db 'BOXs load from lib <Lrz> date 27.04.2009',0
hed_end:
rb 256
check_text1 db 'First checkbox',0
check_text2 db 'Second checkbox',0
op_text: ; ‘®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï Optionbox' 
.1 db 'Option_Box #1'
.e1:
.2 db 'Option_Box #2'
.e2:
.3 db 'Option_Box #3'
.e3:
ed_buffer rb 100
;-----------------------
;sc system_colors
mouse_dd rd 1
p_info process_information
cur_dir_path rb 4096
library_path rb 4096
i_end:
rb 1024
mem:
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
;§ £®«®¢®ª ¯à¨«®¦¥­¨ï
use32 ; âà ­á«ïâ®à, ¨á¯®«ì§ãî騩 32 à §à來ëå ª®¬ ­¤ë
org 0 ; ¡ §®¢ë©  ¤à¥á ª®¤ , ¢á¥£¤  0
db 'MENUET01' ; ¨¤¥­â¨ä¨ª â®à ¨á¯®«­ï¥¬®£® ä ©«  (8 ¡ ©â)
dd 1 ; ¢¥àá¨ï ä®à¬ â  § £®«®¢ª  ¨á¯®«­ï¥¬®£® ä ©« 
dd start ;  ¤à¥á, ­  ª®â®àë© á¨á⥬  ¯¥à¥¤ ñâ ã¯à ¢«¥­¨¥
; ¯®á«¥ § £à㧪¨ ¯à¨«®¦¥­¨ï ¢ ¯ ¬ïâì
dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
dd mem ; Ž¡ê¥¬ ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨, ¤«ï á⥪  ®â¢¥¤¥¬ 0å100 ¡ ©â ¨ ¢ë஢­¨¬ ­  £à­¨æã 4 ¡ ©â 
dd mem ; à á¯®«®¦¨¬ ¯®§¨æ¨î á⥪  ¢ ®¡« á⨠¯ ¬ïâ¨, áà §ã §  ⥫®¬ ¯à®£à ¬¬ë. ‚¥à設  á⥪  ¢ ¤¨ ¯ §®­¥ ¯ ¬ïâ¨, 㪠§ ­­®¬ ¢ëè¥
dd 0 ; 㪠§ â¥«ì ­  áâபã á ¯ à ¬¥âà ¬¨.
dd cur_dir_path ; 㪠§ â¥«ì ­   ¤à¥á, ªã¤  ¯®¬¥é ¥âáï áâப , ᮤ¥à¦ é ï ¯ãâì ¤® ¯à®£à ¬¬ë ¢ ¬®¬¥­â § ¯ã᪠.
include '../../../../macros.inc'
include '../box_lib.mac'
include '../../../../KOSfuncs.inc'
include '../../../../load_lib.mac'
@use_library ;use load lib macros
start:
;universal load library/librarys
sys_load_library library_name, library_path, system_path, myimport
;if return code =-1 then exit, else nornary work
cmp eax,-1
jz exit
mcall SF_SET_EVENTS_MASK,0x80000027 ;ãáâ ­®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩
push dword check1 ;¯®¤áçñâ ¤¨­ë ⥪áâ  ¤«ï Checkbox'®¢
call [init_checkbox]
push dword check2
call [init_checkbox]
red_win:
call draw_window ;¯¥à¢®­ ç «ì­® ­¥®¡å®¤¨¬® ­ à¨á®¢ âì ®ª­®
align 4
still: ;®á­®¢­®© ®¡à ¡®â稪
mcall SF_WAIT_EVENT
dec eax
jz red_win
dec eax
jz key
dec eax
jz button
push dword edit1
call [edit_box_mouse]
push dword edit2
call [edit_box_mouse]
push dword check1
call [check_box_mouse]
push dword check2
call [check_box_mouse]
push dword Option_boxs
call [option_box_mouse]
push dword Option_boxs2
call [option_box_mouse]
jmp still ;¥á«¨ ­¨ç¥£® ¨§ ¯¥à¥ç¨á«¥­­®£® â® á­®¢  ¢ 横«
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
button:
mcall SF_GET_BUTTON
test ah,ah ;¥á«¨ ¢ ah 0, â® ¯¥à¥©â¨ ­  ®¡à ¡®â稪 ᮡë⨩ still
jz still
exit:
mcall SF_TERMINATE_PROCESS
key:
mcall SF_GET_KEY
push dword edit1
call [edit_box_key]
push dword edit2
call [edit_box_key]
jmp still
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
align 4
draw_window: ;à¨á®¢ ­¨¥ ®ª­  ¯à¨«®¦¥­¨ï
mcall SF_REDRAW, SSF_BEGIN_DRAW
mcall SF_CREATE_WINDOW,(50*65536+390),(30*65536+200),0x33AABBCC,0x805080DD,hed
push dword edit1
call [edit_box_draw]
push dword edit2
call [edit_box_draw]
push dword check1
call [check_box_draw]
push dword check2
call [check_box_draw]
push dword Option_boxs
call [option_box_draw]
push dword Option_boxs2
call [option_box_draw]
mcall SF_REDRAW, SSF_END_DRAW
ret
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;DATA ¤ ­­ë¥
;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨.
system_path db '/sys/lib/'
library_name db 'box_lib.obj',0
; …᫨ ¥áâì ¦¥« ­¨¥ ࠧꥤ¨­¨âì, â® ­ã¦­® ¨á¯®«ì§®¢ âì á«¥¤ãîé¨î ª®­áâàãªæ¨î
;system_path db '/sys/lib/box_lib.obj',0
;... «î¡ ï ¯®á«¥¤®¢ â¥«ì­®áâì ¤àã£¨å ª®¬ ­¤ ¨ ®¯à¥¤¥«¥­¨©.
;library_name db 'box_lib.obj',0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
myimport:
edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse
version_ed dd aVersion_ed
init_checkbox dd aInit_checkbox
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
version_ch dd aVersion_ch
option_box_draw dd aOption_box_draw
option_box_mouse dd aOption_box_mouse
version_op dd aVersion_op
dd 0,0
aEdit_box_draw db 'edit_box_draw',0
aEdit_box_key db 'edit_box_key',0
aEdit_box_mouse db 'edit_box_mouse',0
aVersion_ed db 'version_ed',0
aInit_checkbox db 'init_checkbox2',0
aCheck_box_draw db 'check_box_draw2',0
aCheck_box_mouse db 'check_box_mouse2',0
aVersion_ch db 'version_ch2',0
aOption_box_draw db 'option_box_draw',0
aOption_box_mouse db 'option_box_mouse',0
aVersion_op db 'version_op',0
check1 check_box2 (10 shl 16 + 12),(45 shl 16 + 12),5,0x80AABBCC,0,0,check_text1,ch_flag_en
check2 check_box2 (10 shl 16 + 12),(60 shl 16 + 12),6,0x80AABBCC,0,0,check_text2
edit1 edit_box 350,3,5,0xffffff,0x6f9480,0,0xAABBCC,0,308,hed,mouse_dd,ed_focus,hed_end-hed-1,hed_end-hed-1
edit2 edit_box 350,3,25,0xffffff,0x6a9480,0,0,0,99,ed_buffer,mouse_dd,ed_figure_only
op1 option_box option_group1,10,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
op2 option_box option_group1,10,105,6,12,0xFFFFFF,0,0,op_text.2,op_text.e2-op_text.2
op3 option_box option_group1,10,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
op11 option_box option_group2,120,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
op12 option_box option_group2,120,105,6,12,0xffffff,0,0,op_text.2,op_text.e2-op_text.2
op13 option_box option_group2,120,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
option_group1 dd op1 ;㪠§ â¥«¨, ®­¨ ®â®¡à ¦ îâáï ¯® 㬮«ç ­¨î, ª®£¤  ¢ë¢®¤¨âáï
option_group2 dd op12 ;¯à¨«®¦¥­¨¥
Option_boxs dd op1,op2,op3,0
Option_boxs2 dd op11,op12,op13,0
hed db 'BOXs load from lib <Lrz> date 27.04.2009',0
hed_end:
rb 256
check_text1 db 'First checkbox',0
check_text2 db 'Second checkbox',0
op_text: ; ‘®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï Optionbox' 
.1 db 'Option_Box #1'
.e1:
.2 db 'Option_Box #2'
.e2:
.3 db 'Option_Box #3'
.e3:
ed_buffer rb 100
;-----------------------
;sc system_colors
mouse_dd rd 1
p_info process_information
cur_dir_path rb 4096
library_path rb 4096
i_end:
rb 1024
mem:

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,171 +1,177 @@
; <EFBFBD>à®á⮩ ¯à¨¬¥à ¯à®£à ¬¬ë ¤«ï KolibriOS
; ®§¢ã稢 ¥â ª®¤ ­ ¦ â®© ª« ¢¨è¨
; - ¯¥à¥¤¥« ­ ª ª ¯à¨¬¥à ¨á¯®«ì§®¢ ­¨ï tooltip
use32 ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
org 0 ;  ¤à¥á æ¨ï á ­ã«ï
db 'MENUET01' ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
dd 1 ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
dd START ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
dd CODE_END ; à §¬¥à ¯à®£à ¬¬ë
dd DATA_END ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
dd STACK_END ;  ¤à¥á ¢¥à設ë áâíª 
dd 0 ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢
dd cur_dir_path ; 㪠§ â¥«ì ­   ¤à¥á, ªã¤  ¯®¬¥é ¥âáï áâப , ᮤ¥à¦ é ï ¯ãâì ¤® ¯à®£à ¬¬ë ¢ ¬®¬¥­â § ¯ã᪠.
include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../dll.inc' ; malloc fn
include '../../trunk/box_lib.mac'
include '../../../../../load_lib.mac'
;---------------------------------------------------------------------
;--- <20>€—€Ž <20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
;---------------------------------------------------------------------
; íâ®â ¬ ªà®á ®¡ï§ â¥«¥­ ¤«ï ¢á¥å ª®¬¯®­¥â®¢, ¨á¯®«ì§ãîé¨å heap
; ªà®¬¥ ⮣®, ®¡ï§ â¥«ì­® ¨¬®àâ¨à®¢ âì lib_init - ¯à¨ ¨¬¯®à⥠®¯à¥¤¥«ïîâáï
; ä㭪樨 娯  ¤«ï ¡¨¡«¨®â¥ª¨
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
START:
;---------------------------------------------------------------------
;--- ˆ<>ˆˆˆ‡€ˆŸ ----------------------------------------
;---------------------------------------------------------------------
mcall 68, 11
mcall 40, $C0000027 ; ¬ áª  ᮡë⨩ - ¬ëèì ⮫쪮 ¢  ªâ¨¢­®¬ ®ª­¥
sys_load_library lib_name, lib_path, sys_path, myimport
test eax,eax
jz @f
mcall -1 ; alarm exit
@@:
invoke tooltip_init, redbox_tt ; only begin of list
red: ; ¯¥à¥à¨á®¢ âì ®ª­®
call draw_window ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª­ 
;---------------------------------------------------------------------
;--- –ˆŠ‹ Ž<><C5BD><EFBFBD>ŽŠˆ Ž<E28098>ˆ‰ ----------------------------------------
;---------------------------------------------------------------------
still:
mcall 23, 5 ; äã­ªæ¨ï 23 - ¦¤ âì ᮡëâ¨ï <20>¥ ¡®«¥¥ 祬 0.05á
test eax, eax ; ­¥â ᮡë⨩ - ¯à®¢¥à¨âì à¨á®¢ ­¨¥ âã«â¨¯®¢ ¯® â ©¬¥àã
je yield
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª­® ?
je red ; ¥á«¨ ¤  - ­  ¬¥âªã red
cmp eax,2 ; ­ ¦ â  ª« ¢¨è  ?
je key ; ¥á«¨ ¤  - ­  key
cmp eax,3 ; ­ ¦ â  ª­®¯ª  ?
je button ; ¥á«¨ ¤  - ­  button
cmp eax,6 ; ᮡë⨥ ¬ëè¨
je mouse ; ¥á«¨ ¤  - ­  mouse
jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ­ ç «® 横« 
;---------------------------------------------------------------------
yield:
invoke tooltip_test_show, redbox_tt
jmp still ; ¢¥à­ãâìáï ª ­ ç «ã 横« 
mouse:
invoke tooltip_mouse, redbox_tt
jmp still ; ¢¥à­ãâìáï ª ­ ç «ã 横« 
key: ; ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãà¥
mcall 2 ; äã­ªæ¨ï 2 - áç¨â âì ª®¤ ᨬ¢®«  (¢ ah)
jmp still ; ¢¥à­ãâìáï ª ­ ç «ã 横« 
;---------------------------------------------------------------------
button:
mcall 17 ; 17 - ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
cmp ah, 1 ; ¥á«¨ <20>… ­ ¦ â  ª­®¯ª  á ­®¬¥à®¬ 1,
jne still ; ¢¥à­ãâìáï
pexit:
invoke tooltip_delete, redbox_tt ; ®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
mcall -1 ; ¨­ ç¥ ª®­¥æ ¯à®£à ¬¬ë
;---------------------------------------------------------------------
;--- Ž<><C5BD>…„…<E280B9>ˆˆ Ž<C5BD>ˆŽŠ€ ŽŠ<C5BD>€ ----------------------------------
;---------------------------------------------------------------------
draw_window:
mcall 12, 1 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ® ­ ç «¥ ®âà¨á®¢ª¨
mcall 48, 3, sc,sizeof.system_colors
mov edx, [sc.work] ; 梥â ä®­ 
or edx, 0x33000000 ; ¨ ⨯ ®ª­  3
mcall 0, <200,300>, <200,150>, , ,title
; ¢ë¢®¤ ª¢ ¤à â¨ª®¢
mcall 13, <60,50>, <50,50>, $FF0000
mcall 13, <140,50>, <50,50>, $FF
mcall 12, 2 ; äã­ªæ¨ï 12.2, § ª®­ç¨«¨ à¨á®¢ âì
ret ; ¢ë室¨¬ ¨§ ¯à®æ¥¤ãàë
CODE_END: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë; --------------------------------------------;
; ---------------------------------------------------------------------------- ;
;---------------------------------------------------------------------
;--- „€<E2809E><E282AC><20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
;---------------------------------------------------------------------
sys_path db '/sys/lib/'
;sys_path db '/tmp0/1/'
lib_name db 'box_lib.obj',0
cur_dir_path rb 4096
lib_path rb 4096
myimport:
dd sz_lib_init ;äã­ªæ¨ï § ¯ã᪠¥âáï ¬ ªà®á®¬ 1 à § ¯à¨ ¯®¤ª«î祭¨¨
;¡¨¡«¨®â¥ª¨, ¯®â®¬ã ¢ ¯à®£à ¬¬¥ ¬¥âª  ­  ­¥¥ ­¥ ­ã¦­ 
tooltip_init dd sz_tooltip_init
tooltip_delete dd sz_tooltip_delete
tooltip_test_show dd sz_tooltip_test_show
tooltip_mouse dd sz_tooltip_mouse
get_font_size dd sz_get_font_size
dd 0,0
sz_lib_init db 'lib_init',0
sz_tooltip_init db 'tooltip_init', 0
sz_tooltip_delete db 'tooltip_delete', 0
sz_tooltip_test_show db 'tooltip_test_show', 0
sz_tooltip_mouse db 'tooltip_mouse', 0
sz_get_font_size db 'get_font_size', 0
;tooltip txt, next, zone_x, zone_w, zone_y, zone_h, col_txt, col_bkg, tm_wait
redbox_tt tooltip redboxtxt, blubox_tt, 60, 50, 50, 50, 0, $FFF473, 100
blubox_tt tooltip bluboxtxt, 0, 140, 50, 50, 50, $110000FF, $FFF473, 100
redboxtxt db 'Red Box Tooltip', 13, 'May be multilined', 13, 13, 'Even with empty lines', 0
bluboxtxt db 'Blue Box Tooltip', 0
sc system_colors
title db 'Toooltip demo',0
; stack----------------------------------------------------------------------- ;
rb 4096
STACK_END dd ?
DATA_END: ; ¬¥âª  ª®­æ  ¤ ­­ëå ¯à®£à ¬¬ë; ------------------------------------ ;
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
; <20>à®á⮩ ¯à¨¬¥à ¯à®£à ¬¬ë ¤«ï KolibriOS
; ®§¢ã稢 ¥â ª®¤ ­ ¦ â®© ª« ¢¨è¨
; - ¯¥à¥¤¥« ­ ª ª ¯à¨¬¥à ¨á¯®«ì§®¢ ­¨ï tooltip
use32 ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
org 0 ;  ¤à¥á æ¨ï á ­ã«ï
db 'MENUET01' ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
dd 1 ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
dd START ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
dd CODE_END ; à §¬¥à ¯à®£à ¬¬ë
dd DATA_END ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
dd STACK_END ;  ¤à¥á ¢¥à設ë áâíª 
dd 0 ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢
dd cur_dir_path ; 㪠§ â¥«ì ­   ¤à¥á, ªã¤  ¯®¬¥é ¥âáï áâப , ᮤ¥à¦ é ï ¯ãâì ¤® ¯à®£à ¬¬ë ¢ ¬®¬¥­â § ¯ã᪠.
include '../../../../proc32.inc'
include '../../../../macros.inc'
include '../../../../KOSfuncs.inc'
include '../../../../dll.inc' ; malloc fn
include '../box_lib.mac'
include '../../../../load_lib.mac'
;---------------------------------------------------------------------
;--- <20>€—€Ž <20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
;---------------------------------------------------------------------
; íâ®â ¬ ªà®á ®¡ï§ â¥«¥­ ¤«ï ¢á¥å ª®¬¯®­¥â®¢, ¨á¯®«ì§ãîé¨å heap
; ªà®¬¥ ⮣®, ®¡ï§ â¥«ì­® ¨¬®àâ¨à®¢ âì lib_init - ¯à¨ ¨¬¯®à⥠®¯à¥¤¥«ïîâáï
; ä㭪樨 娯  ¤«ï ¡¨¡«¨®â¥ª¨
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
START:
;---------------------------------------------------------------------
;--- ˆ<>ˆˆˆ‡€ˆŸ ----------------------------------------
;---------------------------------------------------------------------
mcall 68, 11
mcall 40, $C0000027 ; ¬ áª  ᮡë⨩ - ¬ëèì ⮫쪮 ¢  ªâ¨¢­®¬ ®ª­¥
sys_load_library lib_name, lib_path, sys_path, myimport
test eax,eax
jz @f
mcall -1 ; alarm exit
@@:
invoke tooltip_init, redbox_tt ; only begin of list
red: ; ¯¥à¥à¨á®¢ âì ®ª­®
call draw_window ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª­ 
;---------------------------------------------------------------------
;--- –ˆŠ‹ Ž<><C5BD><EFBFBD>ŽŠˆ Ž<E28098>ˆ‰ ----------------------------------------
;---------------------------------------------------------------------
still:
mcall 23, 5 ; äã­ªæ¨ï 23 - ¦¤ âì ᮡëâ¨ï <20>¥ ¡®«¥¥ 祬 0.05á
test eax, eax ; ­¥â ᮡë⨩ - ¯à®¢¥à¨âì à¨á®¢ ­¨¥ âã«â¨¯®¢ ¯® â ©¬¥àã
je yield
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª­® ?
je red ; ¥á«¨ ¤  - ­  ¬¥âªã red
cmp eax,2 ; ­ ¦ â  ª« ¢¨è  ?
je key ; ¥á«¨ ¤  - ­  key
cmp eax,3 ; ­ ¦ â  ª­®¯ª  ?
je button ; ¥á«¨ ¤  - ­  button
cmp eax,6 ; ᮡë⨥ ¬ëè¨
je mouse ; ¥á«¨ ¤  - ­  mouse
jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ­ ç «® 横« 
;---------------------------------------------------------------------
yield:
invoke tooltip_test_show, redbox_tt
jmp still ; ¢¥à­ãâìáï ª ­ ç «ã 横« 
mouse:
invoke tooltip_mouse, redbox_tt
jmp still ; ¢¥à­ãâìáï ª ­ ç «ã 横« 
key: ; ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãà¥
mcall 2 ; äã­ªæ¨ï 2 - áç¨â âì ª®¤ ᨬ¢®«  (¢ ah)
jmp still ; ¢¥à­ãâìáï ª ­ ç «ã 横« 
;---------------------------------------------------------------------
button:
mcall 17 ; 17 - ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
cmp ah, 1 ; ¥á«¨ <20>… ­ ¦ â  ª­®¯ª  á ­®¬¥à®¬ 1,
jne still ; ¢¥à­ãâìáï
pexit:
invoke tooltip_delete, redbox_tt ; ®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
mcall -1 ; ¨­ ç¥ ª®­¥æ ¯à®£à ¬¬ë
;---------------------------------------------------------------------
;--- Ž<><C5BD>…„…<E280B9>ˆˆ Ž<C5BD>ˆŽŠ€ ŽŠ<C5BD>€ ----------------------------------
;---------------------------------------------------------------------
draw_window:
mcall 12, 1 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ® ­ ç «¥ ®âà¨á®¢ª¨
mcall 48, 3, sc,sizeof.system_colors
mov edx, [sc.work] ; 梥â ä®­ 
or edx, 0x33000000 ; ¨ ⨯ ®ª­  3
mcall 0, <200,300>, <200,150>, , ,title
; ¢ë¢®¤ ª¢ ¤à â¨ª®¢
mcall 13, <60,50>, <50,50>, $FF0000
mcall 13, <140,50>, <50,50>, $FF
mcall 12, 2 ; äã­ªæ¨ï 12.2, § ª®­ç¨«¨ à¨á®¢ âì
ret ; ¢ë室¨¬ ¨§ ¯à®æ¥¤ãàë
CODE_END: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë; --------------------------------------------;
; ---------------------------------------------------------------------------- ;
;---------------------------------------------------------------------
;--- „€<E2809E><E282AC><20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
;---------------------------------------------------------------------
sys_path db '/sys/lib/'
;sys_path db '/tmp0/1/'
lib_name db 'box_lib.obj',0
cur_dir_path rb 4096
lib_path rb 4096
myimport:
dd sz_lib_init ;äã­ªæ¨ï § ¯ã᪠¥âáï ¬ ªà®á®¬ 1 à § ¯à¨ ¯®¤ª«î祭¨¨
;¡¨¡«¨®â¥ª¨, ¯®â®¬ã ¢ ¯à®£à ¬¬¥ ¬¥âª  ­  ­¥¥ ­¥ ­ã¦­ 
tooltip_init dd sz_tooltip_init
tooltip_delete dd sz_tooltip_delete
tooltip_test_show dd sz_tooltip_test_show
tooltip_mouse dd sz_tooltip_mouse
get_font_size dd sz_get_font_size
dd 0,0
sz_lib_init db 'lib_init',0
sz_tooltip_init db 'tooltip_init', 0
sz_tooltip_delete db 'tooltip_delete', 0
sz_tooltip_test_show db 'tooltip_test_show', 0
sz_tooltip_mouse db 'tooltip_mouse', 0
sz_get_font_size db 'get_font_size', 0
;tooltip txt, next, zone_x, zone_w, zone_y, zone_h, col_txt, col_bkg, tm_wait
redbox_tt tooltip redboxtxt, blubox_tt, 60, 50, 50, 50, 0, $FFF473, 100
blubox_tt tooltip bluboxtxt, 0, 140, 50, 50, 50, $110000FF, $FFF473, 100
redboxtxt db 'Red Box Tooltip', 13, 'May be multilined', 13, 13, 'Even with empty lines', 0
bluboxtxt db 'Blue Box Tooltip', 0
sc system_colors
title db 'Toooltip demo',0
; stack----------------------------------------------------------------------- ;
rb 4096
STACK_END dd ?
DATA_END: ; ¬¥âª  ª®­æ  ¤ ­­ëå ¯à®£à ¬¬ë; ------------------------------------ ;