![]() |
![]() ![]() |
Mar 30 2006, 12:33 PM
Post
#1
|
|
|
Gold Member ![]() ![]() ![]() ![]() Group: Members Posts: 577 Joined: 18-August 04 From: Czech Republic, EU Member No.: 7,126 |
Hi all,
there is a short how-to for creating graphical menu with confirmation using CDShell with BCDW module (bcdw.csm). The three files (cdshell.ini, menu.gif and confirm.gif) save to the boot folder. Prepare graphical menu - picture 640x480, save as menu.gif (if you need, increase the picture's size). Prepare another picture, say 320x90 (or any custom size), save as confirm.gif. Prepare cdshell.ini (with menu items related to menu.gif), see my solution: CODE # Set graphic mode, say 640x480 or different... # Show the main menu (picture menu.gif) bcdw SetGraphicsVideoMode 640 480 begin: bcdw ShowGif /boot/menu.gif center center # The main loop waits for pressed keys (loop: ... goto loop) # If the requested key is pressed ("small" or "capitall" letter), set the BootWhat variable (see example bellow) # and call YesNo - the confirmation dialog (picture confirm.gif). It allows press Enter/Escape only. If Enter is pressed, # goto "semaphor" (?) named what BootWhat variable contains ("bootA", ...). Then booting is provided by # CDShell or BCDW command ("the classic way"). If Escape is pressed in confirm. dialog, then show the initial menu and # return to the main loop. # set BootWhat = "" loop: getkey if $lastKey == key[A] || $lastKey == key[a]; then set BootWhat = "bootA"; then call YesNo if $lastKey == key[B] || $lastKey == key[b]; then set BootWhat = "bootB"; then call YesNo if $lastKey == key[C] || $lastKey == key[c]; then set BootWhat = "bootC"; then call YesNo if $lastKey == key[F9]; then bcdw Reboot if $lastKey == key[F10]; then bcdw PowerOff goto loop # Sub-routine called from main loop with set contents of variable BootWhat. If Enter is pressed, continue booting by # goto to semaphor (right word?) described by BootWhat. If Escape is pressed, re-draw the main menu and return. Other keys # are ignored... YesNo: bcdw ShowGif /boot/confirm.gif center center YesNoKey: getkey if $lastKey == key[enter]; then goto $BootWhat if $lastKey == key[esc]; then bcdw ShowGif /boot/menu.gif center center; then return; else goto YesNoKey bootA: bcdw SetTextVideoMode print "Boot from floppy A:\n" ### Enter the right command here... goto end bootB: bcdw SetTextVideoMode print "Boot BartPE Live CD\n" ### Enter the right command here... goto end bootC: bcdw SetTextVideoMode print "Boot from hdd C:\n" ### Enter the right command here... goto end end: And the last idea: both pictures (menu.gif and confirm.gif) could be animated! Hope this will be usufull for you, guys. Pavel |
|
|
|
Apr 13 2006, 02:31 PM
Post
#2
|
|
|
Newbie ![]() Group: Members Posts: 5 Joined: 9-January 05 Member No.: 9,392 |
Thanks Pavel
it sounds great but can you post a screen shot . it is maybe easyer to understand . Thanks Scorp |
|
|
|
Apr 15 2006, 02:26 AM
Post
#3
|
|
|
Gold Member ![]() ![]() ![]() ![]() Group: Members Posts: 577 Joined: 18-August 04 From: Czech Republic, EU Member No.: 7,126 |
My multiboot CD use czech lang, so pictures are useless for you at this time. I make a picture menu.gif using mspaint (belong to WinXP), useing this way: i create the text rectangle and write menu like (A) boot floppy, © boot hdd, (G) boot Ghost and so on (so, my menu.gif is graphical but contains text only). Then i make another picture, confirm.gif using the same method, where the text is like "Are you sure? Enter confirm, Esc escape". Thats all.
Regards, Pavel |
|
|
|
May 28 2007, 09:16 AM
Post
#4
|
|
|
Newbie ![]() Group: Members Posts: 9 Joined: 3-August 05 Member No.: 12,992 |
how
i have cdshell cd menus script main.scn i want to insert this code bcdw SetGraphicsVideoMode 640 480 begin: bcdw ShowGif /boot/menu.gif center center and then load my script main.scn how |
|
|
|
Jul 31 2007, 12:19 AM
Post
#5
|
|
|
Member ![]() ![]() Group: Members Posts: 36 Joined: 14-June 07 Member No.: 28,136 |
Can anyone answer to bus?
I also wants to know how or where to add them. |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 9th February 2010 - 09:38 AM |