How to draw frames on the console, along with accented words?

1

I use the BoxDraw function below to draw frames in a program with text-mode (console) output.

I can not use this function if I use words with an accent, because when I include the <locale> library (for menu words like "Report", for example) buga the output of my frame from BoxDraw . >

What can I do to use frames and accents together?

The code for drawing the frames is this:

void BoxDraw(int posX, int posY, int width, int height){
    char TL = 201, TR = 187, BL = 200, BR = 188, LINE = 205, COLUMN = 186;
    gotoxy(posX, posY);
    cout << TL;
    for (int i = 0; i < width - 1; i++){
        cout << LINE;
    }
    cout << TR << endl;
    //columns
    for (int i = 0; i < height - 1; i++){
        gotoxy(posX, posY + i + 1);
        cout << COLUMN << endl;
    }
    for (int i = 0; i < height - 1; i++){
        gotoxy(posX + width, posY + i + 1);
        cout << COLUMN << endl;
    }
    //endcolumns
    gotoxy(posX, posY + height);
    cout << BL;
    for (int i = 0; i < width - 1; i++){
        cout << LINE;
    }
    cout << BR << endl;
}

void sideMenu(Product *p[], int n, int op) {
    static int indice; indice = Product::getNumProduct();
    switch (op) {
    case 1:
        system("cls");      
        insertProduct(p, n, indice);
        getEnterFromInput();
        mainMenu(p, n);
        break;
    case 2:
        system("cls");
        search(p, indice);
        getEnterFromInput();
        mainMenu(p, n);
        break;
    case 3:
        system("cls");
        deleteProduct(p);
        getEnterFromInput();
        mainMenu(p, n);
        break;
    case 4:
        system("cls");
        //debitarValor(c, n);
        getEnterFromInput();
        mainMenu(p, n);
        break;
    case 5:
        system("cls");
        sale(p);
        getEnterFromInput();
        mainMenu(p, n);
        break;
    case 6:
        system("cls");
        report(p);
        getEnterFromInput();
        mainMenu(p, n);
        break;
    case 0:
        system("cls");
        cout << "Saindo!" << endl;
        exit(1);
        break;
    default:
        system("cls");
        cout << "Opção inválida!" << endl;
        getEnterFromInput();
        mainMenu(p, n);
        break;
    }
}
    
asked by anonymous 25.10.2016 / 06:31

0 answers