From dad7e3d363701a0e159c593777191f2d026bec90 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Mon, 15 Jun 2009 18:41:36 +0000 Subject: [PATCH] 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 --- help.c | 14 ++++++++++++++ helpfile.h | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/help.c b/help.c index 456f4619..6070f98c 100644 --- a/help.c +++ b/help.c @@ -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); diff --git a/helpfile.h b/helpfile.h index 354cf234..51dba160 100644 --- a/helpfile.h +++ b/helpfile.h @@ -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 ("")