home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
VPR_DATA
/
DOGA
/
SOURCES
/
MEDIT.LZH
/
DTEXPAND.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-26
|
3KB
|
150 lines
/* Project medit
Project Team DoGA
Copyright (c) 1995. All Rights Reserved.
サブシステム: medit.apx Application
ファイル: dtexpand.cpp
作成者: Taka2
概要
====
TDTimeExpand (TDialog) のインプリメンテーション用のソースファイル
*/
#include <owl\owlpch.h>
#pragma hdrstop
#include <owl\scrollba.h>
#include <owl\static.h>
#include <owl\inputdia.h>
#include "dtexpand.h"
#include "anim.h"
#include "motion.h"
//
// このアプリケーションで処理するすべてのメッセージ/コマンドの
// 応答テーブルを作成する
//
DEFINE_RESPONSE_TABLE1(TDTimeExpand, TDialog)
//{{TDTimeExpandRSP_TBL_BEGIN}}
EV_BN_CLICKED(IDOK, CmOK),
EV_CHILD_NOTIFY_ALL_CODES(IDC_SCROLL_TIME_BEGIN, EvScrollBegin),
EV_CHILD_NOTIFY_ALL_CODES(IDC_SCROLL_TIME_END, EvScrollEnd),
EV_BN_CLICKED(IDC_BUTTON_NEWFRAME, CmNewFrame),
//{{TDTimeExpandRSP_TBL_END}}
END_RESPONSE_TABLE;
//{{TDTimeExpand Implementation}}
TDTimeExpand::TDTimeExpand (TWindow* parent, AnimationData *a, Motion *m, TResId resId, TModule* module):
TDialog(parent, resId, module)
{
// INSERT>> コンストラクタ用のコードはここに
anim = a;
motion = m;
scrollbegin = new TScrollBar(this, IDC_SCROLL_TIME_BEGIN);
scrollend = new TScrollBar(this, IDC_SCROLL_TIME_END);
framebegin = new TStatic(this, IDC_NUM_TIME_BEGIN);
frameend = new TStatic(this, IDC_NUM_TIME_END);
}
TDTimeExpand::~TDTimeExpand ()
{
Destroy();
// INSERT>> デストラクタ用のコードはここに
}
void TDTimeExpand::CmOK ()
{
// INSERT>> 追加コードはここに
motion->Zoom(begin, end);
CloseWindow(IDOK);
}
void TDTimeExpand::SetupWindow ()
{
TDialog::SetupWindow();
// INSERT>> 追加のコードはここに
scrollbegin->PageMagnitude = scrollend ->PageMagnitude = 5;
scrollbegin->LineMagnitude = scrollend ->LineMagnitude = 1;
scrollbegin->SetRange(BEGIN, anim->maxframe);
scrollend ->SetRange(BEGIN, anim->maxframe);
scrollbegin->SetPosition(begin);
scrollend ->SetPosition(end);
begin = motion->beginframe;
end = motion->endframe;
char str[10];
sprintf(str, "%d", begin);
framebegin->SetText(str);
sprintf(str, "%d", end);
frameend->SetText(str);
}
void TDTimeExpand::EvScrollBegin(UINT /*code*/)
{
if (begin != scrollbegin->GetPosition()) {
begin = scrollbegin->GetPosition();
char str[10];
sprintf(str, "%d", begin);
framebegin->SetText(str);
if (begin > scrollend->GetPosition()) {
end = begin;
frameend->SetText(str);
scrollend->SetPosition(begin);
}
}
}
void TDTimeExpand::EvScrollEnd(UINT /*code*/)
{
if (end != scrollend->GetPosition()) {
end = scrollend->GetPosition();
char str[10];
sprintf(str, "%d", end);
frameend->SetText(str);
if (scrollbegin->GetPosition() > end) {
begin = end;
framebegin->SetText(str);
scrollbegin->SetPosition(end);
}
}
}
void TDTimeExpand::CmNewFrame ()
{
// INSERT>> 追加コードはここに
char str[16];
sprintf(str, "%d", anim->maxframe);
TInputDialog dialog((TWindow*)anim->Frame, "新規フレーム設定", "最大フレームを設定してください", str, 16);
if (dialog.Execute() == IDOK) {
int n = atoi(str);
if (anim->maxframe < n && n < 30000) {
anim->ExpandFrame(n);
scrollbegin->SetRange(BEGIN, anim->maxframe);
scrollend ->SetRange(BEGIN, anim->maxframe);
scrollbegin->SetPosition(begin);
scrollend ->SetPosition(end);
}
}
}