Well, I found a rather ugly solution to your problem, there's probably a better, more readable, way though.
However, it should do what you want, the boxes will stay the same size as long as there is enough room in them for the text you try and put there. (If you try and put more chars then the box has room for it will screw up the formating).
Code:
#include <iostream>
#include <iomanip>
using namespace std;
#define WIDTH(w, info) cout << setw(w) << setfill(' ') << setiosflags(ios::left) << info
void printMenu(char *playerName, int playerLevel, char *lastFight, char *message);
int main()
{
printMenu("Bob", 50, "The Monster", "This is a message");
return 0;
}
void printMenu(char *playerName, int playerLevel, char *lastFight, char *message)
{
cout << " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" << endl; // top line
cout << " ºNAME:"; WIDTH(11, playerName); cout << "º"; // 'name' box
cout << "LVL:"; WIDTH(6, playerLevel); cout << "º"; // 'level' box
cout << "MESSAGES:"; WIDTH(29, message); cout << "º" << endl; // 'message' box
cout << " ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹" << endl; // dividing line
WIDTH(18, " º"); WIDTH(11, "º"); cout << "ºLAST FIGHT:"; WIDTH(27, lastFight); cout << "º" << endl; // 'last fight' box
WIDTH(18, " º"); WIDTH(11, "º"); WIDTH(39, "º"); cout << "º" <<endl; // empty space
WIDTH(18, " º"); WIDTH(11, "º"); WIDTH(39, "º"); cout << "º" <<endl; // empty space
WIDTH(18, " º"); WIDTH(11, "º"); WIDTH(39, "º"); cout << "º" <<endl; // empty space
WIDTH(18, " º"); WIDTH(11, "º"); WIDTH(39, "º"); cout << "º" <<endl; // empty space
cout << " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" << endl; // bottom line
}
I tried to keep one line of printed text on one line of code. The WIDTH macro is there to keep the lines from becoming insanely long.
On the bright side though, you never actualy have to touch that code unless you want to change the way the menu is built, you can just call the 'printMenu' function.