chenall / grub4dos

外部命令和工具源码:https://github.com/chenall/grubutils 下载:
http://grub4dos.chenall.net
GNU General Public License v2.0
649 stars 136 forks source link

grub4dos-0.4.6a-2015-07-09.7z menu help text not cleared #66

Closed steve6375 closed 9 years ago

steve6375 commented 9 years ago

3rd, 4th and 5th line of menu help text is not cleared when use cursor keys to move down menu. Only the first and 2nd line is updated. image

yaya2007 commented 9 years ago

"In help text - suggest use * to indicate defaults" and "right align" and "Menu help text and menu-entry text needs to be cleared " error has been corrected.

No timeout, or "timeout" ,or "timeout -1" do not show countdown.

"setmenu --string=10=30=0xFFFFFF00FF0000="HELLO" "Only support the foreground. Align left, front empty 10;Right align, back empty 10.

Test grldr download address as before.

steve6375 commented 9 years ago

Still problems with right-align. Please download http://files.easy2boot.com/200001246-1389a1582d/menuArabicDemo1.lst image suggest clear ALL lines of help text and menu-entry text before password prompt is displayed.

also if add setmenu --auto-num image

I would like to position countdown timer on menu using setmenu --timeout-pos=[x]=[y]=[color]

image

e.g. default 2 timeout 10 setmenu --timeout-pos=70=36=0xFF0000 (x=70 y=36 colour=red)

setmenu --timeout-pos=-1 (disable)

setmenu --timeout-pos=70=*=0xFF0000 (position at x=70 on same line as menu entry, colour red)

not _disable_ timeout, but disable the counter or move it and define colour

steve6375 commented 9 years ago

P.S. How to turn auto-numbering off once it has been turned on? setmenu --auto-num-off ???

yaya2007 commented 9 years ago

Right aligned bug exclusion. Increased --auto-num-on and --auto-num-off parameters. "setmenu --timeout-pos=70=36=0xFF0000 (x=70 y=36 colour=red) setmenu --timeout-pos=-1 (disable) setmenu --timeout-pos=70=*=0xFF0000 (position at x=70 on same line as menu entry, colour red)" Unclear,The necessity of such a setting.

steve6375 commented 9 years ago

New 2015-07-30 - looking much better. Issues:

  1. If have title abc[space][space][space]\nfred[space][space][space]

and right-align, then menu entry is not right-aligned - need to ignores spaces?

image

  1. If timeout set and then hit cursor key, background square left behind image
  2. re. setmenu --timeoutpos It would be nice to have the option to hide the countdown and change it's position and colour. Also, if a menu line is long or just fits the width of the menu, the countdown can obscure the menu text. image I would like option to move countdown to top-right of menu or maybe bottom right or outside of menu border.
yaya2007 commented 9 years ago

"1. If have title abc[space][space][space]\nfred[space][space][space]" Right alignment does have a problem. It's not a difficult thing to get rid of these spaces. Because the menu is allowed to have spaces. For example, the menu item before the first character of the space, can be judged as useless; but filling the space can achieve the effect of the right, at this time it is useful.

"1.If timeout set and then hit cursor key, background square left behind" To the background color, there is no problem. color yellow/cyan black/cyan

"2.re. setmenu --timeoutpos" I think about it, whether it is arbitrary.

steve6375 commented 9 years ago

many people use a space after title and before \n because it is easier to read.

title xxxx \nyyyyyy

this leaves space after xxxx if right-align.

If they really want spaces they can use

title xxxx\x20\x20\x20\nyyyyyy

yaya2007 commented 9 years ago

Timeout location, color can be set. After the string to the space, the right can be eliminated.

steve6375 commented 9 years ago

Good! thanks. :-)

steve6375 commented 9 years ago

Sorry, but setmenu --right-align title abcd\x20\x20 does not work now, so user cannot shift menu entry. Can right-align not translate \x20 to space before aligning? I expected title abcd[space][space] >> abcd| title abcd\x20\x20 >> abcd |

steve6375 commented 9 years ago

bug - causes crash of menu if set help text outside display areas (to hide helptext) if 800x600 mode setmenu --entryhelp-keyhelp-coexist setmenu --keyhelp=101=30

values for x over 100 causes crash y can be 200 and is OK, but x>100 causes crash.

Also, maybe add --keyhelp-off ???

yaya2007 commented 9 years ago

The pre - processing program turns \0x20 into 0. What is the place to do? I am not clear. If the right alignment is necessary to display 0 of the end of the string, it is restored to the previous state, i.e., there is a blank display. Can be controlled by the menu.

It can be considered that the --keyhelp=[x]=0 is not shown to display keyhelp

steve6375 commented 9 years ago

setmenu --keyhelp=101=30 should not crash grub4dos. e.g. test this menu (splashimage is optional)

graphicsmode -1 800 splashimage /_ISO/bunny2.bmp setmenu --entryhelp-keyhelp-coexist setmenu --keyhelp=101=30

title test reboot

CRASH!

re. spaces

We should have a way to add spaces in right-aligned menus. e.g. setmenu --right-align title --oOo-- \n root

to make a menu separator line. So if no way to add spaces in title for right-align, we must go back to the previous method to make this work.

yaya2007 commented 9 years ago

New test version, added --keyhelp=[x]=0 is not shown to display keyhelp(in --entryhelp-keyhelp-coexist),In addition,To restore the previous state, do not remove the space at the end of the string.

steve6375 commented 9 years ago

2015-07-31 image missing \n ??

setmenu --keyhelp=101=30 still crashes grub4dos (see above) - should be prevented.

yaya2007 commented 9 years ago

“setmenu --keyhelp=101=30 ”Has been resolved. --keyhelp when y> maximum line, do not show keyhelp. So the y=0 option is revoked. .

steve6375 commented 9 years ago

setmenu --keyhelp=10=40

suppresses keyhelp, but position of entryhelp is changed to y=0 !!

image

yaya2007 commented 9 years ago

I'm sorry! Test version has been corrected.

steve6375 commented 9 years ago

Still a problem (with or without right-align)

graphicsmode -1 800 600 24:32 font /_ISO/e2b/grub/unifont.hex.gz set tophelp=30 set menuw=65 set topstart=5 set rstart=10 set noitems=25 setmenu --box x=%rstart% y=%topstart% w=%menuw% h=%noitems% l=1 setmenu --entryhelp-keyhelp-coexist && setmenu --keyhelp=1=60 setmenu --right-align

title ABCD\nABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ reboot

menuentry is moved by setmenu --keyhelp=1=60 image

image

steve6375 commented 9 years ago

Also, only one line of menuentry help text is shown. Default should be 4 lines (same as old versions).

yaya2007 commented 9 years ago

In the old mode, help the start and end of the menu to determine the border. In the new model, to help in the show, margin determined by X.

steve6375 commented 9 years ago

It is not compatible. Many menus are designed to show text under menu not across whole screen (design of wallpaper) see http://files.easy2boot.com/system_preview_detail_200000092-a241da3387-public/e2bMAC.jpg http://www.easy2boot.com/images/200000096-37d6a38d08-public/Capture.PNG default helpmenuentry should be under menu and within border as before. Maybe add option to set x-start and x-end? Also should be 4 lines allowed by default.

yaya2007 commented 9 years ago

Maybe " set x-start and x-end" is more clear. The "Capture.PNG" is left aligned, the string is not long, no top to the right B boundary, can not explain the problem. Current settings will be the way. "E2bMAC.jpg" at the bottom of the yellow and red help, seems to be right in the mode, the string starts to insert the space. The current model can be done, not contradictory. "Entryhelp" can specify the number of rows, 3 rows, and 5 rows, at random. If the default 4 lines, plus the "keyhelp", by default, help with the 8 line! The impact is beautiful, is aligned, is the beginning of the string.

steve6375 commented 9 years ago

Using menusetting.gz and not using new setmenu command (i.e. old menu.lst) EXAMPLES

0.4.5c image New 0.4.6a image

Note menuhelptext line is shorter and only one line. It is important for new version to be compatible. If user wants longer lines then they can change using setmenu. But default behaviour should be same as all older 0.4.5c and older 0.4.6a to maintain compatibility.

1024 bitmap

Old 0.4.5c image

New 0.4.6a image Note menuhelptext cut off

yaya2007 commented 9 years ago

Got it

steve6375 commented 9 years ago

one more compatibility issue: old color command was color normal highlight helptext heading or color helptext=0xFF00FF

This set the color of the helptext and entryhelp text. This means the entryhelp colour is not changed if using new version and so new version is incompatible. Now, with new grub4dos, I suggest that color helptext=xxx will set both the menuhelp and entryhelp text colour but ONLY if a color entryhelp command has NOT been used before.

_pseudocode_

declare internal variable EHELP

color entryhelp=0x1f change entryhelp colour to 0x1f EHELP=1

color helptext=0x1e change helptext colour to 0x1e if EHELP <> 1 change entryhelp colour to 0x1e

I think this would be compatible but also work for new color entryhelp usage.

P.S. Would be useful if 'color helptext=?' returned the current value of helptext colour, 'color entryhelp=?' returned current value of entryhelp colour, etc. so we can get current colour values as %@retval%?

steve6375 commented 9 years ago

by default number of lines for entryhelp = 4 please? OK? (entryhelp-cover-keyhelp is default already)

yaya2007 commented 9 years ago

"by default number of lines for entryhelp = 4 please? OK?" OK

Before,no distinction keyhelp and entryhelp.So, 'color helptext'='color keyhelp'='color entryhelp'. Now,distinction keyhelp and entryhelp.So,'color helptext' only one of 'color keyhelp' or 'color entryhelp'. Your suggestion is:'color helptext' = 'color entryhelp'?'color keyhelp' other settings?

steve6375 commented 9 years ago

My suggestion is as above - please see pseudocode example. I think this is good solution

in grub4dos c code (NOT user code, code inside grub4dos):

declare internal variable EHELP

command=color entryhelp=0x1f grub4dos code= change entryhelp colour to 0x1f EHELP=1

command=color helptext=0x1e grub4dos code= change helptext colour to 0x1e if EHELP <> 1 change entryhelp colour to 0x1e

This means old menu.lst user menus will work as before, but new user code using entryhelp and helptext color commands will also work as expected. Do you understand?

steve6375 commented 9 years ago

e.g. old menu.lst color helptext=xxx >> both keyhelp and helptext change or color normal highlight helptext

e.g. new menu.lst color entryhelp=xxx >> only entryhelp changes color helptext=xxx >> only helptext changes because of previous entryhelp command

e.g. new menu.lst (example 2) color helptext=xxx >> both keyhelp and helptext change color entryhelp=xxx >> only entryhelp changes or color normal highlight helptext heading entryhelp

yaya2007 commented 9 years ago

Got it

yaya2007 commented 9 years ago

Parametric version has been uploaded. Should be perfected.

steve6375 commented 9 years ago

image

Also, menusetting.gz does not change line spacing now REM word_spacing line_spacing border_width top_help number_of_items_in_menu top_start menu_width right_start_pos_of_menu set wdspace=0 set lnspace=7 set bdwidth=0 set rstart=55 set menuw=85 set topstart=8 set noitems=12 set tophelp=22 /%grub%/menusetting.gz %wdspace% %lnspace% %bdwidth% %tophelp% %noitems% %topstart% %menuw% %rstart%

Does not change line spacing - has internal variable position changed? It also seems to cause problems with setting a timeout. Maybe menusetting.gz is changing wrong internal variable now? (not tested wdspace setting).

steve6375 commented 9 years ago

Problem with lines with no \n in title and --keyhelp

graphicsmode -1 800 600 24:32 set tophelp=30 set menuw=65 set topstart=5 set rstart=10 set noitems=25 /_ISO/e2b/grub/menusetting.gz n n 1 %tophelp% %noitems% %topstart% %menuw% %rstart% setmenu --keyhelp=60=0x1e

title reboot\nfred reboot title NOMENUHELP boot title reboot\nfred reboot

when NOMENUHELP is selected, display is cleared!

Also same issue if --keyhelp=30=0xe

yaya2007 commented 9 years ago

"help setmenu" and "setmenu --keyhelp=60=0x1e" Correction.

"set lnspace=7"I do not know what reason. There appears to be no external interface between the character spacing and row spacing.

steve6375 commented 9 years ago

menusetting.gz uses the command 'terminal' - e.g.

terminal --font-spacing=0:7

This works in 0.4.5c and 0.4.6a 2015-06-05 but not on new 0.4.6a

P.S. this command is not mentioned in help text for terminal command!

yaya2007 commented 9 years ago

Has been amended

steve6375 commented 9 years ago

New version looks good in testing so far :-)

steve6375 commented 9 years ago

Query How can I change the colour of the timeout countdown number without changing it's position?

setmenu --timeout=n=n=0xFF00FF

https://cloud.githubusercontent.com/assets/1469350/8980122/390acad8-36a6-11e5-9757-8249692a2727.png ??

yaya2007 commented 9 years ago

Current cannot

yaya2007 commented 9 years ago

Test versions have been implemented setmenu --timeout=0=0=0xFF00FF

steve6375 commented 9 years ago

looks OK :-) color must be 32-bit value. Can you specify this in help text please?

also maybe change help text [y_offset]=0* entryhelp text covers keyhelp text [y_offset]!=0 keyhelp is y_offset lines below entryhelp [y_offset]<=4 number of entryhelp lines displayed

Should setmenu --help=0=0=30 centre the text ??? Does not seem to work?

yaya2007 commented 9 years ago

30 = 0xRRGGBB = 0x00001e
Black background can be seen in some l blue figures. "Use 0xRRGGBB to represent colors" write help.

steve6375 commented 9 years ago

--help w=0 ?? image

yaya2007 commented 9 years ago

echo -rrggbb

steve6375 commented 9 years ago

maybe better??

--help=[x]=[w]=[y] Note: [x]=0* determined by menu start, [w]=0 determined by menu width.

yaya2007 commented 9 years ago

Seems like this better --help=[x]=[w]=[y] Note: [x]=0* Menu border as boundary, [w]=0 Each line of the character minus 2x.

steve6375 commented 9 years ago

Maybe:

--help=[x]=[w]=[y] Note: [x]=0* menu start and width, [x]<>0 and [w]=0 Entire display width minus 2x.

yaya2007 commented 9 years ago

Adopt, thank you!

steve6375 commented 9 years ago

Thanks