view Navigator.h @ 1:f3fd4e19cec0 tip

first binary upload
author wenx <xue.wen@eecs.qmul.ac.uk>
date Wed, 10 Aug 2011 14:56:28 +0100
parents a6a46af64546
children
line wrap: on
line source
/*
    Harmonic Visualiser

    An audio file viewer and editor.
    Centre for Digital Music, Queen Mary, University of London.
    This file copyright 2011 Wen Xue.

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 2 of the
    License, or (at your option) any later version. 
*/
//---------------------------------------------------------------------------

#ifndef NavigatorH
#define NavigatorH
//---------------------------------------------------------------------------
/*
  Navigator.cpp implements TNavigator, a VCL control for specifying a rectangular
  area inside a larger rectangular area. 
*/
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <Controls.hpp>
//---------------------------------------------------------------------------
typedef enum {maNoAction, maMove, maSize} TNavigatorMouseAction;
typedef enum {htOuter, htLeft, htTopLeft, htTop, htTopRight, htRight, htBottomRight, htBottom, htBottomLeft, htInner} TNavigatorHitTest;

class PACKAGE TNavigator : public TCustomControl
{
private:
  int X0;
  int Y0;
  int XL;
  int YL;
  double x01;
  double x02;
  double y01;
  double y02;
  int X1;
  int X2;
  int Y1;
  int Y2;
  TNavigatorMouseAction FMouseAction;
  TNavigatorHitTest FHitTest;
  TNotifyEvent FOnAreaChange;
  TNotifyEvent FOnBackground;
protected:
  TNavigatorHitTest HitTest(int X, int Y);
  virtual void __fastcall Paint();
  DYNAMIC void __fastcall MouseDown(TMouseButton, TShiftState, int, int);
  DYNAMIC void __fastcall MouseMove(TShiftState, int, int);
  DYNAMIC void __fastcall MouseUp(TMouseButton, TShiftState, int, int);
public:
  Graphics::TBitmap* BkgBmp;

  double x1;
  double x2;
  double y1;
  double y2;

  TColor AreaColorX;
  __property Canvas;

	__fastcall TNavigator(TComponent* Owner);
	__fastcall ~TNavigator();
  void DrawArea();
  DYNAMIC void __fastcall Resize();
  void SetArea(double, double, double, double);

__published:
  __property TNotifyEvent OnAreaChange={read=FOnAreaChange, write=FOnAreaChange};
  __property TNotifyEvent OnBackground={read=FOnBackground, write=FOnBackground};
  __property PopupMenu;

};
//---------------------------------------------------------------------------
#endif