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

View File

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

View File

@ -21,7 +21,7 @@
; Compile with FASM for Kolibri ; Compile with FASM for Kolibri
;****************************************************************************** ;******************************************************************************
BTN_HEIGHT = 26 BTN_HEIGHT = 26
BTN_WIDTH = 178 BTN_WIDTH = 198 ; was 178
TXT_Y = (BTN_HEIGHT)/2-7 TXT_Y = (BTN_HEIGHT)/2-7
FONT_TYPE = 0x90000000 FONT_TYPE = 0x90000000
@ -43,7 +43,13 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
include "..\..\..\macros.inc" include "..\..\..\macros.inc"
include "..\..\..\gui_patterns.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 align 4
conversion_ASCII_to_HEX: conversion_ASCII_to_HEX:
@ -80,6 +86,8 @@ START: ; start of execution
mcall 30, 1, default_dir mcall 30, 1, default_dir
; DEBUGF DBG_INFO, "MENU START! sc.work = %x\n", [sc.work]
mov esi,bootparam mov esi,bootparam
cmp [esi],byte 0 cmp [esi],byte 0
je .no_boot_parameters je .no_boot_parameters
@ -145,6 +153,52 @@ align 4
mcall 48,3,sc,sizeof.system_colors ; load system colors 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 ; get size of file MENU.DAT
mcall 70,fileinfo mcall 70,fileinfo
test eax,eax test eax,eax
@ -168,13 +222,13 @@ align 4
mov edi,[fileinfo.return] ;mem_end mov edi,[fileinfo.return] ;mem_end
;-------------------------------------- ;--------------------------------------
align 4 align 4
newsearch: newsearch: ; search for next submenu in MENU.DAT
mov al,'#' mov al,'#'
cld cld
repne scasb repne scasb
test ecx,ecx ; if not found test ecx,ecx ; if not found
jz close jz close
call get_number call get_number ; get submenu number from char at edi position to ebx
test ebx,ebx test ebx,ebx
jnz .number jnz .number
cmp al,'#' cmp al,'#'
@ -182,9 +236,9 @@ newsearch:
;-------------------------------------- ;--------------------------------------
align 4 align 4
.number: .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 add ebx,[menu_data] ; pointer to process table
mov [ebx],edi mov [ebx],edi ; process_table->pointer = edi
inc [processes] inc [processes]
jmp newsearch jmp newsearch
;-------------------------------------- ;--------------------------------------
@ -246,7 +300,8 @@ align 4
mov [buffer],0 mov [buffer],0
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
thread: thread: ; starts new thread. called when opening each menu
DEBUGF DBG_INFO, "start new THREAD\n"
mov ebp,esp mov ebp,esp
sub ebp,0x1000 sub ebp,0x1000
cmp ebp,0x2000 ; if this is first started thread cmp ebp,0x2000 ; if this is first started thread
@ -266,7 +321,7 @@ red:
call draw_window ; redraw call draw_window ; redraw
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
still: still: ; event loop
call free_area_if_set_mutex call free_area_if_set_mutex
mcall 23,5 ; wait here for event mcall 23,5 ; wait here for event
@ -370,11 +425,12 @@ button1:
; dph eax ; dph eax
call draw_only_needed_buttons call draw_only_needed_buttons
popad 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 push eax
;-------------------------------------- ;--------------------------------------
align 4 align 4
.next_string: .next_string:
; DEBUGF DBG_INFO, ".next_string called\n"
call searchstartstring call searchstartstring
dec ah dec ah
jnz .next_string jnz .next_string
@ -715,7 +771,7 @@ align 4
; ********************************************* ; *********************************************
align 4 align 4
draw_window: draw_window:
mcall 48,5 mcall 48,5 ; get working area
mov [x_working_area],eax mov [x_working_area],eax
mov [y_working_area],ebx mov [y_working_area],ebx
@ -842,9 +898,11 @@ draw_one_button:
;-------------------------------------- ;--------------------------------------
align 4 align 4
nocorrect: nocorrect:
mov [is_icon_active], 0
inc dl inc dl
cmp [edi + cur_sel],dl cmp [edi + cur_sel],dl
jne .nohighlight jne .nohighlight
mov [is_icon_active], 1
cmp esi,0 cmp esi,0
jne @f jne @f
mov esi,0x2a2a2a mov esi,0x2a2a2a
@ -862,7 +920,7 @@ align 4
push edx push edx
mov edx, esi mov edx, esi
mcall 13 mcall 13 ; draw rect
mcall , BTN_WIDTH,<[draw_y],1>,[sc.work_light] mcall , BTN_WIDTH,<[draw_y],1>,[sc.work_light]
add ecx, BTN_HEIGHT-1 add ecx, BTN_HEIGHT-1
@ -876,29 +934,88 @@ align 4
movzx edx,dl movzx edx,dl
dec dl dec dl
imul ebx,edx,BTN_HEIGHT 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 movzx ecx,dl
inc ecx inc ecx
mov edx,[edi + pointer] mov edx,[edi + pointer]
;-------------------------------------- ;--------------------------------------
align 4 align 4
.findline: .findline:
cmp byte [edx],13 cmp byte [edx],13 ; if \r encountered => line found
je .linefound je .linefound
inc edx inc edx ; go to next char
jmp .findline jmp .findline
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
.linefound: .linefound:
inc edx inc edx ; go to next char after \r
cmp byte [edx],10 cmp byte [edx],10 ; if it is not \n then again findline
jne .findline jne .findline
dec ecx dec ecx ; TODO what in ecx? button number?
jnz .findline jnz .findline
mov ecx, [sc.work_text] mov ecx, [sc.work_text]
add ecx, FONT_TYPE 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 pop edx
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -1002,6 +1119,18 @@ virtual at 0 ; PROCESSES TABLE (located at menu_data)
prev_sel db ? ; +12 previous selection prev_sel db ? ; +12 previous selection
rb 16-$+1 ; [16 bytes per element] rb 16-$+1 ; [16 bytes per element]
end virtual 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 align 4
bootparam: bootparam: