єктно орієнтованого програмування , Діалектика span> , Київ, 1996.
Додатки
Додаток А
Лістінгі програм
Lukianenko_main.cpp
# include
# include "menu.h" main ()
{(); (0); mnu (20,1);
_setcursortype (_NOCURSOR); (1). getmessage (getch ());
_setcursortype (_NORMALCURSOR);
}
Menu.h
# include
# include
# include
# include
# include
# define LEFT 75
# define RIGHT 77
# define ENTER 13Button
{x1, x2, y1, y2; str [20];: setparam (int X1, int Y1, int X2, int Y2, char * st); show (int tcolor, int bcolor) ; void run () = 0;
}; Button :: setparam (int X1, int Y1, int X2, int Y2, char * st)
{= X1; y1 = Y1; = X2; y2 = Y2; (str, st);
} Button :: show (int tcolor, int bcolor)
{(tcolor); (bcolor); (x1, y1, x2, y2); (); (1,1); ("% s", str);
} Button1: public Button
{: run ();
}; Button1 :: run ()
} Button2: public Button
{: run ();
}; Button2 :: run ()
{(P_WAIT, "kursova.exe", NULL);
} Button3: public Button
{: run ();
}; Button3 :: run ()
{(7); (22,8,62,18); (); * fin = fopen ("about.txt", "r"); str [80]; ( int i = 0; i <4; i + +) {(1, i +2); (str, 80, fin); ("% s", str);
} (fin); (); (0); (1,1,80,25); ();
} Button4: public Button
{: run ();
}; Button4 :: run ()
{(0);
} Menu
{B1; B2; B3; B4; * masB [4]; x, y; numAct; show (); onLeft (); onRight (); onEnter ();: (int X, int Y); getmessage (int msg);
}; Menu :: show ()
{(int i = 0; i <4; i + +) (i == numAct) [i] -> show (15,1); [i] -> show (0, 7);
} Menu :: onLeft ()
{= (numAct == 0)? 3: (numAct-= 1);
} Menu :: onRight ()
{= (numAct == 3)? 0: (numAct + = 1);
} Menu :: onEnter ()
{[numAct] -> run ();
} Menu...