//*****************************************************************************
//
// Handles paint requests for the firmware update canvas widget.
//
//*****************************************************************************
void
OnFirmwarePaint(tWidget *pWidget, tContext *pContext)
{
    unsigned long ulLines;
    long lLineHeight, lOffset;

    lLineHeight = GrFontHeightGet(FONT_14PT);
    lOffset = 32;

    //
    // Display the firmware update instruction text in the canvas.
    //
    GrContextFontSet(pContext, FONT_14PT);
    GrContextForegroundSet(pContext, ClrSilver);
    GrStringGet(STR_UPDATE_TEXT, g_pcBuffer, SCOMP_MAX_STRLEN);

    ulLines = DrawStringWrapped(pContext, g_pcBuffer, lLineHeight, 1, lOffset,
                                g_pLanguageTable[g_ulLangIdx].bBreakOnSpace );

    //
    // Move down by 1/4 of a line.
    //
    lOffset += lLineHeight/4;

    //
    // Format the UART setting information string
    //
    GrStringGet(STR_UART, g_pcBuffer, SCOMP_MAX_STRLEN);
    GrStringDraw(pContext, g_pcBuffer, -1, 1,
                 lOffset + (ulLines * lLineHeight), 0);
}
//*****************************************************************************
//
// Handles paint requests for the introduction canvas widget.
//
//*****************************************************************************
void
OnIntroPaint(tWidget *psWidget, tContext *psContext)
{
    int32_t i32LineHeight, i32Offset;
    uint32_t ui32Lines;

    i32LineHeight = GrFontHeightGet(FONT_14PT);
    i32Offset = 28;

    //
    // Display the introduction text in the canvas.
    //
    GrContextFontSet(psContext, FONT_14PT);
    GrContextForegroundSet(psContext, ClrSilver);

    //
    // Write the first paragraph of the introduction page.
    //
    GrStringGet(STR_INTRO_1, g_pcBuffer, SCOMP_MAX_STRLEN);
    ui32Lines = DrawStringWrapped(psContext, g_pcBuffer, i32LineHeight, 8,
                              i32Offset,
                              g_psLanguageTable[g_ui32LangIdx].bBreakOnSpace);
    //
    // Move down by 1/4 of a line between paragraphs.
    //
    i32Offset += i32LineHeight/4;

    //
    // Write the second paragraph of the introduction page.
    //
    GrStringGet(STR_INTRO_2, g_pcBuffer, SCOMP_MAX_STRLEN);
    ui32Lines += DrawStringWrapped(psContext, g_pcBuffer, i32LineHeight, 8,
                              i32Offset + (ui32Lines * i32LineHeight),
                              g_psLanguageTable[g_ui32LangIdx].bBreakOnSpace);
    //
    // Move down by 1/4 of a line between paragraphs.
    //
    i32Offset += i32LineHeight/4;

    //
    // Write the third paragraph of the introduction page.
    //
    GrStringGet(STR_INTRO_3, g_pcBuffer, SCOMP_MAX_STRLEN);
    DrawStringWrapped(psContext, g_pcBuffer, i32LineHeight, 8, i32Offset +
        (ui32Lines * i32LineHeight),
        g_psLanguageTable[g_ui32LangIdx].bBreakOnSpace );
}
//*****************************************************************************
//
// Handles paint requests for the introduction canvas widget.
//
//*****************************************************************************
void
OnIntroPaint(tWidget *pWidget, tContext *pContext)
{
    long lLineHeight, lOffset;
    unsigned long ulLines;

    lLineHeight = GrFontHeightGet(FONT_14PT);
    lOffset = 32;

    //
    // Display the introduction text in the canvas.
    //
    GrContextFontSet(pContext, FONT_14PT);
    GrContextForegroundSet(pContext, ClrSilver);

    //
    // Write the first paragraph of the introduction page.
    //
    GrStringGet(STR_INTRO_1, g_pcBuffer, SCOMP_MAX_STRLEN);
    ulLines = DrawStringWrapped(pContext, g_pcBuffer, lLineHeight, 1,
                                lOffset,
                                g_pLanguageTable[g_ulLangIdx].bBreakOnSpace );
    //
    // Move down by 1/4 of a line between paragraphs.
    //
    lOffset += lLineHeight/4;

    //
    // Write the second paragraph of the introduction page.
    //
    GrStringGet(STR_INTRO_2, g_pcBuffer, SCOMP_MAX_STRLEN);
    ulLines += DrawStringWrapped(pContext, g_pcBuffer, lLineHeight, 1,
                                 lOffset + (ulLines * lLineHeight),
                                 g_pLanguageTable[g_ulLangIdx].bBreakOnSpace );
    //
    // Move down by 1/4 of a line between paragraphs.
    //
    lOffset += lLineHeight/4;

    //
    // Write the third paragraph of the introduction page.
    //
    GrStringGet(STR_INTRO_3, g_pcBuffer, SCOMP_MAX_STRLEN);
    DrawStringWrapped(pContext, g_pcBuffer, lLineHeight, 1, lOffset +
        (ulLines * lLineHeight),
        g_pLanguageTable[g_ulLangIdx].bBreakOnSpace );
}