~ppsspp/ppsspp/ppsspp_1.3.0

« back to all changes in this revision

Viewing changes to Windows/W32Util/TabControl.h

  • Committer: Sérgio Benjamim
  • Date: 2017-01-02 00:12:05 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20170102001205-cxbta9za203nmjwm
1.3.0 source (from ppsspp_1.3.0-r160.p5.l1762.a165.t83~56~ubuntu16.04.1.tar.xz).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#pragma once
 
2
 
 
3
#include <vector>
 
4
 
 
5
class Dialog;
 
6
 
 
7
class TabControl
 
8
{
 
9
public:
 
10
        TabControl(HWND handle, bool noDisplayArea = false);
 
11
        void HandleNotify(LPARAM lParam);
 
12
        HWND AddTabWindow(wchar_t* className, wchar_t* title, DWORD style = 0);
 
13
        void AddTabDialog(Dialog* dialog, wchar_t* title);
 
14
        void AddTab(HWND hwnd, wchar_t* title);
 
15
        void ShowTab(int index, bool setControlIndex = true);
 
16
        void ShowTab(HWND pageHandle);
 
17
        void NextTab(bool cycle);
 
18
        void PreviousTab(bool cycle);
 
19
        int CurrentTabIndex() { return currentTab; }
 
20
        HWND CurrentTabHandle() {
 
21
                if (currentTab < 0 || currentTab >= (int)tabs.size()) {
 
22
                        return NULL;
 
23
                }
 
24
                return tabs[currentTab].pageHandle;
 
25
        }
 
26
        void SetShowTabTitles(bool enabled);
 
27
        void SetIgnoreBottomMargin(bool enabled) { ignoreBottomMargin = enabled; }
 
28
        bool GetShowTabTitles() { return showTabTitles; }
 
29
        void SetMinTabWidth(int w);
 
30
 
 
31
private:
 
32
        static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
 
33
        void OnResize();
 
34
        int AppendPageToControl(wchar_t* title);
 
35
 
 
36
        struct TabInfo
 
37
        {
 
38
                bool hasBorder;
 
39
                bool hasClientEdge;
 
40
                HWND lastFocus;
 
41
                HWND pageHandle;
 
42
                wchar_t title[128];
 
43
        };
 
44
 
 
45
        HWND hwnd;
 
46
        WNDPROC oldProc;
 
47
        std::vector<TabInfo> tabs;
 
48
        bool showTabTitles;
 
49
        bool ignoreBottomMargin;
 
50
        int currentTab;
 
51
        bool hasButtons;
 
52
        bool noDisplayArea_;
 
53
};
 
 
b'\\ No newline at end of file'