1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
#ifndef _raptor_menu_h_
#define _raptor_menu_h_
#include <string>
#include "bitmap.h"
using namespace std;
class Font;
class RField;
class RMenu{
public:
RMenu( const Bitmap & intr, int x, int y, int height, int c1, int c2, int title_color );
//addMenu: Adds a RField class to the list
virtual RField * addTitle( string title, Font * rf );
virtual RField * addMenu( string menu, Font * rf, bool s, int r, RMenu * who, int sound );
virtual RField * addMenu( const Bitmap & look, bool s, int r, RMenu * who, int sound );
//replace: Replaces a given RField with a new RField at position q in the list
virtual void replace( int q, string title, Font * rf, bool s, int r, RMenu * who, int sound );
virtual void replaceTitle( int q, string title, Font * rf );
virtual void replace( int q, const Bitmap & look, bool s, int r, RMenu * who, int sound );
//returns the place where field str lives, or -1 if cant find
virtual int askPos( string title );
//procMenu: Runs the current menu, returning the value of the menu
//and changing the current menu to the selected one
virtual int procMenu( RMenu ** current );
virtual void init();
virtual bool changed();
virtual void nextMenu( int q, RMenu * nx );
virtual void prevMenu( RMenu * rm );
virtual RMenu * Previous();
virtual void clear();
virtual bool Selected();
virtual ~RMenu();
protected:
int countNodes();
void spiffy_triangle( const Bitmap & work, int x1, int y1, int color, int * shade, int MAX_SHADE, int dir );
virtual void Draw( const Bitmap & work, int x, int * yval, int * yshade, int min, int max );
virtual void endMenu();
Bitmap background;
int last_opt;
int first_x, first_y;
int col1, col2;
int t_color;
RField * head, * location;
RMenu * prev;
int * shade;
int * shade_border;
int * shade_opt_color;
bool select;
protected:
Bitmap work;
double x1;
int ang;
int height;
int col_up;
int col_down;
int opt_max;
int max_seen; //maximum number of fields on the screen at any one time
int * opts;
RField * field_seen;
int keep_y;
int * opts_shade;
RField * temp;
int ac_y;
bool k_hold;
int min_x;
int shade_counter;
bool initialized;
bool change;
};
#endif
|