Help for the quick translucency shortcuts. Fix a bug in Help where a hotkey highlight was on wrong position if an escaped character preceded it (The case never occured in 2.0)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@866 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2009-06-15 18:41:36 +00:00
parent 69dbed8d04
commit dad7e3d363
2 changed files with 32 additions and 0 deletions

14
help.c
View File

@ -278,7 +278,21 @@ void Display_help(void)
else if (line_type == 'K')
{
const char *hyperlink;
const char * escaped_percent_pos;
// Determine link position:
link_position = strstr(line,"%s") - line;
// Adjust for any escaped %% that would precede it.
escaped_percent_pos = line;
do
{
escaped_percent_pos = strstr(escaped_percent_pos,"%%");
if (escaped_percent_pos && escaped_percent_pos - line < link_position)
{
link_position--;
escaped_percent_pos+=2;
}
} while (escaped_percent_pos);
//
hyperlink=Keyboard_shortcut_value(Help_section[Current_help_section].Help_table[start_line + line_index].Line_parameter);
link_size=strlen(hyperlink);
snprintf(buffer, 44, line, hyperlink);

View File

@ -1535,6 +1535,24 @@ static const T_Help_table helptable_effects[] =
HELP_TEXT ("paintbrush with the colors of the picture.")
HELP_TEXT ("It's used to make transparency effects like")
HELP_TEXT ("with watercolors.")
HELP_TEXT ("")
HELP_TEXT ("You can also use the following shortcuts to")
HELP_TEXT ("activate transparency mode and assign an")
HELP_TEXT ("amount of opacity:")
HELP_LINK (" 10%% : %s", SPECIAL_TRANSPARENCY_1)
HELP_LINK (" 20%% : %s", SPECIAL_TRANSPARENCY_2)
HELP_LINK (" 30%% : %s", SPECIAL_TRANSPARENCY_3)
HELP_LINK (" 40%% : %s", SPECIAL_TRANSPARENCY_4)
HELP_LINK (" 50%% : %s", SPECIAL_TRANSPARENCY_5)
HELP_LINK (" 60%% : %s", SPECIAL_TRANSPARENCY_6)
HELP_LINK (" 70%% : %s", SPECIAL_TRANSPARENCY_7)
HELP_LINK (" 80%% : %s", SPECIAL_TRANSPARENCY_8)
HELP_LINK (" 90%% : %s", SPECIAL_TRANSPARENCY_9)
HELP_LINK (" 100%% : %s", SPECIAL_TRANSPARENCY_0)
HELP_TEXT ("If you use two of these shortcuts quickly,")
HELP_TEXT ("the second will set the units for finer")
HELP_TEXT ("control. Ie: 4 6 makes 45%, 0 9 makes 9%.")
HELP_TEXT ("")
HELP_BOLD ("LEFT CLICK")
HELP_LINK ("(Key: %s)", SPECIAL_COLORIZE_MODE)
HELP_TEXT ("")