@MENU: Add icons support.

git-svn-id: svn://kolibrios.org@9433 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Rustem Gimadutdinov (rgimad) 2021-12-17 10:13:08 +00:00
parent 1168314a69
commit 2f14f60e05
3 changed files with 351 additions and 222 deletions

View File

@ -1,119 +1,119 @@
#0 **** MAIN
Game Center |allgames
Demos > |@1
Graphics > |@3
Multimedia > |@4
Development > |@5
System > |@7
Data processing > |@10
Network > |@11
Other > |@14
Help |docpack
Run |run
Shutdown |end
23 Game Center |allgames
00 2D Demos > |@1
00 3D Demos > |@2
00 Graphics > |@3
00 Multimedia > |@4
00 Development > |@5
00 System > |@7
00 Data processing > |@10
00 Network > |@11
00 Other > |@14
18 Help |docpack
53 Run |run
04 Shutdown |end
#1 **** DEMOS
3D > |@2
Circle |demos/circle
Fractal |demos/tinyfrac
Color demo |demos/colorref
Eyes |demos/eyes
Tube |demos/tube
Plasma |demos/plasma
Spiral |demos/spiral
Moveback |demos/movback
TranTest |demos/trantest
WEB |demos/web
FireWork |demos/firework
UnvWater |demos/unvwater
16 Circle |demos/circle
16 Fractal |demos/tinyfrac
16 Color demo |demos/colorref
16 Eyes |demos/eyes
16 Tube |demos/tube
16 Plasma |demos/plasma
16 Spiral |demos/spiral
16 Moveback |demos/movback
16 TranTest |demos/trantest
16 WEB |demos/web
16 FireWork |demos/firework
16 UnvWater |demos/unvwater
#2 **** 3D
ScreenSaver |3d/crownscr
3D-labyrinth |3d/free3d04
3D-cube |3d/3dcube2
Ray tracing |3d/ray
View3DS |3d/view3ds
Gears |3d/gears
3D-waved area |3d/3dwav
15 ScreenSaver |3d/crownscr
15 3D-labyrinth |3d/free3d04
15 3D-cube |3d/3dcube2
15 Ray tracing |3d/ray
15 View3DS |3d/view3ds
15 Gears |3d/gears
15 3D-waved area |3d/3dwav
#3 **** GRAPHICS
Kolibri Image Viewer |media/kiv
zSea* Image Viewer |/kolibrios/media/zsea/zsea
Animage |media/animage
Image Filtering |media/imgf/imgf
Palitra |media/palitra
Pipet |develop/pipet
06 Kolibri Image Viewer |media/kiv
06 zSea* Image Viewer |/kolibrios/media/zsea/zsea
38 Animage |media/animage
40 Image Filtering |media/imgf/imgf
52 Palitra |media/palitra
39 Pipet |develop/pipet
#4 **** MULTIMEDIA
Pixie AudioPlayer |media/pixie
AC97SND Audioplayer |media/ac97snd
Fplay* Video player |/kolibrios/media/fplay
MidAMP |media/midamp
53 Pixie AudioPlayer |media/pixie
53 AC97SND Audioplayer |media/ac97snd
11 Fplay* Video player |/kolibrios/media/fplay
07 MidAMP |media/midamp
#5 **** DEV
KPack Archiver |kpack
Flat Assembler |develop/fasm
Diff Tool |develop/diff
Debug Board |develop/board
Debugger |develop/mtdbg
Base Converter |develop/h2d2b
Character table |develop/ASCIIVju
Key ASCII-codes |develop/keyascii
Key SCAN-codes |develop/scancode
09 KPack Archiver |kpack
54 Flat Assembler |develop/fasm
20 Diff Tool |develop/diff
16 Debug Board |develop/board
16 Debugger |develop/mtdbg
34 Base Converter |develop/h2d2b
59 Character table |develop/ASCIIVju
59 Key ASCII-codes |develop/keyascii
59 Key SCAN-codes |develop/scancode
#6 **** EMUL
DOSBox* |/kolibrios/emul/DosBox/dosbox
e80* (ZX Spectrum) |/kolibrios/emul/e80/e80
FCE Ultra* (NES) |/kolibrios/emul/fceu/fceu
Gameboy Color* |/kolibrios/emul/gameboy
ScummVM* |/kolibrios/emul/scummvm
ZSNES* Super Nintendo |/kolibrios/emul/zsnes/zsnes
24 DOSBox* |/kolibrios/emul/DosBox/dosbox
16 e80* (ZX Spectrum) |/kolibrios/emul/e80/e80
16 FCE Ultra* (NES) |/kolibrios/emul/fceu/fceu
16 Gameboy Color* |/kolibrios/emul/gameboy
16 ScummVM* |/kolibrios/emul/scummvm
16 ZSNES* Super Nintendo |/kolibrios/emul/zsnes/zsnes
#7 **** SYSTEM
File Management > |@8
Accessibility > |@9
Hotkeys |mykey
Debug board |develop/board
Clipboard viewer |develop/clipview
Calendar |calendar
Terminal |terminal
Task manager |cpu
System panel |syspanel
00 File Management > |@8
00 Accessibility > |@9
59 Hotkeys |mykey
16 Debug board |develop/board
56 Clipboard viewer |develop/clipview
16 Calendar |calendar
24 Terminal |terminal
48 Task manager |cpu
25 System panel |syspanel
#8 **** FM
KFAR |File Managers/kfar
fNav |File Managers/fNav/fNav
KFM2 |File Managers/kfm2
Eolite |File Managers/Eolite
Virtual disks |tmpdisk
Shell |shell
Save ramdisk |rdsave
24 KFAR |File Managers/kfar
20 fNav |File Managers/fNav/fNav
50 KFM2 |File Managers/kfm2
50 Eolite |File Managers/Eolite
51 Virtual disks |tmpdisk
24 Shell |shell
05 Save ramdisk |rdsave
#9 **** ACCESSIBILITY
Screen magnifier |magnify
Screen keyboard |zkey
49 Screen magnifier |magnify
59 Screen keyboard |zkey
#10 **** DATA PROCESSING
Calculator |calc
Tinypad |tinypad
CodeEdit |develop/cedit
Table processor |table
Graph builder |graph
Hex editor |develop/heed
Unarchiver Unz |unz
16 Calculator |calc
03 Tinypad |tinypad
28 CodeEdit |develop/cedit
21 Table processor |table
47 Graph builder |graph
59 Hex editor |develop/heed
09 Unarchiver Unz |unz
#11 **** NETWORK
Clients > |@12
Servers > |@13
Network devices |network/netcfg
Network status |network/netstat
00 Clients > |@12
00 Servers > |@13
25 Network devices |network/netcfg
25 Network status |network/netstat
#12 **** CLIENTS
IRC |network/ircc
FTP |network/ftpc
TFTP |network/tftpc
Ping |network/ping
Telnet |network/telnet
Synergy |network/synergyc
DNS lookup |network/nslookup
VNC Viewer |network/vncc
Downloader |network/downloader
Text-based browser |network/webview
16 IRC |network/ircc
16 FTP |network/ftpc
50 TFTP |network/tftpc
24 Ping |network/ping
24 Telnet |network/telnet
24 Synergy |network/synergyc
24 DNS lookup |network/nslookup
16 VNC Viewer |network/vncc
33 Downloader |network/downloader
12 Text-based browser |network/webview
#13 **** SERVERS
FTP |network/ftpd
16 FTP |network/ftpd
#14 **** OTHER
Emulators* > |@6
Analog clock |aclock
Binary clock |demos/bcdclk
Timer |timer
Screenshooter |scrshoot
RTF reader |rtfread
00 Emulators* > |@6
16 Analog clock |aclock
16 Binary clock |demos/bcdclk
16 Timer |timer
45 Screenshooter |scrshoot
03 RTF reader |rtfread
##

View File

@ -1,117 +1,117 @@
#0
ˆ£à®¢®© 業âà |allgames
„¥¬ª¨ > |@1
ƒà ä¨ª  > |@3
‡¢ãª ¨ ¢¨¤¥® > |@4
<EFBFBD> §à ¡®âª  > |@5
‘¨á⥬  > |@7
Žä¨á > |@10
‘¥âì > |@11
<EFBFBD> §­®¥ > |@14
„®ªã¬¥­â æ¨ï |docpack
‡ ¯ã᪠¯à®£à ¬¬ë |run
‡ ¢¥à襭¨¥ à ¡®âë |end
23 ˆ£à®¢®© 業âà |allgames
00 „¥¬ª¨ > |@1
00 ƒà ä¨ª  > |@3
00 ‡¢ãª ¨ ¢¨¤¥® > |@4
00 <EFBFBD> §à ¡®âª  > |@5
00 ‘¨á⥬  > |@7
00 Žä¨á > |@10
00 ‘¥âì > |@11
00 <EFBFBD> §­®¥ > |@14
18 „®ªã¬¥­â æ¨ï |docpack
53 ‡ ¯ã᪠¯à®£à ¬¬ë |run
04 ‡ ¢¥à襭¨¥ à ¡®âë |end
#1 ==„¥¬ª¨
’àñ嬥à­ë¥ > |@2
Šà㦮ª |demos/circle
”ࠪ⠫ Œ ­¤¥«ì¡à®â  |demos/tinyfrac
–¢¥â  |demos/colorref
ƒ« §  |demos/eyes
’àã¡  |demos/tube
Plasma |demos/plasma
‘¯¨à «ì |demos/spiral
Moveback |demos/movback
TranTest |demos/trantest
<EFBFBD> ã⨭ª  |demos/web
”¥©¥à¢¥àª |demos/firework
UnvWater |demos/unvwater
00 ’àñ嬥à­ë¥ > |@2
16 Šà㦮ª |demos/circle
16 ”ࠪ⠫ Œ ­¤¥«ì¡à®â  |demos/tinyfrac
16 –¢¥â  |demos/colorref
16 ƒ« §  |demos/eyes
16 ’àã¡  |demos/tube
16 Plasma |demos/plasma
16 ‘¯¨à «ì |demos/spiral
16 Moveback |demos/movback
16 TranTest |demos/trantest
16 <EFBFBD> ã⨭ª  |demos/web
16 ”¥©¥à¢¥àª |demos/firework
16 UnvWater |demos/unvwater
#2 ==3D
‘ªà¨­á¥©¢¥à |3d/crownscr
3D-‹ ¡¨à¨­â |3d/free3d04
3D-Šã¡ |3d/3dcube2
’à áá¨à®¢ª  «ã祩 |3d/ray
<EFBFBD>à®á¬®âà騪 3DS |3d/view3ds
˜¥áâ¥àñ­ª¨ |3d/gears
3D-‚®«­ë |3d/3dwav
15 ‘ªà¨­á¥©¢¥à |3d/crownscr
15 3D-‹ ¡¨à¨­â |3d/free3d04
15 3D-Šã¡ |3d/3dcube2
15 ’à áá¨à®¢ª  «ã祩 |3d/ray
15 <EFBFBD>à®á¬®âà騪 3DS |3d/view3ds
15 ˜¥áâ¥àñ­ª¨ |3d/gears
15 3D-‚®«­ë |3d/3dwav
#3 ==ƒà ä¨ª 
<EFBFBD>à®á¬®âà ä®â® KIV |media/kiv
<EFBFBD>à®á¬®âà ä®â® zSea |/kolibrios/media/zsea/zsea
<EFBFBD>¥¤ ªâ®à Animage |media/animage
<EFBFBD> «®¦¥­¨¥ 䨫ìâ஢ |media/imgf/imgf
<EFBFBD> «¨âà  |media/palitra
<EFBFBD>¨¯¥âª  |develop/pipet
06 <EFBFBD>à®á¬®âà ä®â® KIV |media/kiv
06 <EFBFBD>à®á¬®âà ä®â® zSea |/kolibrios/media/zsea/zsea
38 <EFBFBD>¥¤ ªâ®à Animage |media/animage
40 <EFBFBD> «®¦¥­¨¥ 䨫ìâ஢ |media/imgf/imgf
52 <EFBFBD> «¨âà  |media/palitra
39 <EFBFBD>¨¯¥âª  |develop/pipet
#4 ==‡¢ãª ¨ ¢¨¤¥®
€ã¤¨®¯«¥¥à Pixie |media/pixie
€ã¤¨®¯«¥¥à AC97SND |media/ac97snd
‚¨¤¥®¯«¥¥à Fplay |/kolibrios/media/fplay
Midi-¯«¥¥à |media/midamp
„¥â᪮¥ ¯¨ ­¨­® |media/piano
53 €ã¤¨®¯«¥¥à Pixie |media/pixie
53 €ã¤¨®¯«¥¥à AC97SND |media/ac97snd
11 ‚¨¤¥®¯«¥¥à Fplay |/kolibrios/media/fplay
07 Midi-¯«¥¥à |media/midamp
07 „¥â᪮¥ ¯¨ ­¨­® |media/piano
#5 ==<3D> §à ¡®âª 
“¯ ª®¢é¨ª KPack |kpack
Flat Assembler |develop/fasm
„®áª  ®â« ¤ª¨ |develop/board
HEX-। ªâ®à |develop/heed
Diff tool |develop/diff
Žâ« ¤ç¨ª |develop/mtdbg
Hex2Dec2Bin |develop/h2d2b
’ ¡«¨æ  ᨬ¢®«®¢ |develop/ASCIIVju
ASCII-ª®¤ë |develop/keyascii
SCAN-ª®¤ë |develop/scancode
09 “¯ ª®¢é¨ª KPack |kpack
54 Flat Assembler |develop/fasm
16 „®áª  ®â« ¤ª¨ |develop/board
59 HEX-। ªâ®à |develop/heed
20 Diff tool |develop/diff
16 Žâ« ¤ç¨ª |develop/mtdbg
34 Hex2Dec2Bin |develop/h2d2b
59 ’ ¡«¨æ  ᨬ¢®«®¢ |develop/ASCIIVju
59 ASCII-ª®¤ë |develop/keyascii
59 SCAN-ª®¤ë |develop/scancode
#6 ==<3D>¬ã«ïâ®àë
DOSBox |/kolibrios/emul/DosBox/dosbox
e80 (ZX Spectrum) |/kolibrios/emul/e80/e80
FCE Ultra - NES |/kolibrios/emul/fceu/fceu
ZSNES Super Nintendo |/kolibrios/emul/zsnes/zsnes
ScummVM |/kolibrios/emul/scummvm
24 DOSBox |/kolibrios/emul/DosBox/dosbox
16 e80 (ZX Spectrum) |/kolibrios/emul/e80/e80
16 FCE Ultra - NES |/kolibrios/emul/fceu/fceu
16 ZSNES Super Nintendo |/kolibrios/emul/zsnes/zsnes
16 ScummVM |/kolibrios/emul/scummvm
#7 ==‘¨á⥬ 
” ©«®¢ë¥ ¬¥­¥¤¦¥àë > |@8
‘¯¥æ. ¢®§¬®¦­®á⨠> |@9
Š «¥­¤ àì |calendar
’¥à¬¨­ « |terminal
‚¨àâã «ì­ë¥ ¤¨áª¨ |tmpdisk
Š®­á®«ì SHELL |shell
‘®åà ­¥­¨¥ ®¡à §  |rdsave
‘¨á⥬­ ï ¯ ­¥«ì |syspanel
00 ” ©«®¢ë¥ ¬¥­¥¤¦¥àë > |@8
00 ‘¯¥æ. ¢®§¬®¦­®á⨠> |@9
16 Š «¥­¤ àì |calendar
24 ’¥à¬¨­ « |terminal
51 ‚¨àâã «ì­ë¥ ¤¨áª¨ |tmpdisk
24 Š®­á®«ì SHELL |shell
05 ‘®åà ­¥­¨¥ ®¡à §  |rdsave
25 ‘¨á⥬­ ï ¯ ­¥«ì |syspanel
#8 ==‘¨á⥬  > ”Œ
KFAR |File Managers/kfar
fNav |File Managers/fNav/fNav
KFM2 |File Managers/kfm2
Eolite |File Managers/Eolite
24 KFAR |File Managers/kfar
20 fNav |File Managers/fNav/fNav
50 KFM2 |File Managers/kfm2
50 Eolite |File Managers/Eolite
#9 ==‘¨á⥬  > ‘¯¥æ.¢®§¬®¦­®áâ¨
<EFBFBD>ªà ­­ ï «ã¯  |magnify
<EFBFBD>ªà ­­ ï ª« ¢¨ âãà  |zkey
49 <EFBFBD>ªà ­­ ï «ã¯  |magnify
59 <EFBFBD>ªà ­­ ï ª« ¢¨ âãà  |zkey
#10 ==Žä¨á
Š «ìªã«ïâ®à |calc
<EFBFBD>¥¤ ªâ®à Tinypad |tinypad
<EFBFBD>¥¤ ªâ®à CodeEdit |develop/cedit
’ ¡«¨ç­ë© ¯à®æ¥áá®à |table
<EFBFBD>®áâ஥­¨¥ £à ä¨ª®¢ |graph
<EFBFBD>à®á¬®âà RTF |rtfread
16 Š «ìªã«ïâ®à |calc
03 <EFBFBD>¥¤ ªâ®à Tinypad |tinypad
28 <EFBFBD>¥¤ ªâ®à CodeEdit |develop/cedit
21 ’ ¡«¨ç­ë© ¯à®æ¥áá®à |table
47 <EFBFBD>®áâ஥­¨¥ £à ä¨ª®¢ |graph
03 <EFBFBD>à®á¬®âà RTF |rtfread
#11 ==‘¥âì
‘¥à¢¥àë > |@12
Š«¨¥­âë > |@13
<EFBFBD> áâனª¨ á¥â¨ |network/netcfg
‘â âãá ¯®¤ª«î祭¨ï |network/netstat
00 ‘¥à¢¥àë > |@12
00 Š«¨¥­âë > |@13
25 <EFBFBD> áâனª¨ á¥â¨ |network/netcfg
25 ‘â âãá ¯®¤ª«î祭¨ï |network/netstat
#12 ==‘¥âì > ‘¥à¢¥àë
FTP daemon |network/ftpd
16 FTP daemon |network/ftpd
#13 ==‘¥âì > Š«¨¥­âë
IRC ª«¨¥­â |network/ircc
FTP ª«¨¥­â |network/ftpc
TFTP ª«¨¥­â |network/tftpc
Ping |network/ping
Telnet |network/telnet
Synergy ª«¨¥­â |network/synergyc
DNS lookup |network/nslookup
VNC Š«¨¥­â |network/vncc
ˆ­â¥à­¥â § £àã§ç¨ª |network/downloader
<EFBFBD>à ã§¥à WebView |network/webview
16 IRC ª«¨¥­â |network/ircc
16 FTP ª«¨¥­â |network/ftpc
50 TFTP ª«¨¥­â |network/tftpc
24 Ping |network/ping
24 Telnet |network/telnet
24 Synergy ª«¨¥­â |network/synergyc
24 DNS lookup |network/nslookup
16 VNC Š«¨¥­â |network/vncc
33 ˆ­â¥à­¥â § £àã§ç¨ª |network/downloader
12 <EFBFBD>à ã§¥à WebView |network/webview
#14 ==<3D> §­®¥
<EFBFBD>¬ã«ïâ®àë > |@6
‘®§¤ ­¨¥ áªà¨­è®â®¢ |scrshoot
€­ «®£®¢ë¥ ç áë |aclock
’ ¡«¨æ  Œ¥­¤¥«¥¥¢  |period
’७ ¦ñà KJ|ABuIIIA |games/klavisha
<EFBFBD>¨­ à­ë¥ ç áë |demos/bcdclk
’ ©¬¥à |timer
<EFBFBD> § à娢 â®à Unz |unz
00 <20>¬ã«ïâ®àë* > |@6
45 ‘®§¤ ­¨¥ áªà¨­è®â®¢ |scrshoot
16 €­ «®£®¢ë¥ ç áë |aclock
16 ’ ¡«¨æ  Œ¥­¤¥«¥¥¢  |period
16 ’७ ¦ñà KJ|ABuIIIA |games/klavisha
16 <EFBFBD>¨­ à­ë¥ ç áë |demos/bcdclk
16 ’ ©¬¥à |timer
09 <EFBFBD> § à娢 â®à Unz |unz
##

View File

@ -21,7 +21,7 @@
; Compile with FASM for Kolibri
;******************************************************************************
BTN_HEIGHT = 26
BTN_WIDTH = 178
BTN_WIDTH = 198 ; was 178
TXT_Y = (BTN_HEIGHT)/2-7
FONT_TYPE = 0x90000000
@ -43,7 +43,13 @@
;------------------------------------------------------------------------------
include "..\..\..\macros.inc"
include "..\..\..\gui_patterns.inc"
;include "../../../debug.inc" ; debug macros
; Formatted debug output:
include "..\..\..\debug-fdo.inc"
__DEBUG__ = 1 ; 0 - disable debug output / 1 - enable debug output
__DEBUG_LEVEL__ = DBG_ERR ; set the debug level
DBG_ALL = 0 ; all messages
DBG_INFO = 1 ; info and errors
DBG_ERR = 2 ; only errors
;------------------------------------------------------------------------------
align 4
conversion_ASCII_to_HEX:
@ -80,6 +86,8 @@ START: ; start of execution
mcall 30, 1, default_dir
; DEBUGF DBG_INFO, "MENU START! sc.work = %x\n", [sc.work]
mov esi,bootparam
cmp [esi],byte 0
je .no_boot_parameters
@ -145,6 +153,52 @@ align 4
mcall 48,3,sc,sizeof.system_colors ; load system colors
; DEBUGF DBG_INFO, "sc.work = %x\n", [sc.work]
mov eax, 68
mov ebx, 22
mov ecx, icons_resname
mov esi, 0 ; SHM_READ
mcall
test eax, eax
jnz @f
mov [no_shared_resources], 1
DEBUGF DBG_ERR, "Failed to get ICONS18W from @RESHARE.\nTry rerun @RESHARE.\n"
jmp .no_res
@@:
mov [shared_icons_ptr], eax
mov [shared_icons_size], edx
; copy shared icons to active icons
mov esi, eax
mov ecx, edx
mcall 68, 12, edx
mov edi, eax
mov [shared_icons_active_ptr], eax
shr ecx, 2 ; /= 4; ecx = how many dwords in shared icons
cld
rep movsd
; change work color to work_light color
mov esi, [shared_icons_active_ptr]
xor ecx, ecx
.for1:
cmp ecx, [shared_icons_size]
jae .end_for1
mov eax, esi
add eax, ecx
mov edx, [eax]
cmp edx, [sc.work]
; DEBUGF DBG_INFO, "eax = %x, sc.work = %x\n", eax, [sc.work]
jne @f
mov ebx, [sc.work] ;[sc.work_light]
add ebx, 0x1a1a1a ;;
mov [eax], ebx
@@:
add ecx, 4
jmp .for1
.end_for1:
.no_res:
; get size of file MENU.DAT
mcall 70,fileinfo
test eax,eax
@ -168,13 +222,13 @@ align 4
mov edi,[fileinfo.return] ;mem_end
;--------------------------------------
align 4
newsearch:
newsearch: ; search for next submenu in MENU.DAT
mov al,'#'
cld
repne scasb
test ecx,ecx ; if not found
jz close
call get_number
call get_number ; get submenu number from char at edi position to ebx
test ebx,ebx
jnz .number
cmp al,'#'
@ -182,9 +236,9 @@ newsearch:
;--------------------------------------
align 4
.number:
shl ebx,4
shl ebx,4 ; *= 16 . 16 is size of process table (see virtual at 0 ... stuff in the end of file)
add ebx,[menu_data] ; pointer to process table
mov [ebx],edi
mov [ebx],edi ; process_table->pointer = edi
inc [processes]
jmp newsearch
;--------------------------------------
@ -246,7 +300,8 @@ align 4
mov [buffer],0
;------------------------------------------------------------------------------
align 4
thread:
thread: ; starts new thread. called when opening each menu
DEBUGF DBG_INFO, "start new THREAD\n"
mov ebp,esp
sub ebp,0x1000
cmp ebp,0x2000 ; if this is first started thread
@ -266,7 +321,7 @@ red:
call draw_window ; redraw
;------------------------------------------------------------------------------
align 4
still:
still: ; event loop
call free_area_if_set_mutex
mcall 23,5 ; wait here for event
@ -370,11 +425,12 @@ button1:
; dph eax
call draw_only_needed_buttons
popad
; look for the next line <ah> times; <ah> = button_id
; look (.next_string) for the next line in MENU.DAT <ah> times; <ah> = button_id
push eax
;--------------------------------------
align 4
.next_string:
; DEBUGF DBG_INFO, ".next_string called\n"
call searchstartstring
dec ah
jnz .next_string
@ -715,7 +771,7 @@ align 4
; *********************************************
align 4
draw_window:
mcall 48,5
mcall 48,5 ; get working area
mov [x_working_area],eax
mov [y_working_area],ebx
@ -842,9 +898,11 @@ draw_one_button:
;--------------------------------------
align 4
nocorrect:
mov [is_icon_active], 0
inc dl
cmp [edi + cur_sel],dl
jne .nohighlight
mov [is_icon_active], 1
cmp esi,0
jne @f
mov esi,0x2a2a2a
@ -862,7 +920,7 @@ align 4
push edx
mov edx, esi
mcall 13
mcall 13 ; draw rect
mcall , BTN_WIDTH,<[draw_y],1>,[sc.work_light]
add ecx, BTN_HEIGHT-1
@ -876,29 +934,88 @@ align 4
movzx edx,dl
dec dl
imul ebx,edx,BTN_HEIGHT
add ebx,(4 shl 16) + TXT_Y
add ebx,((4 + 18) shl 16) + TXT_Y ; added + 18 (icon size)
movzx ecx,dl
inc ecx
mov edx,[edi + pointer]
;--------------------------------------
align 4
.findline:
cmp byte [edx],13
cmp byte [edx],13 ; if \r encountered => line found
je .linefound
inc edx
inc edx ; go to next char
jmp .findline
;------------------------------------------------------------------------------
align 4
.linefound:
inc edx
cmp byte [edx],10
inc edx ; go to next char after \r
cmp byte [edx],10 ; if it is not \n then again findline
jne .findline
dec ecx
dec ecx ; TODO what in ecx? button number?
jnz .findline
mov ecx, [sc.work_text]
add ecx, FONT_TYPE
mcall 4,,,,21
push ecx esi edi ebp
push ebx ; preserve ebx, it stores coordinates
mov [tmp], edx
mov [has_icon], 1
xor ebx, ebx
@@: ; parse icon number
inc edx
mov al,[edx]
; DEBUGF DBG_INFO, "(%u)\n", al
cmp al, '0'
jb @f
cmp al, '9'
ja @f
sub al, '0'
imul ebx,10
add ebx,eax
jmp @b
@@:
; DEBUGF DBG_INFO, "icon_number = %x al = %u\n", ebx, al
mov [icon_number], ebx
cmp al, ' '
je @f
; if no space after number then consider that number is a part of caption
mov edx, [tmp] ; restore edx
mov [has_icon], 0 ; no icon
@@:
pop ebx
mcall 4,,,,21 ; draw menu element caption
cmp [no_shared_resources], 1
je @f
cmp [has_icon], 1
jne @f
; draw icon:
mov eax, ebx
shr eax, 16
sub eax, 18 ; 18 - icon width
movzx ebx, bx
sub ebx, 2
shl eax, 16
add eax, ebx
mov [tmp], eax
mov ebx, [icon_number]
imul ebx, 18*18*4
mov ecx, [shared_icons_ptr]
; DEBUGF DBG_INFO, "is_icon_active = %x\n", [is_icon_active]
cmp [is_icon_active], 1
jne .not_active_icon
mov ecx, [shared_icons_active_ptr]
.not_active_icon:
add ebx, ecx
mcall 65, ebx, (18 shl 16) + 18, [tmp], 32, 0, 0
pop ebp edi esi ecx
@@:
pop edx
ret
;------------------------------------------------------------------------------
@ -1002,6 +1119,18 @@ virtual at 0 ; PROCESSES TABLE (located at menu_data)
prev_sel db ? ; +12 previous selection
rb 16-$+1 ; [16 bytes per element]
end virtual
include_debug_strings ; for debug-fdo
icons_resname db 'ICONS18W', 0
shared_icons_ptr dd ?
shared_icons_active_ptr dd ?
shared_icons_size dd ?
has_icon db ?
icon_number dd ?
is_icon_active dd ?
no_shared_resources dd 0
tmp dd ?
;------------------------------------------------------------------------------
align 4
bootparam: