home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / delphi / imagelib / viewdlg.cp_ / viewdlg.cp
Text File  |  1995-09-17  |  3KB  |  137 lines

  1. #include <owl\owlpch.h>
  2. #pragma hdrstop
  3. #include <owl\radiobut.h>
  4. #include <owl\checkbox.h>
  5. #include <owl\edit.h>
  6. #include <owl\validate.h>
  7. #include "viewdlg.h"
  8.  
  9. #include "imagevw.h"
  10.  
  11. TDecDialog::TDecDialog(TWindow* parent,
  12.  DecTransfer* DecBuffer) : TDialog(parent, IDD_DECOPT)
  13. {
  14.   ResGrp = new TGroupBox(this, IDC_RESGRP);
  15.   new TRadioButton(this, IDC_RES24, ResGrp);
  16.   new TRadioButton(this, IDC_RES8, ResGrp);
  17.   new TRadioButton(this, IDC_RES4, ResGrp);
  18.   QGrp = new TGroupBox(this, IDC_OPTGRP);
  19.   new TRadioButton(this, IDC_RADONE, QGrp);
  20.   new TRadioButton(this, IDC_RADONED, QGrp);
  21.   SclGrp = new TGroupBox(this, IDC_SCLGRP);
  22.   new TRadioButton(this, IDC_RADSCL1, SclGrp);
  23.   new TRadioButton(this, IDC_RADSCL2, SclGrp);
  24.   new TRadioButton(this, IDC_RADSCL4, SclGrp);
  25.   new TRadioButton(this, IDC_RADSCL8, SclGrp);
  26.   SetTransferBuffer(DecBuffer);
  27. }
  28.  
  29. TDecDialog::~TDecDialog()
  30. {
  31.  Destroy();
  32.  delete SclGrp;
  33.  delete QGrp;
  34.  delete ResGrp;
  35. }
  36.  
  37. TEncDialog::TEncDialog(TWindow* parent,
  38.  EncTransfer* EncBuffer) : TDialog(parent, IDD_ENCOPT)
  39. {
  40.   ResGrp = new TGroupBox(this, IDC_RESBGRP);
  41.   new TRadioButton(this, IDC_RESB24, ResGrp);
  42.   new TRadioButton(this, IDC_RESB8, ResGrp);
  43.   new TRadioButton(this, IDC_RESB4, ResGrp);
  44.   SetTransferBuffer(EncBuffer);
  45. }
  46.  
  47. TEncDialog::~TEncDialog()
  48. {
  49.  Destroy();
  50.  delete ResGrp;
  51. }
  52.  
  53. TComDialog::TComDialog(TWindow* parent,
  54.  ComTransfer* ComBuffer) : TDialog(parent, IDD_COMOPT)
  55. {
  56.   TEdit* e;
  57.   e = new TEdit(this, IDC_QUALITY, 4);
  58.   e->SetValidator(new TRangeValidator(0, 100));
  59.   e = new TEdit(this, IDC_SMOOTH, 4);
  60.   e->SetValidator(new TRangeValidator(0, 100));
  61.   SetTransferBuffer(ComBuffer);
  62.   delete e;
  63. }
  64.  
  65. TComDialog::~TComDialog()
  66. {
  67.  Destroy();
  68. }
  69.  
  70. DEFINE_RESPONSE_TABLE1(TGaugeDialog, TDialog)
  71.   EV_COMMAND(IDCANCEL, CmCancel),
  72. END_RESPONSE_TABLE;
  73.  
  74.  
  75. TGaugeDialog::TGaugeDialog(TWindow* parent)
  76.                 : TDialog(parent, IDD_STATUS)
  77. {
  78.   Gauge = new TGauge(this, "%d%%", IDC_GAUGE, 20, 20, 240, 34,
  79.                             TRUE, 2);
  80. }
  81.  
  82. void TGaugeDialog::SetupWindow()
  83. {
  84.   TDialog::SetupWindow();
  85.   Gauge->SetRange(0,100);
  86.   Gauge->SetValue(0);
  87.   Gauge->SetColor(TColor::LtRed);
  88.   Cancel = 1;
  89. }
  90.  
  91. TGaugeDialog::~TGaugeDialog()
  92. {
  93.  Destroy();
  94.  delete Gauge;
  95. }
  96.  
  97. short TGaugeDialog::SetValue(int i)
  98. {
  99.   Gauge->SetValue(i);
  100.   GetApplication()->PumpWaitingMessages();
  101.   return Cancel;
  102. }
  103.  
  104. void TGaugeDialog::CmCancel()
  105. {
  106.   Cancel = 0;
  107. }
  108.  
  109. TGauge2Dialog::TGauge2Dialog(TWindow* parent)
  110.                 : TDialog(parent, IDD_STATUS2)
  111. {
  112.   Gauge = new TGauge(this, "%d%%", IDC_GAUGE, 20, 20, 240, 34,
  113.                             TRUE, 2);
  114. }
  115.  
  116. void TGauge2Dialog::SetupWindow()
  117. {
  118.   TDialog::SetupWindow();
  119.   Gauge->SetRange(0,100);
  120.   Gauge->SetValue(0);
  121.   Gauge->SetColor(TColor::LtRed);
  122. }
  123.  
  124. TGauge2Dialog::~TGauge2Dialog()
  125. {
  126.  Destroy();
  127.  delete Gauge;
  128. }
  129.  
  130. short TGauge2Dialog::SetValue(int i)
  131. {
  132.   Gauge->SetValue(i);
  133.   GetApplication()->PumpWaitingMessages();
  134.   return 1;
  135. }
  136.  
  137.