Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] missing ftpl in marlinui_TFTGLD.cpp #26360

Closed
1 task done
narno2202 opened this issue Oct 21, 2023 · 3 comments
Closed
1 task done

[BUG] missing ftpl in marlinui_TFTGLD.cpp #26360

narno2202 opened this issue Oct 21, 2023 · 3 comments

Comments

@narno2202
Copy link
Contributor

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

since last Marlinui menu tweaks merge ( #27068) , CI fails in LPC1769 (first failure in tests) with marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp:978:25: error: 'fstr' was not declared in this scope.
There are some ftpl missing in void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/). And corrected below :

void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) {
    if (!PanelDetected) return;
    lcd_moveto(0, row);

    uint8_t n = LCD_WIDTH;
    const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL);
    const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0,
                 vlen = vstr ? utf8_strlen(vstr) : 0;
    int8_t pad = (center || full) ? n - plen - vlen : 0;

    // SS_CENTER: Pad with half of the unused space first
    if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) { lcd.write(' '); n--; }

    // Draw as much of the label as fits
    if (plen) n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n - vlen);

    if (vlen && n > 0) {
      // SS_FULL: Pad with enough space to justify the value
      if (full && !center) {
        // Move the leading colon from the value to the label
        if (*vstr == ':') { lcd.write(':'); vstr++; n--; }
        // Move spaces to the padding
        while (*vstr == ' ') { vstr++; pad++; }
        // Pad in-between
        for (; pad > 0; --pad) { lcd.write(' '); n--; }
      }
      n -= lcd_put_u8str_max(vstr, n);
    }

    for (; n > 0; --n) lcd.write(' ');

    lcd.print_line();
 }

Bug Timeline

No response

Expected behavior

No response

Actual behavior

No response

Steps to Reproduce

No response

Version of Marlin Firmware

bugfix-2.1.x

Printer model

No response

Electronics

No response

Add-ons

No response

Bed Leveling

None

Your Slicer

None

Host Software

None

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

No response

@ellensp
Copy link
Contributor

ellensp commented Oct 21, 2023

Yes, just added pr to fix this #26359

@thisiskeithb
Copy link
Member

This will actually be fixed in #26339

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants