home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
VPR_DATA
/
DOGA
/
SOURCES
/
MEDIT.LZH
/
TIMEBAR.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-05-30
|
2KB
|
101 lines
/* Project medit
Project Team DoGA
Copyright (c) 1995. All Rights Reserved.
サブシステム: medit.apx Application
ファイル: timebar.cpp
作成者: Taka2
概要
====
TTimeBar (TScrollBar) のインプリメンテーション用のソースファイル
*/
#include <owl\owlpch.h>
#pragma hdrstop
#include "timebar.h"
#include "anim.h"
#include "motion.h"
//{{TTimeBar Implementation}}
TTimeBar::TTimeBar (TWindow* parent, AnimationData *a, int id, int x, int y, int w, int h, BOOL /*isHScrollBar*/, TModule* /*module*/):
#ifdef SLIDER_FRAME
THSlider(parent, id, x, y, w, h)
#else
TScrollBar(parent, id, x, y, w, h, isHScrollBar, module)
#endif
{
// TScrollBar 用の,デフォルトのウィンドウスタイルをオーバーライドする
// Attr.Style |= WS_CHILD | WS_VISIBLE;
// Attr.Style &= ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX);
// INSERT>> コンストラクタ用のコードはここに
SetBkgndColor(TColor::LtGray);
PageMagnitude = 5;
LineMagnitude = 1;
SetRuler(5, FALSE);
anim = a;
}
TTimeBar::~TTimeBar ()
{
Destroy();
// INSERT>> デストラクタ用のコードはここに
}
void TTimeBar::SBPageDown ()
{
// TScrollBar::SBPageDown();
// INSERT>> 追加のコードはここに
if (anim->select == NULL) {
TScrollBar::SBPageDown();
} else if (anim->selectframe >= anim->select->endframe) {
SetPosition(anim->maxframe);
} else if (anim->selectframe < anim->select->beginframe) {
SetPosition(anim->select->beginframe);
} else {
SetPosition(anim->select->endframe);
}
}
void TTimeBar::SBPageUp ()
{
// TScrollBar::SBPageUp();
// INSERT>> 追加のコードはここに
if (anim->select == NULL) {
TScrollBar::SBPageUp();
} else if (anim->selectframe <= anim->select->beginframe) {
SetPosition(BEGIN);
} else if (anim->selectframe > anim->select->endframe) {
SetPosition(anim->select->endframe);
} else {
SetPosition(anim->select->beginframe);
}
}
int
TTimeBar::PointToPos(TPoint& point)
{
return ((int)((long)point.x*Range))/((int)(Attr.W-ThumbRect.Width())) + (int)Min;
}