Skip to content
Snippets Groups Projects
Commit 58064722 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Merge branch 'SlyEdit_DCT_quote_win_bottom_border_fix' into 'master'

SlyEdit DCT: Fix so that the quote window bottom border is drawn the full width, not 2 characters short (not sure why this started happening)

See merge request !416
parents 9544a3c6 a83331cf
No related branches found
No related tags found
1 merge request!416SlyEdit DCT: Fix so that the quote window bottom border is drawn the full width, not 2 characters short (not sure why this started happening)
...@@ -457,24 +457,24 @@ function updateInsertModeOnScreen_DCTStyle(pEditRight, pEditBottom, pInsertMode) ...@@ -457,24 +457,24 @@ function updateInsertModeOnScreen_DCTStyle(pEditRight, pEditBottom, pInsertMode)
// pEditRight: The rightmost column on the screen for the edit window // pEditRight: The rightmost column on the screen for the edit window
function DrawQuoteWindowTopBorder_DCTStyle(pQuoteWinHeight, pEditLeft, pEditRight) function DrawQuoteWindowTopBorder_DCTStyle(pQuoteWinHeight, pEditLeft, pEditRight)
{ {
// Generate the top border vairable only once. // Generate the top border vairable only once.
if (typeof(DrawQuoteWindowTopBorder_DCTStyle.border) == "undefined") if (typeof(DrawQuoteWindowTopBorder_DCTStyle.border) == "undefined")
{ {
DrawQuoteWindowTopBorder_DCTStyle.border = gConfigSettings.DCTColors.QuoteWinBorderColor DrawQuoteWindowTopBorder_DCTStyle.border = gConfigSettings.DCTColors.QuoteWinBorderColor
+ UPPER_LEFT_SINGLE + HORIZONTAL_SINGLE + " " + UPPER_LEFT_SINGLE + HORIZONTAL_SINGLE + " "
+ gConfigSettings.DCTColors.QuoteWinBorderTextColor + gConfigSettings.DCTColors.QuoteWinBorderTextColor
+ "Quote Window " + gConfigSettings.DCTColors.QuoteWinBorderColor; + "Quote Window " + gConfigSettings.DCTColors.QuoteWinBorderColor;
var curLength = console.strlen(DrawQuoteWindowTopBorder_DCTStyle.border); var curLength = console.strlen(DrawQuoteWindowTopBorder_DCTStyle.border);
var borderWidth = pEditRight - pEditLeft; var borderWidth = pEditRight - pEditLeft;
for (var i = curLength; i < borderWidth; ++i) for (var i = curLength; i < borderWidth; ++i)
DrawQuoteWindowTopBorder_DCTStyle.border += HORIZONTAL_SINGLE; DrawQuoteWindowTopBorder_DCTStyle.border += HORIZONTAL_SINGLE;
DrawQuoteWindowTopBorder_DCTStyle.border += UPPER_RIGHT_SINGLE; DrawQuoteWindowTopBorder_DCTStyle.border += UPPER_RIGHT_SINGLE;
} }
// Draw the top border line // Draw the top border line
var screenLine = console.screen_rows - pQuoteWinHeight + 1; var screenLine = console.screen_rows - pQuoteWinHeight + 1;
console.gotoxy(pEditLeft, screenLine); console.gotoxy(pEditLeft, screenLine);
console.print(DrawQuoteWindowTopBorder_DCTStyle.border); console.print(DrawQuoteWindowTopBorder_DCTStyle.border);
} }
// Draws the bottom border of the quote window, DCT Edit style. Note: // Draws the bottom border of the quote window, DCT Edit style. Note:
...@@ -486,46 +486,46 @@ function DrawQuoteWindowTopBorder_DCTStyle(pQuoteWinHeight, pEditLeft, pEditRigh ...@@ -486,46 +486,46 @@ function DrawQuoteWindowTopBorder_DCTStyle(pQuoteWinHeight, pEditLeft, pEditRigh
// pEditRight: The rightmost column of the edit area // pEditRight: The rightmost column of the edit area
function DrawQuoteWindowBottomBorder_DCTStyle(pEditLeft, pEditRight) function DrawQuoteWindowBottomBorder_DCTStyle(pEditLeft, pEditRight)
{ {
// Generate the bottom border vairable only once. // Generate the bottom border vairable only once.
if (typeof(DrawQuoteWindowBottomBorder_DCTStyle.border) == "undefined") if (typeof(DrawQuoteWindowBottomBorder_DCTStyle.border) == "undefined")
{ {
// Create a string containing the quote help text. // Create a string containing the quote help text.
var quoteHelpText = gConfigSettings.DCTColors.QuoteWinBorderTextColor var quoteHelpText = gConfigSettings.DCTColors.QuoteWinBorderTextColor
+ "[Enter] Accept" + gConfigSettings.DCTColors.QuoteWinBorderColor + "[Enter] Accept" + gConfigSettings.DCTColors.QuoteWinBorderColor
+ HORIZONTAL_SINGLE + HORIZONTAL_SINGLE + gConfigSettings.DCTColors.QuoteWinBorderTextColor + HORIZONTAL_SINGLE + HORIZONTAL_SINGLE + gConfigSettings.DCTColors.QuoteWinBorderTextColor
+ "[^Q/ESC] End" + gConfigSettings.DCTColors.QuoteWinBorderColor + "[^Q/ESC] End" + gConfigSettings.DCTColors.QuoteWinBorderColor
+ HORIZONTAL_SINGLE + HORIZONTAL_SINGLE + gConfigSettings.DCTColors.QuoteWinBorderTextColor + HORIZONTAL_SINGLE + HORIZONTAL_SINGLE + gConfigSettings.DCTColors.QuoteWinBorderTextColor
+ "[" + UP_ARROW + "/" + DOWN_ARROW + "/PgUp/PgDn/Home/End] Scroll" + "[" + UP_ARROW + "/" + DOWN_ARROW + "/PgUp/PgDn/Home/End] Scroll"
+ gConfigSettings.DCTColors.QuoteWinBorderColor + HORIZONTAL_SINGLE + gConfigSettings.DCTColors.QuoteWinBorderColor + HORIZONTAL_SINGLE
+ HORIZONTAL_SINGLE + gConfigSettings.DCTColors.QuoteWinBorderTextColor; + HORIZONTAL_SINGLE + gConfigSettings.DCTColors.QuoteWinBorderTextColor;
/* /*
+ "[" + UP_ARROW + "/" + DOWN_ARROW + "/PgUp/PgDn] Scroll" + "[" + UP_ARROW + "/" + DOWN_ARROW + "/PgUp/PgDn] Scroll"
+ gConfigSettings.DCTColors.QuoteWinBorderColor + HORIZONTAL_SINGLE + gConfigSettings.DCTColors.QuoteWinBorderColor + HORIZONTAL_SINGLE
+ HORIZONTAL_SINGLE + gConfigSettings.DCTColors.QuoteWinBorderTextColor + HORIZONTAL_SINGLE + gConfigSettings.DCTColors.QuoteWinBorderTextColor
+ "[F/L] First/last page"; + "[F/L] First/last page";
*/ */
var helpTextLen = console.strlen(quoteHelpText); var helpTextLen = console.strlen(quoteHelpText);
// Figure out the starting horizontal position on the screen so that // Figure out the starting horizontal position on the screen so that
// the quote help text line can be centered. // the quote help text line can be centered.
var helpTextStartX = Math.floor((console.screen_columns/2) - (helpTextLen/2)); var helpTextStartX = Math.floor((console.screen_columns/2) - (helpTextLen/2));
// Start creating DrawQuoteWindowBottomBorder_DCTStyle.border with the // Start creating DrawQuoteWindowBottomBorder_DCTStyle.border with the
// bottom border lines, up until helpTextStartX. // bottom border lines, up until helpTextStartX.
DrawQuoteWindowBottomBorder_DCTStyle.border = gConfigSettings.DCTColors.QuoteWinBorderColor DrawQuoteWindowBottomBorder_DCTStyle.border = gConfigSettings.DCTColors.QuoteWinBorderColor + LOWER_LEFT_SINGLE;
+ LOWER_LEFT_SINGLE; for (var XPos = pEditLeft+2; XPos < helpTextStartX; ++XPos)
for (var XPos = pEditLeft+2; XPos < helpTextStartX; ++XPos) DrawQuoteWindowBottomBorder_DCTStyle.border += HORIZONTAL_SINGLE;
DrawQuoteWindowBottomBorder_DCTStyle.border += HORIZONTAL_SINGLE; // Add the help text, then display the rest of the bottom border characters.
// Add the help text, then display the rest of the bottom border characters. DrawQuoteWindowBottomBorder_DCTStyle.border += quoteHelpText + gConfigSettings.DCTColors.QuoteWinBorderColor;
DrawQuoteWindowBottomBorder_DCTStyle.border += quoteHelpText // Previously, the rightmost column in this loop was pEditRight-2, but now it looks like that was resulting
+ gConfigSettings.DCTColors.QuoteWinBorderColor; // in this line being 2 characters shorter than it should be.
for (var XPos = helpTextStartX + helpTextLen; XPos <= pEditRight-2; ++XPos) for (var XPos = helpTextStartX + helpTextLen; XPos <= pEditRight; ++XPos)
DrawQuoteWindowBottomBorder_DCTStyle.border += HORIZONTAL_SINGLE; DrawQuoteWindowBottomBorder_DCTStyle.border += HORIZONTAL_SINGLE;
DrawQuoteWindowBottomBorder_DCTStyle.border += LOWER_RIGHT_SINGLE; DrawQuoteWindowBottomBorder_DCTStyle.border += LOWER_RIGHT_SINGLE;
} }
// Print the border text on the screen // Print the border text on the screen
console.print(DrawQuoteWindowBottomBorder_DCTStyle.border); console.print(DrawQuoteWindowBottomBorder_DCTStyle.border);
} }
// Prompts the user for a yes/no question, DCTEdit-style. // Prompts the user for a yes/no question, DCTEdit-style.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment