Changed the structure icon.ini. Now you can create icons with repetitive or empty names.

git-svn-id: svn://kolibrios.org@4336 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
GerdtR 2013-12-09 21:02:13 +00:00
parent 6680b2725e
commit f7d0d2b128
6 changed files with 688 additions and 535 deletions

View File

@ -1,15 +1,14 @@
;¨­®£¤  ­¥¢¥à­® ®¯à¥¤¥«ï¥âáï è¨à¨­  ¬¥­î誨
ICONS_DAT equ '/rd/1/icons.dat'
ICON_STRIP equ '/rd/1/iconstrp.png'
ICON_SIZE equ 68
IMG_SIZE equ 32
TEXT_BOTTOM_Y equ 14
IMAGE_TOP_Y equ 10 ;>=1
ALIGN_SIZE equ 68
NAME_LENGTH equ 11
MIN_NO_MOVING equ 8
;¤«ï ¤¨ «®£  ᮧ¤ ­¨ï/। ªâ¨à®¢ ­¨ï
ICON_INI equ '/rd/1/settings/icon.ini'
ICON_SIZE equ 68 ;à §¬¥à ®¡« á⨠¤«ï ¨ª®­ª¨ á ­ ¤¯¨áìî
IMG_SIZE equ 32 ;à §¬¥à ¨ª®­®ª
TEXT_BOTTOM_Y equ 14 ;®âáâ㯠¯® Y ⥪áâ  ®â ­¨§  ¨ª®­ª¨
IMAGE_TOP_Y equ 10 ;>=1 Š®®à¤¨­ â  Y ¨ª®­ª¨ ¢ ®¡« á⨠¤«ï ¤ ­­®© ¨ª®­ª¨
ALIGN_SIZE equ 68 ;à §¬¥à á¥âª¨ ¢ëà ¢­¨¢ ­¨ï
NAME_LENGTH equ 11 ;¤«¨­  ¨¬¥­¨ ¨ª®­ª¨
MIN_NO_MOVING equ 8 ;ç¥à¥§ á⮫쪮 ¯¨ªá¥«¥© ᤢ¨£  ¬ëè¨ ­ ç¨­ ¥âáï â áª ­¨¥ ¨ª®­ª¨
;--------¤«ï ¤¨ «®£  ᮧ¤ ­¨ï/। ªâ¨à®¢ ­¨ï
ICONSX equ 20
ICONSY equ 80
ICONS_DRAW_COUNTW equ 10 ;ª®«¨ç¥á⢮ ¨ª®­®ª ¢ è¨à¨­ã
@ -41,7 +40,6 @@ include '../../proc32.inc'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../dll.inc'
;include '../../debug.inc'
;------------------------------------------------------------------------------
START: ; start of execution
mcall 68,11
@ -96,8 +94,8 @@ START: ; start of execution
;########## § £à㦠¥¬ ¤ ­­ë¥ ¨ª®­®ª ¢ ¯ ¬ïâì ##########################
mcall 70,fiIni ;¢ë¤¥«ï¥¬ ¯ ¬ïâì, ¤®áâ â®ç­®© ¤«ï åà ­¥­¨ï ini ä ©« . …ñ â®ç­® 墠â¨â ¤«ï åà ­¥­¨ï ¤ ­­ëå ®¡ ¨ª®­ª å
test eax,eax
mcall 70,fiIni ;¢ë¤¥«ï¥¬ ¯ ¬ïâì, ¤®áâ â®ç­®© ¤«ï åà ­¥­¨ï ini ä ©« .
test eax,eax ;…ñ â®ç­® 墠â¨â ¤«ï åà ­¥­¨ï ¤ ­­ëå ®¡ ¨ª®­ª å
jnz ErrorIni
cmp dword[bufIni+32],0
@ -113,6 +111,13 @@ START: ; start of execution
NoErrIni:
m2m [PIcoDB],[BegData]
mov edi,IconsID
xor eax,eax
mov ecx,100h/4
rep stosd
mov [nLoadIcon],0
stdcall [ini_enum_sections],IconIni,LoadIconsData
;int3
mov eax,dword[PIcoDB]
@ -125,7 +130,6 @@ START: ; start of execution
mov dword[SizeData],0
@@:
;######################################################################
call FillIconsOffs ;§ ¯®«­ï¥â MaxNumIcon,IconsOffs
mcall 40,0100000b ;­ã¦­ë ⮫쪮 ᮡëâ¨ï ¬ëè¨, ¯¥à¥à¨á®¢ª  ¨ª®­®ª ¡ã¤¥â ¢ ¤à㣮¬ ¯®â®ª¥
@ -143,6 +147,8 @@ START: ; start of execution
mcall 51,1,BGRedrawThread,stack_bredraw ;§ ¯ã᪠¥¬ ¯®â®ª ¯¥à¥à¨á®¢ª¨ ¨ª®­®ª
stdcall [OpenDialog_Init],OpenDialog_data
;dph [MaxNumIcon]
messages:
mcall 10
sub eax,6
@ -188,6 +194,7 @@ close:
mcall -1
LButtonPress:
stdcall GetNumIcon,[MouseX],[MouseY],-1
;int3
cmp eax,-1
@ -421,7 +428,6 @@ MovingIcon:
stdcall SetPosition,[SelIcon],eax,ebx
m2m [PIcoDB],[BegData]
stdcall [ini_enum_sections],IconIni,Ini_SavePos ;in RButton.inc
@ -435,8 +441,6 @@ MovingIcon:
;-------------------------------------------------------------------------------
RButtonPress:
cmp [RButtonActiv],1
je messages
mov [RButtonActiv],1
@@:
@ -657,8 +661,6 @@ local IconData:DWORD
ret
endp
proc RestoreBackgrnd,NumIcon:DWORD
push ebx edi
mov eax,[NumIcon]
@ -710,308 +712,6 @@ proc RestoreBackgrnd,NumIcon:DWORD
ret
endp
;ret eax=numIcon
proc AddIcon stdcall,x,y,lpIcon,lpName,lpExeFile,lpParams
push ebx edi esi
mov eax,[x]
mov ebx,[y]
xor edx,edx
test eax,8000h
jnz @f
mov dx,[wsW] ;¥á«¨ ­ ¤®, â® ¯à¥®¡à §®¢ë¢ ¥¬ ¢
shr edx,1 ;®âà¨æ â¥«ì­ë¥ ª®®à¤¨­ âë
add dx,[wsX]
cmp eax,edx
jbe @f
sub ax,[wsW]
inc eax
@@:
test ebx,8000h
jnz @f
mov dx,[wsY]
shr edx,1
add dx,[wsH]
cmp ebx,edx
jbe @f
sub bx,[wsH]
inc ebx
@@:
;¯®¯à ¢ª  ­  á«ãç © ¢ë室  §  ªà © íªà ­ 
test eax,8000h
jnz @f
mov dx,[wsXe]
sub edx,ICON_SIZE
cmp eax,edx
jbe @f
mov eax,edx
@@:
test ebx,8000h
jnz @f
mov dx,[wsYe]
sub edx,ICON_SIZE
cmp ebx,edx
jbe @f
mov ebx,edx
@@:
mov [x],eax
mov [y],ebx
xor al,al
or ecx,-1
mov edi,[lpName]
repne scasb
sub edi,[lpName]
mov ebx,edi
mov edi,[lpExeFile]
repne scasb
sub edi,[lpExeFile]
add ebx,edi
mov edi,[lpParams]
repne scasb
sub edi,[lpParams]
add ebx,edi
mov edi,[lpIcon]
repne scasb
sub edi,[lpIcon]
add ebx,edi
add ebx,4
mov ecx,dword[SizeData]
add ecx,ebx
mov edx,[IconsOffs]
mcall 68,20
mov edx,dword[SizeData]
mov dword[SizeData],ecx
mov dword[BegData],eax
mov edi,eax
add edi,edx
mov esi,[lpName]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpExeFile]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpParams]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpIcon]
@@: lodsb
stosb
test al,al
jnz @b
mov eax,[x]
mov ebx,[y]
shl eax,16
mov ax,bx
mov dword[edi],eax
stdcall FillIconsOffs
pop esi edi ebx
ret
endp
proc EditIcon stdcall,NumIcon,lpIcon,lpName,lpExeFile,lpParams
push edi
mov eax,[NumIcon]
mov edi,[IconsOffs+eax*4]
xor al,al
or ecx,-1
repne scasb
repne scasb
repne scasb
repne scasb
push dword[edi]
stdcall DelIcon,[NumIcon]
pop edx
xor eax,eax
mov ax,dx
shr edx,16
stdcall AddIcon,edx,eax,DAreaIcon,DAreaName,DAreaPath,DAreaParams
pop edi
ret
endp
proc SetPosition stdcall,NumIcon,x,y
push edi
mov eax,[NumIcon]
mov edi,[IconsOffs+eax*4]
xor al,al
or ecx,-1
repne scasb
repne scasb
repne scasb
repne scasb
mov eax,[x]
shl eax,16
mov ax,word[y]
mov dword[edi],eax
pop edi
ret
endp
proc GetNumIcon stdcall,x,y,NumIconI ;­®¬¥à ¨ª®­ª¨, ª®â®àë© ¯à®¢¥àïâì ­¥ ­ ¤® ¨«¨ -1
local posX:WORD,\
posY:WORD
push ebx edi
mov ecx,[MaxNumIcon]
test ecx,ecx
jnz @f
or eax,-1
pop edi ebx
ret
@@:
mov ebx,ecx
dec ebx
.TestIcon:
cmp dword[NumIconI],-1
je @f
cmp ebx,[NumIconI]
jne @f
dec ebx
dec ecx
test ecx,ecx
jz .NoIcon
@@:
push ecx
or ecx,-1
xor al,al
mov edi,[IconsOffs+ebx*4]
repne scasb
repne scasb
repne scasb
repne scasb
mov ax,[edi+2]
test ax,8000h
jz @f
add ax,[wsXe]
jmp .gni1
@@:
add ax,[wsX]
.gni1:
mov [posX],ax
mov ax,[edi]
test ax,8000h
jz @f
add ax,[wsYe]
jmp .gni2
@@:
add ax,[wsY]
.gni2:
mov [posY],ax
mov eax,[x]
mov edx,[y]
cmp ax,[posX]
jb @f
add word[posX],ICON_SIZE
cmp ax,[posX]
ja @f
cmp dx,[posY]
jb @f
add word[posY],ICON_SIZE
cmp dx,[posY]
ja @f
jmp .OkIcon
@@:
dec ebx
pop ecx
;loop .TestIcon
dec ecx
jnz .TestIcon
jmp .NoIcon
.OkIcon:
mov eax,ebx
pop edi ebx
ret
.NoIcon:
or eax,-1
pop edi ebx
ret
endp
proc DelIcon stdcall,NumIcon
push ebx edi esi
cmp [MaxNumIcon],0
je .end
cmp [MaxNumIcon],1
je .OhneIco
mov ebx,[NumIcon]
mov eax,[MaxNumIcon]
dec eax
mov [MaxNumIcon],eax
cmp ebx,eax
je @f
shl ebx,2
mov ecx,dword[BegData]
add ecx,dword[SizeData]
sub ecx,[IconsOffs+4+ebx]
mov edx,[IconsOffs+4+ebx]
sub edx,[IconsOffs+ebx]
sub dword[SizeData],edx
mov esi,[IconsOffs+4+ebx]
mov edi,[IconsOffs+ebx]
rep movsb
jmp .endDel
@@:
mov ecx,dword[BegData]
add ecx,dword[SizeData]
sub ecx,[IconsOffs+ebx*4]
sub dword[SizeData],ecx
.endDel:
stdcall FillIconsOffs
jmp .end
.OhneIco:
mov edi,[BegData]
mov [SizeData],0
mov dword[edi],0
mov [MaxNumIcon],0
mov dword[IconsOffs],0
.end:
mcall 15,3
pop esi edi ebx
ret
endp
;§ ¯®«­ï¥â MaxNumIcon,IconsOffs
proc FillIconsOffs
push ebx edi
@ -1031,6 +731,7 @@ proc FillIconsOffs
add ebx,dword[BegData]
or ecx,-1
.CalcNumIc:
repne scasb
repne scasb
repne scasb
@ -1046,6 +747,7 @@ proc FillIconsOffs
@@:
mov dword[IconsOffs+edx],0
pop edi ebx
ret
endp
@ -1066,12 +768,26 @@ proc LoadIconsData stdcall,f_name,sec_name
ret
.lid1:
mov ebx,[sec_name] ;ª®¯¨à㥬 ID
mov ax,[ebx]
mov edi,[nLoadIcon]
mov word[edi*4+IconsID],ax
mov word[edi*4+IconsID+2],0
mov edi,[PIcoDB]
mov esi,[sec_name]
@@: lodsb
stosb
test al,al
jnz @b
stdcall [ini_get_str],[f_name],[sec_name],keyName,edi,4096,0
test eax,eax
jz @f
xor eax,eax
pop edi esi ebx
ret
@@:
xor al,al
or ecx,-1
repne scasb
stdcall [ini_get_str],[f_name],[sec_name],keyPath,edi,4096,0
test eax,eax
@ -1126,11 +842,61 @@ proc LoadIconsData stdcall,f_name,sec_name
add edi,4
mov [PIcoDB],edi
inc [nLoadIcon]
mov eax,1
pop edi esi ebx
ret
endp
proc GenerateID ;ax = ID
push ebx edi
mov ebx,[MaxNumIcon]
test ebx,ebx
jnz @f
mov eax,'00'
pop edi ebx
ret
@@:
mov eax,dword[IconsID+ebx*4-4]
.inc:
inc ah
cmp ah,'9'+1
jne @f
mov ah,'A'
@@:
cmp ah,'F'+1
jne @f
mov ah,'0'
inc al
@@:
cmp al,'9'+1
jne @f
mov al,'A'
@@:
cmp al,'F'+1
jne @f
mov al,'0'
@@:
mov edi,IconsID
;cmp dword[edi],0
;je @f
mov ecx,100h
@@: scasd
je .inc
cmp dword[edi],0
je @f
loop @b
@@:
pop edi ebx
ret
endp
include 'iconman.inc'
include 'bgredraw.inc'
include 'RButton.inc'
include 'DlgAdd.inc'
@ -1180,14 +946,15 @@ fiIni dd 5 ;
dd 0
dd 0
dd bufIni
db '/rd/1/settings/icon.ini',0
db 0
dd IconIni
IconsFile db ICON_STRIP,0
NameIconsDat db ICONS_DAT,0
align 4
MaxNumIcon dd 0 ;ª®«¨ç¥á⢮ ¨ª®­®ª
IconNoDraw dd -1 ;-1 «¨¡® ­®¬¥à ¨ª®­ª¨, ª®â®àãî ­¥ ­ ¤® à¨á®¢ âì( ª®£¤  ¥ñ â áª îâ :))
IconNoDraw dd -1 ;-1 «¨¡® ­®¬¥à ¨ª®­ª¨, ª®â®àãî ­¥ ­ ¤® à¨á®¢ âì( ª®£¤  ¥ñ â áª îâ )
bFixIcons dd 1
bNotSave dd 0
@ -1197,11 +964,11 @@ RButtonActiv dd 0
MovingActiv dd 0
DlgAddActiv dd 0
IconIni db '/rd/1/settings/icon.ini',0
IconIni db ICON_INI,0
pthNotify db '/rd/1/@notify',0
;keyName db 'name',0
keyName db 'name',0
keyPath db 'path',0
keyParams db 'param',0
keyIco db 'ico',0
@ -1244,7 +1011,8 @@ import libini,\
ini_get_color ,'ini_get_color',\
ini_get_int ,'ini_get_int',\
ini_set_int ,'ini_set_int',\
ini_del_section,'ini_del_section'
ini_del_section ,'ini_del_section',\
ini_exist_sect ,'ini_exist_sect'
;ini.get_str (f_name, sec_name, key_name, buffer, buf_len, def_val)
@ -1254,6 +1022,13 @@ import libini,\
;-------------------------------------------------------------------------------
;----- RButton.inc -------------------------------------------------------------
;-------------------------------------------------------------------------------
if lang eq ru
MinRMenuW dd 18*6+10
else
MinRMenuW dd 15*6+10
end if
secRButt db 'rbmenu',0
PredItem dd -1
@ -1267,11 +1042,11 @@ if lang eq ru
RMenuDel db '“¤ «¨âì',0
RMenuProp db '‘¢®©á⢠',0
else
RMenuRedrawFon db 'Refresh',0
RMenuRedrawFon db 'Redraw',0
RMenuAlign db 'Snap to Grid',0
RMenuOffMoving db 'Lock icons',0
RMenuOnMoving db 'Unlock icons',0
RMenuAdd db 'New icon',0
RMenuOffMoving db 'Fix the icons',0
RMenuOnMoving db 'Unfix the icons',0
RMenuAdd db 'Add',0
RMenuDel db 'Delete',0
RMenuProp db 'Properties',0
end if
@ -1285,7 +1060,7 @@ else
ErrRunProg db 'Error runing program',0
WarningSave db 'Do not forget to save the changes, run the RDSave',0
ErrNotFoundIni db 'icon.ini not found',0
ErrName db 'The name "rbmenu" is reserved',0
ErrName db 'The name "rbmenu" reserved',0
end if
;-------------------------------------------------------------------------------
@ -1320,11 +1095,11 @@ end if
;/­¥ ¬¥­ïâì ¯®«®¦¥­¨¥
edtName edit_box NAME_LENGTH*6+4,70+20+IMG_SIZE,6,0FFFFFFh,06F9480h,0FFh,0h,0,NAME_LENGTH,\
DAreaName,mouse_dd,0,0,0
edtExePath edit_box 281-3-20-IMG_SIZE,70+20+IMG_SIZE,26,0FFFFFFh,06F9480h,0FFh,0h,0,256,\
edtExePath edit_box 281-3-20-IMG_SIZE,70+20+IMG_SIZE,26,0FFFFFFh,06F9480h,0FFh,0h,0,255,\
DAreaPath,mouse_dd,0,0,0
edtParams edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,46,0FFFFFFh,06F9480h,0FFh,0h,0,256,\
edtParams edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,46,0FFFFFFh,06F9480h,0FFh,0h,0,255,\
DAreaParams,mouse_dd,0,0,0
edtIcon edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,66,0FFFFFFh,06F9480h,0FFh,0h,0,256,\
edtIcon edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,66,0FFFFFFh,06F9480h,0FFh,0h,0,255,\
DAreaIcon,mouse_dd,0,0,0
endEdits:
;\
@ -1421,7 +1196,6 @@ MouseX rd 1
MouseY rd 1
RBSlot rd 1
AddX rd 1
AddY rd 1
@ -1430,11 +1204,14 @@ DlgSelIcon rd 1
slotDlgAdd rd 1
DlgBufImg rb IMG_SIZE*IMG_SIZE*3
align 4
bufStdIco rb 40
IconsOffs rd 100
IconsOffs rd 100 ;â ¡«¨æ  á 㪠§ â¥«ï¬¨ ­  ª®­ªà¥â­ë¥ ¨ª®­ª¨(¤«ï ã᪮७¨ï)
PIcoDB rd 1
nLoadIcon rd 1 ;­®¬¥à ç¨â ¥¬®© ¨§ ini ¨ª®­ª¨
IconsID rd 100 ;ID ¨ª®­®ª - 2 ¡ ©âa + ¡ ©â 0 + ¢ëà ¢­¨¢ î騩 ¡ ©â - áâப  á 2¬ï è¥á­ ¤æ¥â¨à¨ç­ë¬¨ æ¨äà ¬¨
nameSection rb 4
align 4
icon_count rd 1
@ -1444,7 +1221,6 @@ strip_file_size rd 1
cur_band_compensation rd 1
;---- RButton -----------------------------------------------------------------------
MinRMenuW rd 1
bufIni rb 40
NumMenuButt rd 1
@ -1456,9 +1232,9 @@ MaxPage rd 1
mouse_dd rd 1
DAreaName rb NAME_LENGTH+1
DAreaPath rb 256+1
DAreaParams rb 256+1
DAreaIcon rb 256+1
DAreaPath rb 255+1
DAreaParams rb 255+1
DAreaIcon rb 255+1
align 4
RBProcInfo rb 1024

View File

@ -24,7 +24,7 @@ DlgProp:
cmp bx,[wsY]
jae @f
mov bx,[wsY]
@@: ;eax,ebx - ॠ«ì­ ï ª®®à¤¨­ â . ‚ᥠª®®à¤¨­ âë ¢ ¯à®£¥ ®â­®á¨â¥«ì­® «¥¢®£® ¢¥àå­¥£® 㣫  à ¡®ç¥© ®¡« áâ¨
@@: ;eax,ebx - ðåàëüíàÿ êîîðäèíàòà. Âñå êîîðäèíàòû â ïðîãå îòíîñèòåëüíî ëåâîãî âåðõíåãî óãëà ðàáî÷åé îáëàñòè
xor edx,edx
mov dx,[wsXe]
@ -41,7 +41,7 @@ DlgProp:
mov ebx,edx
@@:
xor edx,edx ;¯à¥®¡à §®¢ë¢ ¥¬ ¢ ®â­®á¨â¥«ì­ë¥
xor edx,edx ;ïðåîáðàçîâûâàåì â îòíîñèòåëüíûå
mov dx,[wsW]
shr edx,1
add dx,[wsX]
@ -408,25 +408,35 @@ DSaveIcon:
cmp [DlgSelIcon],-1
je @f
;㤠«ï¥¬ ¨§ ini áâ àãî ¨ª®­ªã
mov ebx,[DlgSelIcon]
mov eax,[IconsOffs+ebx*4]
stdcall [ini_del_section],IconIni,eax
stdcall EditIcon,[DlgSelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams
mov ebx,[DlgSelIcon]
mov eax,[IconsID+ebx*4]
jmp DExitAndSave
@@:
call GenerateID
mov ebx,[MaxNumIcon]
mov [IconsID+ebx*4],eax
push eax
stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams
;jmp DExitAndSave
pop eax
;-------------------------------------------------------------------------------
DExitAndSave:
stdcall [ini_set_str],IconIni,DAreaName,keyPath,DAreaPath,dword[edtExePath.size]
stdcall [ini_set_str],IconIni,DAreaName,keyParams,DAreaParams,dword[edtParams.size]
stdcall [ini_set_str],IconIni,DAreaName,keyIco,DAreaIcon,dword[edtIcon.size]
stdcall [ini_set_int],IconIni,DAreaName,keyX,[MouseX]
stdcall [ini_set_int],IconIni,DAreaName,keyY,[MouseY]
mov dword[nameSection],eax
stdcall [ini_set_str],IconIni,nameSection,keyName,DAreaName,dword[edtName.size]
stdcall [ini_set_str],IconIni,nameSection,keyPath,DAreaPath,dword[edtExePath.size]
stdcall [ini_set_str],IconIni,nameSection,keyParams,DAreaParams,dword[edtParams.size]
stdcall [ini_set_str],IconIni,nameSection,keyIco,DAreaIcon,dword[edtIcon.size]
cmp [DlgSelIcon],-1
jne @f
stdcall [ini_set_int],IconIni,nameSection,keyX,[MouseX]
stdcall [ini_set_int],IconIni,nameSection,keyY,[MouseY]
@@:
DExit:
mov [DlgAddActiv],0
mov [slotDlgAdd],0
@ -614,7 +624,7 @@ local IcoX:DWORD,\
add edi,3
loop @b
;§ â¨à ­¨¥ ­¥ ¨á¯®«ì§®¢ ­ëå ¬¥áâ
;çàòèðàíèå íå èñïîëüçîâàíûõ ìåñò
jmp .Dalee
.DrawIcons2:
@ -657,7 +667,7 @@ proc DrawSelIcon
cmp al,'/'
jne .GetIconInd
.PathToIcon:
mov al,30h ;§ £«ã誠!!!!!!!!!!!!!
mov al,30h ;çàãëóøêà!!!!!!!!!!!!!
mov byte[edi+1],0
.GetIconInd:
;int3

View File

@ -13,7 +13,6 @@ local MySlot:DWORD
dec ebx
dec ecx
mcall 0,,,01000000h
;mcall 0,IMG_SIZE,IMG_SIZE,01000000h
mcall 12,2 ;RedrawWinEnd

View File

@ -5,14 +5,6 @@ MAX_USER_BUTTONS equ 30
;---- thread for rbutton -----------------------------------------------------------------------
RButtonWin:
if lang eq ru
mov [MinRMenuW],18*6+10
else
mov [MinRMenuW],15*6+10
end if
mcall 40,100101b ;SetMaskMessage 100101b
mcall 48,3,sc,40
@ -372,10 +364,58 @@ RBAdd:
RBDelete:
mov eax,[SelIcon]
mov eax,[IconsOffs+eax*4]
lea eax,[IconsID+eax*4]
stdcall [ini_del_section],IconIni,eax
stdcall DelIcon,[SelIcon]
mov ebx,[SelIcon]
lea edi,[IconsID+ebx*4-4]
lea esi,[edi+4]
mov ecx,[MaxNumIcon]
sub ecx,[SelIcon]
;dph ecx
test ecx,ecx
jz @f
rep movsd
@@:
;debug_newline
;dpsP IconsID+4*0
;dps ' '
;dpsP IconsID+4*1
;dps ' '
;dpsP IconsID+4*2
;dps ' '
;dpsP IconsID+4*3
;dps ' '
;dpsP IconsID+4*4
;dps ' '
;dpsP IconsID+4*5
;dps ' '
;dpsP IconsID+4*6
;dps ' '
;dpsP IconsID+4*7
;dps ' '
;dpsP IconsID+4*8
;dps ' '
;dpsP IconsID+4*9
;dps ' '
;dpsP IconsID+4*10
;dps ' '
;dpsP IconsID+4*11
;dps ' '
;dpsP IconsID+4*12
;dps ' '
;dpsP IconsID+4*13
;dps ' '
;dpsP IconsID+4*14
;dps ' '
;dpsP IconsID+4*15
;dps ' '
;dpsP IconsID+4*16
;dps ' '
;dpsP IconsID+4*17
;debug_newline
mov dword[fiRunProg+8],WarningSave
mov dword[fiRunProg+21],pthNotify
@ -501,7 +541,6 @@ proc DrawRBLine y,active
ret
endp
proc MouseInWin ;Carry flag = 1, ¥á«¨ ª«¨ª ¢ ®ª­¥
mcall 37,0 ;GetMousePos
xor ebx,ebx
@ -522,7 +561,6 @@ proc MouseInWin ;Carry flag = 1,
ret
endp
proc AlignIcons
local posX:WORD,\
posY:WORD,\
@ -715,19 +753,14 @@ endp
proc Ini_SavePos stdcall,f_name,sec_name
push ebx edi esi
mov ebx,[sec_name]
xor eax,eax
mov ax,[ebx]
xor ebx,ebx
.SearchSect:
mov edi,[IconsOffs+ebx*4]
mov esi,[sec_name]
@@:
lodsb
scasb
jne @f
test al,al
jnz @b
jmp .IcoDataFound
@@:
cmp eax,[IconsID+ebx*4]
je .IcoDataFound
inc ebx
cmp ebx,[MaxNumIcon]
@ -738,19 +771,14 @@ proc Ini_SavePos stdcall,f_name,sec_name
ret
.IcoDataFound:
xor al,al
mov edi,[IconsOffs+ebx*4]
or ecx,-1
repne scasb
repne scasb
repne scasb
;int3
movzx eax,word[edi+2]
test eax,8000h
jz @f
or eax,0FFFF0000h
@@:
stdcall [ini_set_int],[f_name],[sec_name],keyX,eax
repne scasb
movzx eax,word[edi]
test eax,8000h
@ -760,6 +788,15 @@ proc Ini_SavePos stdcall,f_name,sec_name
stdcall [ini_set_int],[f_name],[sec_name],keyY,eax
movzx eax,word[edi+2]
test eax,8000h
jz @f
or eax,0FFFF0000h
@@:
stdcall [ini_set_int],[f_name],[sec_name],keyX,eax
mov eax,1
pop esi edi ebx
ret

View File

@ -1,171 +1,201 @@
[rbmenu]
<EFBFBD> áâனª  ãáâனáâ¢=setup
„¨áŻĄâçĄŕ Żŕ®ćĄáᮢ=cpu
“¯à ¢«¥­¨¥ ⥬®©=desktop
„¨á¯¥âç¥à ¯à®æ¥áᮢ=/rd/1/cpu
Ť áâŕ®©Ş  ä®­ =/sys/media/palitra
Ť áâŕ®©Ş  ăáâனáâ˘=setup
Š®­á®«ì=/rd/1/shell
[KFM]
[00]
name=KFM
path=/SYS/FILE MANAGERS/KFM
param=
ico=5
x=0
y=0
[TINYPAD]
[01]
name=TINYPAD
path=/SYS/TINYPAD
param=
ico=9
x=0
y=68
[EOLITE]
[02]
name=EOLITE
path=/SYS/FILE MANAGERS/EOLITE
param=
ico=2
x=68
y=0
[SHELL]
[03]
name=SHELL
path=/SYS/SHELL
param=
ico=20
x=136
y=0
[KFAR]
[04]
name=KFAR
path=/SYS/FILE MANAGERS/KFAR
param=
ico=16
x=68
y=68
[RDSAVE]
[05]
name=RDSAVE
path=/SYS/RDSAVE
param=
ico=17
x=0
y=136
[CALC]
[06]
name=CALC
path=/SYS/CALC
param=
ico=4
x=68
y=136
[ANIMAGE]
[07]
name=ANIMAGE
path=/SYS/MEDIA/ANIMAGE
param=
ico=15
x=136
y=68
[KPACK]
[08]
name=KPACK
path=/SYS/KPACK
param=
ico=10
x=-67
y=0
[SNAKE]
[09]
name=SNAKE
path=/SYS/GAMES/SNAKE
param=
ico=3
x=-135
y=-135
[MINE]
[0A]
name=MINE
path=/SYS/GAMES/MINE
param=
ico=14
x=-67
y=-67
[LIFE2]
[0B]
name=LIFE2
path=/SYS/DEMOS/LIFE2
param=
ico=13
x=-135
y=-67
[MBLOCKS]
[0C]
name=MBLOCKS
path=/SYS/GAMES/MBLOCKS
param=
ico=11
x=-67
y=-135
[PONG]
[0D]
name=PONG
path=/SYS/GAMES/PONG3
param=
ico=12
x=-203
y=-67
[15]
[0E]
name=15
path=/SYS/GAMES/15
param=
ico=0
x=-271
y=-67
[DOCPACK]
[0F]
name=DOCPACK
path=/SYS/DOCPACK
param=
ico=8
x=-67
y=68
[BOARD]
[10]
name=BOARD
path=/SYS/DEVELOP/BOARD
param=
ico=19
x=-135
y=0
[HEXEDIT]
[11]
name=HEXEDIT
path=/SYS/DEVELOP/HEED
param=
ico=22
x=-67
y=136
[MTDBG]
[12]
name=MTDBG
path=/SYS/DEVELOP/MTDBG
param=
ico=6
x=-203
y=0
[PIPES]
[13]
name=PIPES
path=/SYS/GAMES/PIPES
param=
ico=26
x=0
y=-135
[SUDOKU]
[14]
name=SUDOKU
path=/SYS/GAMES/SUDOKU
param=
ico=25
x=0
y=-67
[GOMOKU]
[15]
name=GOMOKU
path=/SYS/GAMES/GOMOKU
param=
ico=24
x=68
y=-67
[XONIX]
[16]
name=XONIX
path=/SYS/GAMES/XONIX
param=
ico=21
x=68
y=-135
[CHECKERS]
[17]
name=CHECKERS
path=/SYS/GAMES/CHECKERS
param=
ico=1
x=-271
y=-135
[KOSILKA]
[18]
name=KOSILKA
path=/SYS/GAMES/KOSILKA
param=
ico=23
x=136
y=-67
[FLOOD-IT]
[19]
name=FLOOD-IT
path=/SYS/GAMES/FLOOD-IT
param=
ico=27
x=136
y=-135
[FASM]
[1A]
name=FASM
path=/SYS/DEVELOP/FASM
param=
ico=10
x=-135
y=68
[CLICKS]
[1B]
name=CLICKS
path=/SYS/GAMES/CLICKS
param=
ico=18

View File

@ -0,0 +1,301 @@
;ret eax=numIcon
proc AddIcon stdcall,x,y,lpIcon,lpName,lpExeFile,lpParams
push ebx edi esi
mov eax,[x]
mov ebx,[y]
xor edx,edx
test eax,8000h
jnz @f
mov dx,[wsW] ;¥á«¨ ­ ¤®, â® ¯à¥®¡à §®¢ë¢ ¥¬ ¢
shr edx,1 ;®âà¨æ â¥«ì­ë¥ ª®®à¤¨­ âë
add dx,[wsX]
cmp eax,edx
jbe @f
sub ax,[wsW]
inc eax
@@:
test ebx,8000h
jnz @f
mov dx,[wsY]
shr edx,1
add dx,[wsH]
cmp ebx,edx
jbe @f
sub bx,[wsH]
inc ebx
@@:
;¯®¯à ¢ª  ­  á«ãç © ¢ë室  §  ªà © íªà ­ 
test eax,8000h
jnz @f
mov dx,[wsXe]
sub edx,ICON_SIZE
cmp eax,edx
jbe @f
mov eax,edx
@@:
test ebx,8000h
jnz @f
mov dx,[wsYe]
sub edx,ICON_SIZE
cmp ebx,edx
jbe @f
mov ebx,edx
@@:
mov [x],eax
mov [y],ebx
xor al,al
or ecx,-1
mov edi,[lpName]
repne scasb
sub edi,[lpName]
mov ebx,edi
mov edi,[lpExeFile]
repne scasb
sub edi,[lpExeFile]
add ebx,edi
mov edi,[lpParams]
repne scasb
sub edi,[lpParams]
add ebx,edi
mov edi,[lpIcon]
repne scasb
sub edi,[lpIcon]
add ebx,edi
add ebx,4
mov ecx,dword[SizeData]
add ecx,ebx
mov edx,[IconsOffs]
mcall 68,20
mov edx,dword[SizeData]
mov dword[SizeData],ecx
mov dword[BegData],eax
mov edi,eax
add edi,edx
mov esi,[lpName]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpExeFile]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpParams]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpIcon]
@@: lodsb
stosb
test al,al
jnz @b
mov eax,[x]
mov ebx,[y]
shl eax,16
mov ax,bx
mov dword[edi],eax
stdcall FillIconsOffs
pop esi edi ebx
ret
endp
proc EditIcon stdcall,NumIcon,lpIcon,lpName,lpExeFile,lpParams
push edi
mov eax,[NumIcon]
mov edi,[IconsOffs+eax*4]
xor al,al
or ecx,-1
repne scasb
repne scasb
repne scasb
repne scasb
push dword[edi]
stdcall DelIcon,[NumIcon]
pop edx
xor eax,eax
mov ax,dx
shr edx,16
stdcall AddIcon,edx,eax,DAreaIcon,DAreaName,DAreaPath,DAreaParams
pop edi
ret
endp
proc SetPosition stdcall,NumIcon,x,y
push edi
mov eax,[NumIcon]
mov edi,[IconsOffs+eax*4]
xor al,al
or ecx,-1
repne scasb
repne scasb
repne scasb
repne scasb
mov eax,[x]
shl eax,16
mov ax,word[y]
mov dword[edi],eax
pop edi
ret
endp
proc GetNumIcon stdcall,x,y,NumIconI ;­®¬¥à ¨ª®­ª¨, ª®â®àë© ¯à®¢¥àïâì ­¥ ­ ¤® ¨«¨ -1
local posX:WORD,\
posY:WORD
push ebx edi
mov ecx,[MaxNumIcon]
test ecx,ecx
jnz @f
or eax,-1
pop edi ebx
ret
@@:
mov ebx,ecx
dec ebx
.TestIcon:
cmp dword[NumIconI],-1
je @f
cmp ebx,[NumIconI]
jne @f
dec ebx
dec ecx
test ecx,ecx
jz .NoIcon
@@:
push ecx
or ecx,-1
xor al,al
mov edi,[IconsOffs+ebx*4]
repne scasb
repne scasb
repne scasb
repne scasb
mov ax,[edi+2]
test ax,8000h
jz @f
add ax,[wsXe]
jmp .gni1
@@:
add ax,[wsX]
.gni1:
mov [posX],ax
mov ax,[edi]
test ax,8000h
jz @f
add ax,[wsYe]
jmp .gni2
@@:
add ax,[wsY]
.gni2:
mov [posY],ax
mov eax,[x]
mov edx,[y]
cmp ax,[posX]
jb @f
add word[posX],ICON_SIZE
cmp ax,[posX]
ja @f
cmp dx,[posY]
jb @f
add word[posY],ICON_SIZE
cmp dx,[posY]
ja @f
jmp .OkIcon
@@:
dec ebx
pop ecx
;loop .TestIcon
dec ecx
jnz .TestIcon
jmp .NoIcon
.OkIcon:
mov eax,ebx
pop edi ebx
ret
.NoIcon:
or eax,-1
pop edi ebx
ret
endp
proc DelIcon stdcall,NumIcon
push ebx edi esi
cmp [MaxNumIcon],0
je .end
cmp [MaxNumIcon],1
je .OhneIco
mov ebx,[NumIcon]
mov eax,[MaxNumIcon]
dec eax
mov [MaxNumIcon],eax
cmp ebx,eax
je @f
shl ebx,2
mov ecx,dword[BegData]
add ecx,dword[SizeData]
sub ecx,[IconsOffs+4+ebx]
mov edx,[IconsOffs+4+ebx]
sub edx,[IconsOffs+ebx]
sub dword[SizeData],edx
mov esi,[IconsOffs+4+ebx]
mov edi,[IconsOffs+ebx]
rep movsb
jmp .endDel
@@:
mov ecx,dword[BegData]
add ecx,dword[SizeData]
sub ecx,[IconsOffs+ebx*4]
sub dword[SizeData],ecx
.endDel:
stdcall FillIconsOffs
jmp .end
.OhneIco:
mov edi,[BegData]
mov [SizeData],0
mov dword[edi],0
mov [MaxNumIcon],0
mov dword[IconsOffs],0
.end:
mcall 15,3
pop esi edi ebx
ret
endp