Source: midimountain/mvcHeader.h


Annotated List
Files
Globals
Hierarchy
Index
//=============================================================================
//  model view control header
//=============================================================================
// Author  : Adrian Meyer
// Version : 0.2.0
// Log     :
//=============================================================================
// 14.09.2000 building class
//============================================================================
// to do   :
//=============================================================================
#ifndef __MVCHEADER__
#define __MVCHEADER__

#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <stdio.h>

#include <mvcBase.h>
#include <mcSequence.h>

class TMvcHeader
{
  private:
    GtkWidget* fWidget;                               // main widget
    TMidiSequence* fSequence;                         // last displayed sequence

    int fWidth;                                       // width of drawing area
    int fHeight;                                      // height of drawing area
    int fWindowWidth;                                 // width of window

    float fTicksPerPix;                               // midi ticks per pixel on screen
    long fMeasureCount;                               // measure count for x-axis
    bool fSelectionActive;                            // selection in progress
    bool fPositionActive;                             // setting position in progress
    long fLastPixPosition;                            // last position in pixels
    GtkAdjustment* fAdjustment;                       // adjustment for scrolling

    GdkColor* colBackgroundHeader;                    // background color header
    GdkColor* colGrid;                                // color of grid
    GdkColor* colPosition;                            // position color
    GdkPixmap* fBuffer;                               // pixmap buffer for header

                                                      // read offset on grid
    void DrawPosition( void );                        // draw position in main and header
  public:
                                                      // constructor
    TMvcHeader( GtkWidget* aWidget, TMidiSequence* aSequence, GtkAdjustment* aAdjustment );
    GtkWidget* GetWidget( void );                     // read widget

    void Resize( long aWidth, float aTicksPerPix, long aWindowWidth, long aMeasureCount );  
                                                      // draw in main area
    bool Expose( GtkWidget* aWidget, GdkEventExpose* aEvent );
    void MCMessage( TMidiBase* aMidiBase, sMCMessage* aMCMessage );                                                

    void MouseDown( long x );                         // mouse events
    void MouseUp( long x );
    void MouseMove( long x );
};

#endif

Generated by: root@castle on Fri Jul 20 00:33:17 2001, using kdoc 2.0a36.