Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
MFConsoleIO - consoleio.h

consoleio.h

Caricato da: Manvb.net
Scarica il programma completo

  1. //header e codice .cpp scritti da Furia Manuel(manvb.net) utilizzando le WinApi.
  2. //specificare l'autore originale in caso di utilizzo
  3.  
  4. //Queste funzioni permettono di manipolare la console a proprio piacimento
  5. #ifndef consoleio_h
  6. #define consoleio_h
  7. #include <windows.h>
  8. #include <iostream>
  9.  
  10. using namespace std;
  11.  
  12. struct rect{
  13.         int w;
  14.         int h;
  15.         int x;
  16.         int y;
  17. };
  18. class color{
  19.     public:
  20.     void set(char foreground, char background);
  21.     void set(short int color);
  22.     short int get();
  23.     void convert(short int color, char& foreground, char& background);
  24.     private:
  25.     short int color;
  26. };
  27. class gui{
  28.     public:
  29.  int w;
  30.  int h;
  31.  color guicolor;
  32.  int cursorsize;
  33.  bool showcursor;
  34.  void save();
  35.  void restore();
  36.  void refresh();
  37.  private:
  38.  char consolesco[500][500];
  39.  char consolesch[500][500];
  40. };
  41.  bool intern(rect objrec, int x, int y);
  42.    const char  CBlack = 0, CBlue = 1, CGreen = 2, CAqua = 3, CRed = 4, CPurple = 5, CBrown = 6, CLGray = 7;
  43.    const char  CGray = 8, CLBlue = 9, CLGreen = 10, CLAqua = 11, CLRed = 12, CLPurple = 13, CLYellow = 14, CWhite = 15;
  44. struct posxy{
  45.     int x;
  46.     int y;
  47. };
  48. struct mclick{
  49.     int x;
  50.     int y;
  51.     bool click, doubleclick, left, right, center, move;
  52. };
  53. void mousemode();
  54. int setcolor(unsigned short color);
  55. int setcolor(char forecolor, char backcolor);
  56. unsigned short getcurcolor();
  57. void settitle(char* titolo);
  58. int setbuffer(int w, int h);
  59. void gotocoord (int x, int y);
  60. void resetscr (char fchar, short int color);
  61. void colortext(char* text, char forecolor, char backcolor);
  62. void colortext(char* text, unsigned short color);
  63. int getcolxy(int x, int y);
  64. int getcolxy(int x, int y, char& foreground, char& background);
  65. void setsize(int w, int h);
  66. void maximize();
  67. char getchrxy(int x, int y);
  68. int setchrxy(int x, int y, char chr);
  69. char readkey(bool show = false);
  70. mclick scanmouse();
  71. char scankey();
  72. void beep();
  73. void setcursor(int size, bool visible);
  74. posxy getcoord();
  75. int setcolxy(int x, int y, char foreground, char background);
  76. int setcolxy(int x, int y, short int color);
  77. extern gui console;
  78. void ini();
  79. #endif