home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / toolbgpf.zip / README < prev    next >
Text File  |  1995-01-03  |  2KB  |  49 lines

  1. 31 December 1994, 11:58 PM
  2.  
  3. -- this is an adaptation to Gpf of sample code from IBM --
  4. -- it is not guaranteed to be beautiful or bullet-proof --
  5.  
  6. This application subclasses the frame window, after which all
  7. kinds of mischieve can be performed. The subclassing occurs during
  8. the clients's WM_CREATE message, during which nothing is visible.
  9. Since we're only interested in altering the appearance of the frame,
  10. this is a pretty good time to insert our trojan horse.
  11.  
  12. The only un-slick piece of trickery is the appending of a menu
  13. template to the Gpf-generated .RC file. The file appended is called
  14. "TBX.RC", which was created manually. Each and every time Gpf created
  15. "TB.RC", "TBX.RC" was tacked on with this command:
  16.     X:>copy tb.rc + tbx.rc
  17. Perhaps you can modify the file "uftb.mak" to do this automatically;
  18. be careful! Multiple appends will surely blow up the resource 
  19. compiler.
  20.  
  21. Notes:
  22. 1. all files of the form "tb.xxx" are Gpf-generated, with the
  23. exception of
  24. 2. file "tb.h" was manually created, forcing Gpf to 'include' it
  25. 3. files "tbx.h" and "tbx.h", definitely related, were created by
  26. hand
  27. 4. files "uftb.mak" and "uftb.c" are the user function production
  28. and source files, respectively. They are made known to Gpf on the
  29. application's Property screen (Gpf's initial screen.)
  30.  
  31. User Functions (uftb.c):
  32. UfMainCreate- attached to client window at 'Window Create'
  33. UfMainCommand- attached to client, at 'All other command/control'. It
  34.   is here that you will need to add truly useful code. Typically
  35.   toolbars are used as accelerators for existing menu functions. 
  36.   Examine 'case MID_TB1' to see how this can be done.
  37. UfPBDel- attached to the 'Delete' pushbutton
  38. UfPBAdd- attached to the 'Add' pushbutton
  39.  
  40. NewFrameProc- subclass procedure, invoked during UfMainCreate
  41.  
  42. Have a nice day.
  43. Alexander Charov
  44.  
  45.  
  46.  
  47.  
  48.  
  49.