ppsspp/Windows/W32Util/TabControl.h

41 lines
1.0 KiB
C
Raw Normal View History

2013-09-28 18:57:02 +00:00
#pragma once
#include <vector>
class Dialog;
class TabControl
{
public:
TabControl(HWND handle);
void HandleNotify(LPARAM lParam);
HWND AddTabWindow(wchar_t* className, wchar_t* title, DWORD style = 0);
void AddTabDialog(Dialog* dialog, wchar_t* title);
void AddTab(HWND hwnd, wchar_t* title);
2013-09-28 18:57:02 +00:00
void ShowTab(int index, bool setControlIndex = true);
void ShowTab(HWND pageHandle);
void NextTab(bool cycle);
void PreviousTab(bool cycle);
int CurrentTabIndex() { return currentTab; };
HWND CurrentTabHandle() { return tabs[currentTab].pageHandle; };
void SetShowTabTitles(bool enabled);
void SetIgnoreBottomMargin(bool enabled) { ignoreBottomMargin = enabled; };
bool GetShowTabTitles() { return showTabTitles; };
2013-09-28 18:57:02 +00:00
private:
static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void OnResize();
int AppendPageToControl(wchar_t* title);
struct TabInfo
{
HWND pageHandle;
wchar_t title[128];
};
2013-09-28 18:57:02 +00:00
HWND hwnd;
WNDPROC oldProc;
std::vector<TabInfo> tabs;
bool showTabTitles;
bool ignoreBottomMargin;
int currentTab;
2013-09-28 18:57:02 +00:00
};