home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / VPR_DATA / DOGA / SOURCES / MEDIT.LZH / DSELRESO.CPP < prev    next >
C/C++ Source or Header  |  1996-06-28  |  2KB  |  88 lines

  1. /*  Project medit
  2.     Project Team DoGA
  3.     Copyright (c) 1995. All Rights Reserved.
  4.  
  5.     サブシステム:    medit.apx Application
  6.     ファイル:        dselreso.cpp
  7.     作成者:          Taka2
  8.  
  9.  
  10.     概要
  11.     ====
  12.     TDSelReso (TDialog) のインプリメンテーション用のソースファイル
  13. */
  14.  
  15. #include <owl\owlpch.h>
  16. #pragma hdrstop
  17.  
  18. #include <owl\edit.h>
  19. #include "dselreso.h"
  20.  
  21.  
  22. //
  23. // このアプリケーションで処理するすべてのメッセージ/コマンドの
  24. // 応答テーブルを作成する
  25. //
  26. DEFINE_RESPONSE_TABLE1(TDSelReso, TDialog)
  27. //{{TDSelResoRSP_TBL_BEGIN}}
  28.     EV_BN_CLICKED(IDOK, CmOK),
  29. //{{TDSelResoRSP_TBL_END}}
  30. END_RESPONSE_TABLE;
  31.  
  32.  
  33. //{{TDSelReso Implementation}}
  34.  
  35.  
  36. TDSelReso::TDSelReso (TWindow* parent, int iwidth, int iheight):
  37.     TDialog(parent, IDD_REND_RESO, NULL)
  38. {
  39.     // INSERT>> コンストラクタ用のコードはここに
  40.     editwidth = new TEdit(this, IDC_REND_WIDTH);
  41.     editheight = new TEdit(this, IDC_REND_HEIGHT);
  42.     selwidth = iwidth;
  43.     selheight = iheight;
  44. }
  45.  
  46.  
  47. TDSelReso::~TDSelReso ()
  48. {
  49.     Destroy();
  50.  
  51.     // INSERT>> デストラクタ用のコードはここに
  52.  
  53. }
  54.  
  55.  
  56. void TDSelReso::SetupWindow ()
  57. {
  58.     TDialog::SetupWindow();
  59.  
  60.     // INSERT>> 追加のコードはここに
  61.  
  62.        char mes[32];
  63.     wsprintf(mes, "%d", selwidth);
  64.     editwidth->SetText(mes);
  65.     wsprintf(mes, "%d", selheight);
  66.     editheight->SetText(mes);
  67.  
  68. }
  69.  
  70.  
  71. void TDSelReso::CmOK ()
  72. {
  73.     // INSERT>> 追加コードはここに
  74.     int n;
  75.     char mes[32];
  76.     editwidth->GetText(mes, 32);
  77.     n = atoi(mes);
  78.     if (0 < n && n <= 2048) selwidth = n;
  79.  
  80.     editheight->GetText(mes, 32);
  81.     n = atoi(mes);
  82.     if (0 < n && n <= 2048) selheight = n;
  83.  
  84.     CloseWindow(IDOK);
  85.  
  86. }
  87.  
  88.