summaryrefslogtreecommitdiff
path: root/alf/alfnotebook.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alfnotebook.cpp')
-rw-r--r--alf/alfnotebook.cpp41
1 files changed, 8 insertions, 33 deletions
diff --git a/alf/alfnotebook.cpp b/alf/alfnotebook.cpp
index 314ee85..bdcb304 100644
--- a/alf/alfnotebook.cpp
+++ b/alf/alfnotebook.cpp
@@ -10,8 +10,6 @@
#define TABP_BODY 10
#define TMT_FILLCOLORHINT 3821
-TCHAR *_alf_notebookClass = NULL;
-
typedef struct {
HWND hwndTabCtrl;
HTHEME hTheme;
@@ -559,41 +557,18 @@ ALF__NotebookWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
-void
-ALF_RegisterNotebookClass(void)
-{
- WNDCLASS cls;
- ZeroMemory(&cls, sizeof(cls));
-
- TCHAR classNameBuf[256];
- ALF_BuildUniqueName(classNameBuf, TEXT("ALFNotebook."), (ULONG_PTR)&_alf_notebookClass);
-
- cls.hInstance = ALF_HINSTANCE;
- cls.hCursor = LoadCursor(NULL, (LPTSTR)IDC_ARROW);
- cls.lpszClassName = classNameBuf;
- cls.cbWndExtra = sizeof(ALFNotebookPriv*);
- cls.lpfnWndProc = ALF__NotebookWindowProc;
-
- ATOM classatom = RegisterClass(&cls);
- if (!classatom)
- MessageBox(NULL, TEXT("FATAL: Could not register notebook class"), NULL, MB_OK);
-
- _alf_notebookClass = MAKEINTATOM(classatom);
-}
-
// tab control
HWND
ALF_AddNotebook(HWND parent, WORD id, int x, int y)
{
- HWND hwndNtbk = CreateWindowEx(WS_EX_CONTROLPARENT,
- _alf_notebookClass,
- TEXT(""),
- WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN,
- 0, 0, 100, 100,
- parent,
- (HMENU)(ULONG_PTR)id,
- ALF_HINSTANCE,
- NULL);
+ HWND hwndNtbk = ALF_CreateControlWindow(WS_EX_CONTROLPARENT,
+ TEXT(""),
+ WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN,
+ 0, 0, 100, 100,
+ parent,
+ (HMENU)(ULONG_PTR)id,
+ ALF__NotebookWindowProc,
+ NULL);
ALF_AddWidget(parent, x, y, hwndNtbk, 0, 0, ALF_LAYOUT_SIZE_QUERY | ALF_LAYOUT_INHERITFONT | ALF_LAYOUT_SENDDPICHANGE);