overte/interface/src/MenuColumn.h
ZappoMan e921d06877 Added new feature to MenuRow to allow custom callback for State
Note: there's some bug in the menu render code that doesn't like state strings
that are longer than 4 characters + NULL. So, the current code will clip any
state string that is longer than 4 characters. We need to look into this 5
character limit. It's a bug.
2013-04-13 15:18:19 -07:00

44 lines
1.2 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// MenuColumn.h
// hifi
//
// Created by Dominque Vincent on 4/10/13.
//
//
#ifndef __hifi__MenuColumn__
#define __hifi__MenuColumn__
#include <vector>
class MenuColumn {
public:
MenuColumn();
MenuColumn(const char* columnName);
~MenuColumn();
void mouseClickRow(int iColumnIndex);
bool mouseClick(int x, int y, int xLeft, int menuHeight, int lineHeight);
void setMouseOver(int xLeft, int xRight, int yTop, int yBottom);
bool mouseOver(int x, int y, int xLeft, int menuHeight, int lineHeight);
char* getName();
int getWidth(float scale, int mono, int leftPosition);
int getWidth();
int getLeftPosition();
void render(int yOffset, int menuHeight, int lineHeight);
void renderMouseOver(int yOffset);
int addRow(const char* rowName, MenuRowCallback callback);
int addRow(const char* rowName, MenuRowCallback callback, MenuStateNameCallback stateNameCallback);
int getMaxRowWidth();
private:
char columnName[MAX_COLUMN_NAME];
int columnWidth;
int leftPosition;
std::vector<MenuRow> rows;
int leftMouseOver;
int rightMouseOver;
int topMouseOver;
int bottomMouseOver;
};
#endif /* defined(__hifi__MenuColumn__) */