[sword-svn] r172 - in trunk/src/SwordReader_GUI: . SRFramework
dtrotzjr at www.crosswire.org
dtrotzjr at www.crosswire.org
Fri Sep 5 20:37:37 MST 2008
Author: dtrotzjr
Date: 2008-09-05 20:37:36 -0700 (Fri, 05 Sep 2008)
New Revision: 172
Added:
trunk/src/SwordReader_GUI/SRFramework/SRTabCtrl.cpp
trunk/src/SwordReader_GUI/SRFramework/SRTabCtrl.h
Modified:
trunk/src/SwordReader_GUI/SwordReader_GUI.vcproj
Log:
Beginnings of a new tabbed control class.
Added: trunk/src/SwordReader_GUI/SRFramework/SRTabCtrl.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRFramework/SRTabCtrl.cpp (rev 0)
+++ trunk/src/SwordReader_GUI/SRFramework/SRTabCtrl.cpp 2008-09-06 03:37:36 UTC (rev 172)
@@ -0,0 +1,59 @@
+#include "SRTabCtrl.h"
+
+#include <commctrl.h>
+
+using namespace SRFramework;
+
+SRTabCtrl::SRTabCtrl(void)
+{
+ INITCOMMONCONTROLSEX InitCtrlEx;
+
+ InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
+ InitCtrlEx.dwICC = ICC_TAB_CLASSES;
+ InitCommonControlsEx(&InitCtrlEx);
+
+ m_wcsClassName = WC_TABCONTROL;
+ m_wcsWindowName = "";
+}
+
+SRTabCtrl::~SRTabCtrl(void)
+{
+
+}
+
+BOOL SRTabCtrl::Create(SRWnd *pParentWnd, RECT bounds)
+{
+ if(!Register())
+ return FALSE;
+
+ if(!SRWnd::Create(m_wcsClassName,m_wcsWindowName,WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE, bounds, pParentWnd, NULL, m_hInstance))
+ return FALSE;
+
+ return TRUE;
+}
+
+BOOL SRTabCtrl::Register()
+{
+ // Register window class...
+ WNDCLASS wc;
+ if(s_fRegistered)
+ return TRUE;
+
+ wc.style = CS_HREDRAW | CS_VREDRAW | CS_PARENTDC;
+ wc.lpfnWndProc = (WNDPROC) MessageRoute;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = m_hInstance;
+ wc.hIcon = NULL;
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
+ wc.lpszMenuName = 0;
+ wc.lpszClassName = m_wcsClassName.w_str();
+
+ if(RegisterClass(&wc) == 0)
+ return FALSE;
+
+ s_fRegistered = TRUE;
+
+ return TRUE;
+}
\ No newline at end of file
Added: trunk/src/SwordReader_GUI/SRFramework/SRTabCtrl.h
===================================================================
--- trunk/src/SwordReader_GUI/SRFramework/SRTabCtrl.h (rev 0)
+++ trunk/src/SwordReader_GUI/SRFramework/SRTabCtrl.h 2008-09-06 03:37:36 UTC (rev 172)
@@ -0,0 +1,16 @@
+#pragma once
+#include "srwnd.h"
+
+namespace SRFramework{
+
+ class SRTabCtrl : public SRFramework::SRWnd
+ {
+ public:
+ SRTabCtrl(void);
+ virtual ~SRTabCtrl(void);
+ BOOL Create(SRWnd *pParentWnd, RECT bounds);
+ BOOL Register();
+ };
+
+
+}
\ No newline at end of file
Modified: trunk/src/SwordReader_GUI/SwordReader_GUI.vcproj
===================================================================
--- trunk/src/SwordReader_GUI/SwordReader_GUI.vcproj 2008-09-05 23:34:17 UTC (rev 171)
+++ trunk/src/SwordReader_GUI/SwordReader_GUI.vcproj 2008-09-06 03:37:36 UTC (rev 172)
@@ -908,6 +908,10 @@
>
</File>
<File
+ RelativePath=".\SRFramework\SRTabCtrl.cpp"
+ >
+ </File>
+ <File
RelativePath=".\SRFramework\SRWidget.cpp"
>
</File>
@@ -985,6 +989,10 @@
>
</File>
<File
+ RelativePath=".\SRFramework\SRTabCtrl.h"
+ >
+ </File>
+ <File
RelativePath=".\SRFramework\SRWidget.h"
>
</File>
More information about the sword-cvs
mailing list