home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
VPR_DATA
/
DOGA
/
SOURCES
/
MEDIT.LZH
/
DROTKEY.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-10
|
6KB
|
262 lines
/* Project medit
Project Team DoGA
Copyright (c) 1995. All Rights Reserved.
サブシステム: medit.apx Application
ファイル: drotkey.cpp
作成者: Taka2
概要
====
TDRotKey (TDialog) のインプリメンテーション用のソースファイル
*/
#include <owl\owlpch.h>
#pragma hdrstop
#include <owl\button.h>
#include <owl\radiobut.h>
#include <owl\groupbox.h>
#include "drotkey.h"
#include "motion.h"
#include "log.h"
//
// このアプリケーションで処理するすべてのメッセージ/コマンドの
// 応答テーブルを作成する
//
DEFINE_RESPONSE_TABLE1(TDRotKey, TDialog)
//{{TDRotKeyRSP_TBL_BEGIN}}
EV_BN_CLICKED(IDOK, OKClicked),
EV_BN_CLICKED(IDCANCEL, CancelClicked),
EV_BN_CLICKED(IDC_DELETE, DelClicked),
EV_BN_CLICKED(IDC_RADIOBUTTON_PREV_FORWARD, CmPrevForward),
EV_BN_CLICKED(IDC_RADIOBUTTON_PREV_LINEAR, CmPrevLinear),
EV_BN_CLICKED(IDC_RADIOBUTTON_PREV_TARGET, CmPrevTarget),
EV_BN_CLICKED(IDC_RADIOBUTTON_NEXT_FORWARD, CmNextForward),
EV_BN_CLICKED(IDC_RADIOBUTTON_NEXT_LINEAR, CmNextLinear),
EV_BN_CLICKED(IDC_RADIOBUTTON_NEXT_TARGET, CmNextTarget),
//{{TDRotKeyRSP_TBL_END}}
END_RESPONSE_TABLE;
//{{TDRotKey Implementation}}
TDRotKey::TDRotKey (TWindow* parent, Motion *m, int frame, TResId resId, TModule* module):
TDialog(parent, resId, module)
{
// INSERT>> コンストラクタ用のコードはここに
motion = m;
nowpose = frame - m->beginframe;
prev_box = new TGroupBox(this, IDC_GROUPBOX1);
prev_forward = new TRadioButton(this, IDC_RADIOBUTTON_PREV_FORWARD, prev_box);
prev_linear = new TRadioButton(this, IDC_RADIOBUTTON_PREV_LINEAR, prev_box);
prev_target = new TRadioButton(this, IDC_RADIOBUTTON_PREV_TARGET, prev_box);
next_box = new TGroupBox(this, IDC_GROUPBOX2);
next_forward = new TRadioButton(this, IDC_RADIOBUTTON_NEXT_FORWARD, next_box);
next_linear = new TRadioButton(this, IDC_RADIOBUTTON_NEXT_LINEAR, next_box);
next_target = new TRadioButton(this, IDC_RADIOBUTTON_NEXT_TARGET, next_box);
button_delete = new TButton(this, IDC_DELETE);
}
TDRotKey::~TDRotKey ()
{
Destroy();
// INSERT>> デストラクタ用のコードはここに
}
void TDRotKey::SetupWindow ()
{
TDialog::SetupWindow();
// INSERT>> 追加のコードはここに
nextkeypose = -1;
for (int i = nowpose+1; i < motion->endframe - motion->beginframe + 1; ++i) {
if (motion->pose[i].dirtype != DirNone) {
nextkeypose = i;
break;
}
}
prev_target->EnableWindow(FALSE);
next_target->EnableWindow(FALSE);
if (nextkeypose < 0) {
nowpose = motion->endframe - motion->beginframe;
switch (motion->pose[nowpose].dirtype) {
case DirInit:
case DirNone:
case DirForward:
prev_forward->SetCheck(BF_CHECKED);
break;
case DirLinear:
prev_linear->SetCheck(BF_CHECKED);
break;
case DirTarget:
prev_target->SetCheck(BF_CHECKED);
break;
}
next_forward->EnableWindow(FALSE);
next_linear->EnableWindow(FALSE);
next_target->EnableWindow(FALSE);
next_box->EnableWindow(FALSE);
button_delete->EnableWindow(FALSE);
} else if (motion->pose[nowpose].dirtype == DirNone) {
switch (motion->pose[nextkeypose].dirtype) {
case DirInit:
case DirNone:
case DirForward:
prev_forward->SetCheck(BF_CHECKED);
next_forward->SetCheck(BF_CHECKED);
break;
case DirLinear:
prev_linear->SetCheck(BF_CHECKED);
next_linear->SetCheck(BF_CHECKED);
break;
case DirTarget:
prev_target->SetCheck(BF_CHECKED);
next_target->SetCheck(BF_CHECKED);
break;
}
button_delete->EnableWindow(FALSE);
} else {
switch (motion->pose[nextkeypose].dirtype) {
case DirInit:
case DirNone:
case DirForward:
next_forward->SetCheck(BF_CHECKED);
break;
case DirLinear:
next_linear->SetCheck(BF_CHECKED);
break;
case DirTarget:
next_target->SetCheck(BF_CHECKED);
break;
}
switch (motion->pose[nowpose].dirtype) {
case DirInit:
case DirNone:
case DirForward:
prev_forward->SetCheck(BF_CHECKED);
break;
case DirLinear:
prev_linear->SetCheck(BF_CHECKED);
break;
case DirTarget:
prev_target->SetCheck(BF_CHECKED);
break;
}
}
}
void TDRotKey::BNClicked ()
{
// INSERT>> 追加コードはここに
}
void TDRotKey::OKClicked ()
{
// INSERT>> 追加コードはここに
if (prev_forward->GetCheck() == BF_CHECKED) {
motion->pose[nowpose].dirtype = DirForward;
} else if (prev_linear->GetCheck() == BF_CHECKED) {
motion->pose[nowpose].dirtype = DirLinear;
} else if (prev_target->GetCheck() == BF_CHECKED) {
motion->pose[nowpose].dirtype = DirTarget;
}
if (next_forward->GetCheck() == BF_CHECKED) {
motion->pose[nextkeypose].dirtype = DirForward;
} else if (next_linear->GetCheck() == BF_CHECKED) {
motion->pose[nextkeypose].dirtype = DirLinear;
} else if (next_target->GetCheck() == BF_CHECKED) {
motion->pose[nextkeypose].dirtype = DirTarget;
}
CloseWindow(IDOK);
}
void TDRotKey::CancelClicked ()
{
// INSERT>> 追加コードはここに
Destroy(IDCANCEL);
}
void TDRotKey::DelClicked ()
{
// INSERT>> 追加コードはここに
motion->pose[nowpose].dirtype = DirNone;
CloseWindow(IDOK);
}
void TDRotKey::CmNextForward ()
{
// INSERT>> 追加コードはここに
next_forward->SetCheck(TRUE);
next_linear ->SetCheck(FALSE);
next_target ->SetCheck(FALSE);
}
void TDRotKey::CmNextLinear ()
{
// INSERT>> 追加コードはここに
next_forward->SetCheck(FALSE);
next_linear ->SetCheck(TRUE);
next_target ->SetCheck(FALSE);
}
void TDRotKey::CmNextTarget ()
{
// INSERT>> 追加コードはここに
next_forward->SetCheck(FALSE);
next_linear ->SetCheck(FALSE);
next_target ->SetCheck(TRUE);
}
void TDRotKey::CmPrevForward ()
{
// INSERT>> 追加コードはここに
prev_forward->SetCheck(TRUE);
prev_linear ->SetCheck(FALSE);
prev_target ->SetCheck(FALSE);
}
void TDRotKey::CmPrevLinear ()
{
// INSERT>> 追加コードはここに
prev_forward->SetCheck(FALSE);
prev_linear ->SetCheck(TRUE);
prev_target ->SetCheck(FALSE);
}
void TDRotKey::CmPrevTarget ()
{
// INSERT>> 追加コードはここに
prev_forward->SetCheck(FALSE);
prev_linear ->SetCheck(FALSE);
prev_target ->SetCheck(TRUE);
}