home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / mobjm260 / sbutton.cp_ / sbutton.cp
Encoding:
Text File  |  1994-09-06  |  1.1 KB  |  61 lines

  1. //    Microworks ObjectMate 2.6
  2. //
  3. //  "SFX Class Library"
  4. //
  5. //    An ObjectWindows 2.0 extension for Borland C++ 4.0
  6. //
  7. //    Copyright 1992-94 Microworks Sydney, Australia.
  8. //
  9. //  SBUTTON.CPP
  10.  
  11. #include <owl\owlpch.h>
  12. #include <sfx\sfx200.h>
  13. #include "sfx\sbutton.h"
  14.  
  15. IMPLEMENT_STREAMABLE_FROM_BASE(TSFXButton, TButton);
  16.  
  17. //    constructor for a TSFXButton object.
  18.  
  19. TSFXButton::TSFXButton(TWindow*        parent,
  20.                        int             id,
  21.                        const char far* text,
  22.                        int x, int y, int w, int h,
  23.                        TModule*        module)
  24.     :TButton(parent, id, text, x, y, w, h, FALSE, module)
  25. {
  26. }
  27.  
  28. //    constructor for a TSFXButton resource object
  29.  
  30. TSFXButton::TSFXButton(TWindow* parent,
  31.                        int      resourceId,
  32.                        TModule* module)
  33.     :TButton(parent, resourceId, module)
  34. {
  35. }
  36.  
  37. char far*
  38. TSFXButton::GetClassName()
  39. {
  40.     return "SFXBUTTON";
  41. }
  42.  
  43. void
  44. TSFXButton::SetButton(int newId)
  45. {
  46.     HandleMessage(WM_SETBITMAP, newId, 0);
  47. }
  48.  
  49. void
  50. TSFXButton::SetIcon(HICON newIcon)
  51. {
  52.     SendMessage(WM_SETBITMAP, (UINT)newIcon, 0);
  53. }
  54.  
  55. void
  56. TSFXButton::SetText(const char far* str)
  57. {
  58.     SetWindowText(str);
  59. }
  60.  
  61.