Files
BlitzNext/debugger/tabber.hpp
T

56 lines
995 B
C++
Raw Normal View History

2014-01-31 08:23:00 +13:00
#ifndef TABBER_H
#define TABBER_H
class Tabber;
2019-01-18 17:04:34 +01:00
class TabberListener {
public:
virtual void currentSet(Tabber* tabber, int index) = 0;
2014-01-31 08:23:00 +13:00
};
2019-01-18 17:04:34 +01:00
class Tabber : public CTabCtrl {
public:
2014-01-31 08:23:00 +13:00
Tabber();
~Tabber();
2019-01-18 17:04:34 +01:00
void setListener(TabberListener* l);
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:34 +01:00
void insert(int index, CWnd* wnd, const string& text);
void remove(int index);
void setCurrent(int index);
void setTabText(int index, const string& t);
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:34 +01:00
int size() const;
int getCurrent() const;
CWnd* getTabWnd(int index) const;
string getTabText(int index) const;
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:34 +01:00
DECLARE_DYNAMIC(Tabber)
2014-01-31 08:23:00 +13:00
DECLARE_MESSAGE_MAP()
2019-01-18 17:04:34 +01:00
afx_msg void OnSize(UINT type, int w, int h);
afx_msg BOOL OnEraseBkgnd(CDC* dc);
afx_msg void tcn_selChange(NMHDR* p, LRESULT* result);
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:34 +01:00
private:
TabberListener* listener;
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:34 +01:00
struct Tab {
CWnd* wnd;
2014-01-31 08:23:00 +13:00
string text;
2019-01-18 17:04:34 +01:00
Tab(CWnd* w, const string& t) : wnd(w), text(t) {}
2014-01-31 08:23:00 +13:00
};
typedef list<Tab*> Tabs;
Tabs tabs;
2019-01-18 17:04:34 +01:00
int curr;
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:34 +01:00
void refresh();
2014-01-31 08:23:00 +13:00
CRect getInnerRect();
2019-01-18 17:04:34 +01:00
Tab* getTab(int index) const;
2014-01-31 08:23:00 +13:00
};
#endif