home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / tvision / colord / tvmods.doc < prev   
Encoding:
Text File  |  1993-12-05  |  3.0 KB  |  89 lines

  1.  
  2. IMPORTANT NOTICE!
  3.  
  4. Please read and follow these instructions before attempting to use
  5. TVColorDialog in your applications.
  6. ******************************************************************
  7.  
  8.   To use TVColorDialog, some minor modifications will be needed in the Turbo
  9. Vision source code. TVColorDialog will not compile without these changes. If
  10. you don't have access to the Turbo Vision source code, or don't want to edit
  11. the source and re-compile, then TVColorDialog isn't for you. The changes
  12. necessary are rather minor though, and I have never experienced any problems
  13. with the changes after rebuilding the library. So if your still interested,
  14. read on.
  15.  
  16.   The only file that needs to be changed is APP.H in the Turbo Vision include
  17. directory. Follow these simple instructions...
  18.  
  19. (1) Change to the Turbo Vision include directory. This is usually named
  20.     C:\BORLANDC\TVISION\INCLUDE
  21.  
  22. (2) Start BC, or your favorite text editor, and load the file APP.H
  23.  
  24. (3) Move down to line 25. It's a blank line in the TBackground class
  25.     declaration. Just below the line that reads...
  26.  
  27.     virtual TPalette& getPalette() const;
  28.  
  29. (4) Add the following two inline functions...
  30.  
  31.     inline char setPattern(char newPattern)
  32.        {
  33.        char oldPattern = pattern;
  34.        pattern = newPattern;
  35.        return oldPattern;
  36.        };
  37.  
  38.     inline char getPattern(void)
  39.        {
  40.        return pattern;
  41.        };
  42.  
  43.   These two functions will give your applications "public" access to the
  44. private member variable "pattern". The pattern character is the character used
  45. for the background pattern in Turbo Vision applications.
  46.  
  47.  
  48.  
  49.  
  50.                                     Page 1
  51.  
  52.  
  53. (5) Now, move down to line 95, into the declaration for TDeskTop. This line
  54.     reads "private:", and causes the following member variable "TBackground
  55.     *background;" to be a "private" member of TDeskTop. Delete line 95. This
  56.     makes "background" a public member of TDeskTop and gives your program
  57.     access to TApplication's background.
  58.  
  59. (6) Save the file as APP.H
  60.  
  61. (7) Rebuild TV.LIB...
  62.  
  63.     (A) Change to the Turbo Vision source directory. This is usually named
  64.         C:\BORLANDC\TVISION\SOURCE
  65.     (B) Open the make file named "MAKEFILE."
  66.     (C) Move to line 12, it reads "BCROOT = ..\..", and make sure this path is
  67.         the correct path to your BORLANDC directory. I had to change mine to
  68.         read "BCROOT = E:\BC". Save the file.
  69.     (B) Type "make" and press <ENTER>.
  70.  
  71.   That's all the modifications necessary. After TV.LIB has been rebuilt, you
  72. can change the desktop's background pattern character by using the setPattern
  73. function which you added in step 4 above, and get the current pattern character
  74. with the getPattern function...
  75.  
  76. Example:
  77.  
  78.       To set the desktop pattern character to ascii 197 ┼
  79.  
  80.       deskTop->background->setPattern(197);
  81.  
  82.  
  83.       To get the current pattern character into a variable
  84.  
  85.       char currentPattern = deskTop->background->getPattern();
  86.  
  87.  
  88.                                     Page 2
  89.