home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
VPR_DATA
/
DOGA
/
SOURCES
/
MEDIT.LZH
/
DTRANGE.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-07
|
2KB
|
93 lines
/* Project medit
Project Team DoGA
Copyright (c) 1995. All Rights Reserved.
サブシステム: medit.apx Application
ファイル: dtrange.cpp
作成者: Taka2
概要
====
TDTimeRange (TDialog) のインプリメンテーション用のソースファイル
*/
#include <owl\owlpch.h>
#pragma hdrstop
#include "dtrange.h"
#include "motion.h"
const int MaxLength = 8;
const int DefaultMaxFrame = 20;
//
// このアプリケーションで処理するすべてのメッセージ/コマンドの
// 応答テーブルを作成する
//
DEFINE_RESPONSE_TABLE1(TDTimeRange, TDialog)
//{{TDTimeRangeRSP_TBL_BEGIN}}
EV_BN_CLICKED(IDOK, CmOK),
//{{TDTimeRangeRSP_TBL_END}}
END_RESPONSE_TABLE;
//{{TDTimeRange Implementation}}
TDTimeRange::TDTimeRange (TWindow* parent, int* begin, int* end, TResId resId, TModule* module):
TDialog(parent, resId, module)
{
// INSERT>> コンストラクタ用のコードはここに
beginframe = begin;
endframe = end;
EditBegin = new TEdit(this, IDC_EDIT_BEGIN, MaxLength);
EditEnd = new TEdit(this, IDC_EDIT_END, MaxLength);
}
TDTimeRange::~TDTimeRange ()
{
Destroy();
// INSERT>> デストラクタ用のコードはここに
}
void TDTimeRange::CmOK ()
{
// INSERT>> 追加コードはここに
char str[MaxLength+1];
EditBegin->GetText(str, MaxLength);
*beginframe = atoi(str);
EditEnd->GetText(str, MaxLength);
*endframe = atoi(str);
CloseWindow(IDOK);
}
void TDTimeRange::SetupWindow ()
{
TDialog::SetupWindow();
// INSERT>> 追加のコードはここに
char str[10];
sprintf(str, "%d", *beginframe);
EditBegin->SetText(str);
if (*endframe == 1) {
sprintf(str, "%d", DefaultMaxFrame);
} else {
sprintf(str, "%d", *endframe);
}
EditEnd->SetText(str);
EditEnd->SetSelection(0, strlen(str));
}