home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / ilib_vb / viewdlg.cp_ / viewdlg.cp
Encoding:
Text File  |  1996-11-20  |  3.6 KB  |  159 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.   new TRadioButton(this, IDC_RESV, ResGrp);
  19.   new TRadioButton(this, IDC_RES1, ResGrp);
  20.   QGrp = new TGroupBox(this, IDC_OPTGRP);
  21.   new TRadioButton(this, IDC_RADONE, QGrp);
  22.   new TRadioButton(this, IDC_RADONED, QGrp);
  23.   SclGrp = new TGroupBox(this, IDC_SCLGRP);
  24.   new TRadioButton(this, IDC_RADSCL1, SclGrp);
  25.   new TRadioButton(this, IDC_RADSCL2, SclGrp);
  26.   new TRadioButton(this, IDC_RADSCL4, SclGrp);
  27.   new TRadioButton(this, IDC_RADSCL8, SclGrp);
  28.   SetTransferBuffer(DecBuffer);
  29. }
  30.  
  31. TDecDialog::~TDecDialog()
  32. {
  33.  Destroy();
  34.  delete SclGrp;
  35.  delete QGrp;
  36.  delete ResGrp;
  37. }
  38.  
  39. TEncDialog::TEncDialog(TWindow* parent,
  40.  EncTransfer* EncBuffer) : TDialog(parent, IDD_ENCOPT)
  41. {
  42.   ResGrp = new TGroupBox(this, IDC_RESBGRP);
  43.   new TRadioButton(this, IDC_RESB24, ResGrp);
  44.   new TRadioButton(this, IDC_RESB8, ResGrp);
  45.   new TRadioButton(this, IDC_RESB4, ResGrp);
  46.   new TRadioButton(this, IDC_RESBV, ResGrp);
  47.   new TRadioButton(this, IDC_RESB1, ResGrp);
  48.   SetTransferBuffer(EncBuffer);
  49. }
  50.  
  51. TEncDialog::~TEncDialog()
  52. {
  53.  Destroy();
  54.  delete ResGrp;
  55. }
  56.  
  57. TTifDialog::TTifDialog(TWindow* parent,
  58.  TifTransfer* TifBuffer) : TDialog(parent, IDD_COMTIF)
  59. {
  60.   new TEdit(this, IDC_STRIP, 4);
  61.   ResGrp = new TGroupBox(this, IDC_RESCGRP);
  62.   new TRadioButton(this, IDC_RADCNONE, ResGrp);
  63.   new TRadioButton(this, IDC_RADCITT, ResGrp);
  64.   new TRadioButton(this, IDC_RADPACK, ResGrp);
  65.   new TRadioButton(this, IDC_RADLZW, ResGrp);
  66.   SetTransferBuffer(TifBuffer);
  67. }
  68.  
  69. TTifDialog::~TTifDialog()
  70. {
  71.  Destroy();
  72.  delete ResGrp;
  73. }
  74.  
  75. TComDialog::TComDialog(TWindow* parent,
  76.  ComTransfer* ComBuffer) : TDialog(parent, IDD_COMOPT)
  77. {
  78.   TEdit* e;
  79.   e = new TEdit(this, IDC_QUALITY, 4);
  80.   e->SetValidator(new TRangeValidator(0, 100));
  81.   e = new TEdit(this, IDC_SMOOTH, 4);
  82.   e->SetValidator(new TRangeValidator(0, 100));
  83.   SetTransferBuffer(ComBuffer);
  84.   delete e;
  85. }
  86.  
  87. TComDialog::~TComDialog()
  88. {
  89.  Destroy();
  90. }
  91.  
  92. DEFINE_RESPONSE_TABLE1(TGaugeDialog, TDialog)
  93.   EV_COMMAND(IDCANCEL, CmCancel),
  94. END_RESPONSE_TABLE;
  95.  
  96.  
  97. TGaugeDialog::TGaugeDialog(TWindow* parent)
  98.                 : TDialog(parent, IDD_STATUS)
  99. {
  100.   Gauge = new TGauge(this, "%d%%", IDC_GAUGE, 20, 20, 240, 34,
  101.                             TRUE, 2);
  102. }
  103.  
  104. void TGaugeDialog::SetupWindow()
  105. {
  106.   TDialog::SetupWindow();
  107.   Gauge->SetRange(0,100);
  108.   Gauge->SetValue(0);
  109.   Gauge->SetColor(TColor::LtRed);
  110.   Cancel = 1;
  111. }
  112.  
  113. TGaugeDialog::~TGaugeDialog()
  114. {
  115.  Destroy();
  116.  delete Gauge;
  117. }
  118.  
  119. short TGaugeDialog::SetValue(int i)
  120. {
  121.   Gauge->SetValue(i);
  122.   GetApplication()->PumpWaitingMessages();
  123.   return Cancel;
  124. }
  125.  
  126. void TGaugeDialog::CmCancel()
  127. {
  128.   Cancel = 0;
  129. }
  130.  
  131. TGauge2Dialog::TGauge2Dialog(TWindow* parent)
  132.                 : TDialog(parent, IDD_STATUS2)
  133. {
  134.   Gauge = new TGauge(this, "%d%%", IDC_GAUGE, 20, 20, 240, 34,
  135.                             TRUE, 2);
  136. }
  137.  
  138. void TGauge2Dialog::SetupWindow()
  139. {
  140.   TDialog::SetupWindow();
  141.   Gauge->SetRange(0,100);
  142.   Gauge->SetValue(0);
  143.   Gauge->SetColor(TColor::LtRed);
  144. }
  145.  
  146. TGauge2Dialog::~TGauge2Dialog()
  147. {
  148.  Destroy();
  149.  delete Gauge;
  150. }
  151.  
  152. short TGauge2Dialog::SetValue(int i)
  153. {
  154.   Gauge->SetValue(i);
  155.   GetApplication()->PumpWaitingMessages();
  156.   return 1;
  157. }
  158.  
  159.