home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / VPR_DATA / DOGA / SOURCES / WIREVIEW.LZH / TIMEBAR.CPP < prev    next >
C/C++ Source or Header  |  1995-12-15  |  2KB  |  87 lines

  1. /*  Project medit
  2.     Project Team DoGA
  3.     Copyright (c) 1995. All Rights Reserved.
  4.  
  5.     サブシステム:    medit.apx Application
  6.     ファイル:        timebar.cpp
  7.     作成者:          Taka2
  8.  
  9.  
  10.     概要
  11.     ====
  12.     TTimeBar (TScrollBar) のインプリメンテーション用のソースファイル
  13. */
  14.  
  15.  
  16. #include <owl\owlpch.h>
  17. #pragma hdrstop
  18.  
  19. #include "timebar.h"
  20. #include "anim.h"
  21. #include "motion.h"
  22.  
  23.  
  24. //{{TTimeBar Implementation}}
  25.  
  26.  
  27. TTimeBar::TTimeBar (TWindow* parent, AnimationData *a, int id, int x, int y, int w, int h, BOOL /*isHScrollBar*/, TModule* /*module*/):
  28.     THSlider(parent, id, x, y, w, h)
  29. {
  30.     // TScrollBar 用の,デフォルトのウィンドウスタイルをオーバーライドする
  31. //    Attr.Style |= WS_CHILD | WS_VISIBLE;
  32. //    Attr.Style &= ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX);
  33.  
  34.     // INSERT>> コンストラクタ用のコードはここに
  35.  
  36.     PageMagnitude = 5;
  37.     LineMagnitude = 1;
  38.     SetRuler(5, FALSE);
  39.  
  40.     anim = a;
  41.  
  42. }
  43.  
  44.  
  45. TTimeBar::~TTimeBar ()
  46. {
  47.     Destroy();
  48.  
  49.     // INSERT>> デストラクタ用のコードはここに
  50.  
  51. }
  52.  
  53.  
  54. void TTimeBar::SBPageDown ()
  55. {
  56. //    TScrollBar::SBPageDown();
  57.  
  58.     // INSERT>> 追加のコードはここに
  59.     if (anim->select == NULL) {
  60.         TScrollBar::SBPageDown();
  61.     } else if (anim->selectframe >= anim->select->endframe) {
  62.         SetPosition(anim->maxframe);
  63.     } else if (anim->selectframe < anim->select->beginframe) {
  64.         SetPosition(anim->select->beginframe);
  65.     } else {
  66.         SetPosition(anim->select->endframe);
  67.     }
  68. }
  69.  
  70.  
  71. void TTimeBar::SBPageUp ()
  72. {
  73. //    TScrollBar::SBPageUp();
  74.  
  75.     // INSERT>> 追加のコードはここに
  76.  
  77.     if (anim->select == NULL) {
  78.         TScrollBar::SBPageUp();
  79.     } else if (anim->selectframe <= anim->select->beginframe) {
  80.         SetPosition(BEGIN);
  81.     } else if (anim->selectframe > anim->select->endframe) {
  82.         SetPosition(anim->select->endframe);
  83.     } else {
  84.         SetPosition(anim->select->beginframe);
  85.     }
  86. }
  87.