id run (void);
}; button7 :: run ()
{(); result = spawnl (P_WAIT, "edit.com", "", filename5, NULL); (result == - 1)
{("Error execute"); ();
} (getgraphmode ());
} button8: public button {: void run (void);
}; button8 :: run (void)
{(); (0);
} Menu {but1; but2; but3; but4; but5; but6; but7; but8; * masbut [8]; x; y; nomAct; vertic; actTextCol; actBgCol; pasTextCol; pasBgCol; Fon (); show (void); onLeft (void); onRight (void); onDown (void);: ();
~ Menu () {closegraph (); delete masbut;}; getmessage (int msg);
}; Menu :: Fon ()
{(1, 1); (0,0, getmaxx (), getmaxy ());
} Menu :: onLeft (void)
{= (nomAct == 0)? 7: (nomAct-= 1);
} Menu :: onRight (void)
{= (nomAct == 7)? 0: (nomAct + = 1);
} Menu :: onDown (void)
{[nomAct] -> run (); ();
} Menu :: show (void)
{(int i = 0; i <8; i + +) (i == nomAct) [i] -> show (1); [i] -> show (0 );
} :: Menu ()
{* f; ((f = fopen ("menu. dat", "rt")) == NULL)
{("Config faile for menu not read, press any key to exit"); (); (1);
} gdriver = DETECT, gmode, errorcode; (& gdriver, & gmode, ""); = graphresult (); (errorcode! = grOk)
{("Graphics error:% s n", grapherrormsg (errorcode)); (); (1);
} [0] = &but1; [1] = &but2; [2] = &but3; [3] = &but4; [4] = & but5; [5] = &but6; [6] = &but7; [7] = &but8; * s; i = 0; ret = 1; (ret)
{par; (f, "% s =% d n", s, & par); (strstr ("x1", s)! = NULL) masbut [0] -> posx = par; (strstr ("y1", s)! = NULL) masbut [0] -> posy = par; (strstr ("vertikal", s)! = NULL)
{= par; = 0;
}
} (! feof (f))
{(s, 80, f); s [strlen (s) - 1] = ' 0'; (s [0] == '&')
{* str; = & s [1]; [i] -> txt = new Text (str); [i] -> set (vertic); + + ;
}
} (f); = 0; (); ();
} Menu :: getmessage (int msg)
{(msg) {LEFT: onLeft (); ();; UP: onLeft (); ();; RIGHT: (); ();; DOWN: (); ();; ENTER: (); ();;:;
}