Menu::Menu(QWidget *parent) : defaultScreenWidth(480), defaultScreenHeight(800), QMainWindow(parent)
{
    setAttribute(Qt::WA_DeleteOnClose);

    central = new QWidget(this);
    central->setObjectName("central");

    windowTitle = new QLabel;
    windowTitle->setScaledContents(true);

    AButton = new QPushButton(tr("Сложение"));
    AButton->setFocusPolicy(Qt::NoFocus);
    connect(AButton, SIGNAL(clicked()),
            this, SLOT(showA()));

    BButton = new QPushButton(tr("Вычитание"));
    BButton->setFocusPolicy(Qt::NoFocus);
    connect(BButton, SIGNAL(clicked()),
            this, SLOT(showB()));

    CButton = new QPushButton(tr("Умножение на число"));
    CButton->setFocusPolicy(Qt::NoFocus);
    connect(CButton, SIGNAL(clicked()),
            this, SLOT(showC()));

    DButton = new QPushButton(tr("Умножение"));
    DButton->setFocusPolicy(Qt::NoFocus);
    connect(DButton, SIGNAL(clicked()),
            this, SLOT(showD()));

    EButton = new QPushButton(tr("Транспонирование"));
    EButton->setFocusPolicy(Qt::NoFocus);
    connect(EButton, SIGNAL(clicked()),
            this, SLOT(showE()));

    FButton = new QPushButton(tr("Определитель"));
    FButton->setFocusPolicy(Qt::NoFocus);
    connect(FButton, SIGNAL(clicked()),
            this, SLOT(showF()));

    GButton = new QPushButton(tr("Возведение в степень"));
    GButton->setFocusPolicy(Qt::NoFocus);
    connect(GButton, SIGNAL(clicked()),
            this, SLOT(showG()));

    HButton = new QPushButton(tr("Обратная матрица"));
    HButton->setFocusPolicy(Qt::NoFocus);
    connect(HButton, SIGNAL(clicked()),
            this, SLOT(showH()));

    IButton = new QPushButton(tr("След"));
    IButton->setFocusPolicy(Qt::NoFocus);
    connect(IButton, SIGNAL(clicked()),
            this, SLOT(showI()));

    JButton = new QPushButton(tr("Треугольный вид"));
    JButton->setFocusPolicy(Qt::NoFocus);
    connect(JButton, SIGNAL(clicked()),
            this, SLOT(showJ()));

    KButton = new QPushButton(tr("Ранг"));
    KButton->setFocusPolicy(Qt::NoFocus);
    connect(KButton, SIGNAL(clicked()),
            this, SLOT(showK()));

    LButton = new QPushButton(tr("Определенность матрицы"));
    LButton->setFocusPolicy(Qt::NoFocus);
    connect(LButton, SIGNAL(clicked()),
            this, SLOT(showL()));

    settingsButton = new QPushButton(tr("Настройки"));
    settingsButton->setFocusPolicy(Qt::NoFocus);
    connect(settingsButton, SIGNAL(clicked()),
            this, SLOT(showSettings()));

    scaling();

    designInit();

    sizeInit();

    init();

    setCentralWidget(central);

    setWindowTitle(tr("Матричный калькулятор++"));
}
void seeFile(int order)
{
  unsigned int g = 0, j = 0, k = 0, cont = 0;
  char *buffer;
  buffer = new char[65];
  //	ifstream input(file, ios::nocreate);
  ifstream input(file);
  if (!input)
    {
      if (order==0) 
	showH();
      return;
    }
  while (!input.eof())
    {
      input>>buffer;
      if (!strncmp(buffer,"-",1))
	{
	  for (j=0; j<3; j++)
	    {
	      for (k=1; k<strlen(buffer); k++)

		{
		  if (!strncmp((buffer+k),tags[j],1))
		    {
		      if (order==0) 
			flag *= indexes[j]; 
		      cont=1;
		    }
		}
	    }
	  if (cont==1)
	    {
	      cont=0;
	      continue;
	    }
	  for(j=3; j<10; j++)
	    {
	      if (!strcmp(buffer+1,tags[j]))
		{
		  if (order==0) flag*=indexes[j];
		  cont=3;
		  break;
		}
	    }
	  if (cont==3)
	    {
	      cont=2;
	      g=0;
	      continue;
	    }
	  for(j=10; j<15; j++)
	    {
	      if (!strcmp(buffer+1,tags[j]))
		{
		  input>>buffer;
		  if (order==0)
		    {
		      switch (j)
			{
			case 10:
			  showH();
			  return;
			case 11:
			  res=atoi(buffer);
			  break;
			case 12:
			  he=atoi(buffer);
			  break;
			case 13:
			  wi=atoi(buffer);
			  break;
			case 14:
			  rad=atoi(buffer);
			  break;
			}
		      break;
		    }
		}
	      else 
		{
		  showH();
		  return;
		}
	    }
	}