home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / PAINT.PAK / DIBATTR.CPP next >
C/C++ Source or Header  |  1995-08-29  |  1KB  |  44 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //   Example paint program dib attribute dialog
  4. //----------------------------------------------------------------------------
  5. #include <owl\owlpch.h>
  6. #include <owl\applicat.h>
  7. #include <owl\button.h>
  8. #include "dibattr.h"
  9. #include "paint.rh"
  10.  
  11. DEFINE_RESPONSE_TABLE1(TDibAttrDialog, TDialog)
  12.   EV_BN_CLICKED(IDC_2COLOR, Bn2Color),
  13.   EV_BN_CLICKED(IDC_16COLOR, Bn16Color),
  14.   EV_BN_CLICKED(IDC_256COLOR, Bn256Color),
  15. END_RESPONSE_TABLE;
  16.  
  17. TDibAttrDialog::TDibAttrDialog(TWindow* parent, 
  18.                                int&     width,
  19.                                int&     height,
  20.                                int&     colors,
  21.                                TModule* module)
  22.  : TDialog(parent, "IDD_DIBATTR", module),
  23.    Width(width), Height(height), Colors(colors)
  24. {
  25. }
  26.  
  27. void
  28. TDibAttrDialog::SetupWindow()
  29. {
  30.   SetDlgItemInt(IDC_WIDTH, Width);
  31.   SetDlgItemInt(IDC_HEIGHT, Height);
  32.   
  33.   CheckRadioButton(IDC_2COLOR, IDC_256COLOR, 
  34.        Colors == 2 ? IDC_2COLOR : Colors == 16 ? IDC_16COLOR : IDC_256COLOR);
  35. }
  36.  
  37. BOOL
  38. TDibAttrDialog::CanClose()
  39. {
  40.   Width = GetDlgItemInt(IDC_WIDTH);
  41.   Height = GetDlgItemInt(IDC_HEIGHT);
  42.   return TRUE;
  43. }
  44.