OBOX.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * Seven Kingdoms: Ancient Adversaries
  3. *
  4. * Copyright 1997,1998 Enlight Software Ltd.
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. //Filename : OBOX.H
  21. //Description : Header file of button object
  22. #ifndef __OBOX_H
  23. #define __OBOX_H
  24. #ifndef __ALL_H
  25. #include <ALL.h>
  26. #endif
  27. #ifndef __OBUTTON_H
  28. #include <OBUTTON.h>
  29. #endif
  30. //------- constant for arrow box ----------//
  31. enum { ARROW_BOX_WIDTH = 390,
  32. ARROW_BOX_X_MARGIN = 15,
  33. ARROW_BOX_Y_MARGIN = 15,
  34. ARROW_BOX_TITLE_HEIGHT = 20,
  35. ARROW_BOX_LINE_SPACE = 4 };
  36. //--------- Define class Box ------------//
  37. class Box
  38. {
  39. public:
  40. int box_x1, box_y1, box_x2, box_y2;
  41. int arrow_x, arrow_y;
  42. int save_scr_flag;
  43. static char opened_flag;
  44. public:
  45. // ready to use one-step call functions
  46. int ask(char*, char* =NULL, char* =NULL, int= -1, int= -1);
  47. void msg(char* msgStr, int enableTimeOut=1, int x1= -1, int y1= -1);
  48. void print(char*, ... );
  49. void tell(char*,int= -1, int= -1);
  50. // lower level box control functions
  51. void open(int,int,int,int,int=1);
  52. void open(int,int,int=1);
  53. void paint(int);
  54. void close();
  55. void calc_size(char*,int,int= -1, int= -1);
  56. int ask_button(char* =NULL,char* =NULL,int=1);
  57. void ask_button(Button&,Button&,char* =NULL,char* =NULL);
  58. void ok_button(int=1);
  59. // arrow box
  60. void arrow_box(char*, char* =NULL, int=1);
  61. void close_arrow_box();
  62. void calc_arrow_box(char*, int, int, int=0);
  63. void calc_arrow_box(int, int, int, int);
  64. void draw_arrow();
  65. };
  66. extern Box box;
  67. //----------------------------------------------//
  68. #endif