Author: dreimer
Date: Sun Apr 26 13:06:35 2015
New Revision: 67435
URL:
http://svn.reactos.org/svn/reactos?rev=67435&view=rev
Log:
[ROSAPPS] Add previously built templates back to build. Fix several warnings in dialog and
mdi template. This should be it for rosapps stuff
Added:
trunk/rosapps/templates/CMakeLists.txt (with props)
trunk/rosapps/templates/dialog/CMakeLists.txt (with props)
trunk/rosapps/templates/mdi/CMakeLists.txt (with props)
trunk/rosapps/templates/old_wordpad/CMakeLists.txt (with props)
Modified:
trunk/rosapps/CMakeLists.txt
trunk/rosapps/templates/dialog/dialog.rc
trunk/rosapps/templates/dialog/memdlg.c
trunk/rosapps/templates/mdi/childwnd.c
trunk/rosapps/templates/mdi/framewnd.c
trunk/rosapps/templates/mdi/main.c
trunk/rosapps/templates/mdi/main.h
Modified: trunk/rosapps/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/CMakeLists.txt?rev=67435&a…
==============================================================================
--- trunk/rosapps/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rosapps/CMakeLists.txt [iso-8859-1] Sun Apr 26 13:06:35 2015
@@ -2,3 +2,4 @@
add_subdirectory(demos)
add_subdirectory(drivers)
add_subdirectory(lib)
+add_subdirectory(templates)
Added: trunk/rosapps/templates/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/CMakeLists.txt?r…
==============================================================================
--- trunk/rosapps/templates/CMakeLists.txt (added)
+++ trunk/rosapps/templates/CMakeLists.txt [iso-8859-1] Sun Apr 26 13:06:35 2015
@@ -0,0 +1,3 @@
+add_subdirectory(dialog)
+add_subdirectory(mdi)
+add_subdirectory(old_wordpad)
Propchange: trunk/rosapps/templates/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rosapps/templates/dialog/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/dialog/CMakeList…
==============================================================================
--- trunk/rosapps/templates/dialog/CMakeLists.txt (added)
+++ trunk/rosapps/templates/dialog/CMakeLists.txt [iso-8859-1] Sun Apr 26 13:06:35 2015
@@ -0,0 +1,14 @@
+
+list(APPEND SOURCE
+ dialog.c
+ memdlg.c
+ page1.c
+ page2.c
+ page3.c
+ trace.c)
+
+add_executable(template_dialog ${SOURCE} dialog.rc)
+set_module_type(template_dialog win32cui)
+add_target_compile_flags(template_dialog "-Wno-unused-but-set-variable")
+add_importlibs(template_dialog user32 gdi32 comctl32 msvcrt kernel32 ntdll)
+add_cd_file(TARGET template_dialog DESTINATION reactos/system32 FOR all)
Propchange: trunk/rosapps/templates/dialog/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rosapps/templates/dialog/dialog.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/dialog/dialog.rc…
==============================================================================
--- trunk/rosapps/templates/dialog/dialog.rc [iso-8859-1] (original)
+++ trunk/rosapps/templates/dialog/dialog.rc [iso-8859-1] Sun Apr 26 13:06:35 2015
@@ -1,6 +1,6 @@
//Microsoft Developer Studio generated resource script.
//
-#include "resrc1.h"
+// #include "resrc1.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
Modified: trunk/rosapps/templates/dialog/memdlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/dialog/memdlg.c?…
==============================================================================
--- trunk/rosapps/templates/dialog/memdlg.c [iso-8859-1] (original)
+++ trunk/rosapps/templates/dialog/memdlg.c [iso-8859-1] Sun Apr 26 13:06:35 2015
@@ -137,7 +137,7 @@
*lpw++ = 0x0082; // static class
for (lpwsz = (LPWSTR)lpw;
- *lpwsz++ = (WCHAR)*lpszMessage++;
+ *lpwsz++ == (WCHAR)*lpszMessage++;
);
lpw = (LPWORD)lpwsz;
lpw = lpwAlign(lpw); // align creation data on DWORD boundary
Added: trunk/rosapps/templates/mdi/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/mdi/CMakeLists.t…
==============================================================================
--- trunk/rosapps/templates/mdi/CMakeLists.txt (added)
+++ trunk/rosapps/templates/mdi/CMakeLists.txt [iso-8859-1] Sun Apr 26 13:06:35 2015
@@ -0,0 +1,11 @@
+
+list(APPEND SOURCE
+ about.c
+ framewnd.c
+ childwnd.c
+ main.c)
+
+add_executable(template_mdi ${SOURCE} mdi.rc)
+set_module_type(template_mdi win32cui)
+add_importlibs(template_mdi advapi32 user32 gdi32 comctl32 msvcrt kernel32 ntdll)
+add_cd_file(TARGET template_mdi DESTINATION reactos/system32 FOR all)
Propchange: trunk/rosapps/templates/mdi/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rosapps/templates/mdi/childwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/mdi/childwnd.c?r…
==============================================================================
--- trunk/rosapps/templates/mdi/childwnd.c [iso-8859-1] (original)
+++ trunk/rosapps/templates/mdi/childwnd.c [iso-8859-1] Sun Apr 26 13:06:35 2015
@@ -44,14 +44,14 @@
static void draw_splitbar(HWND hWnd, int x)
{
- RECT rt;
- HDC hdc = GetDC(hWnd);
-
- GetClientRect(hWnd, &rt);
- rt.left = x - SPLIT_WIDTH/2;
- rt.right = x + SPLIT_WIDTH/2+1;
- InvertRect(hdc, &rt);
- ReleaseDC(hWnd, hdc);
+ RECT rt;
+ HDC hdc = GetDC(hWnd);
+
+ GetClientRect(hWnd, &rt);
+ rt.left = x - SPLIT_WIDTH/2;
+ rt.right = x + SPLIT_WIDTH/2+1;
+ InvertRect(hdc, &rt);
+ ReleaseDC(hWnd, hdc);
}
static void OnPaint(HWND hWnd, ChildWnd* pChildWnd)
@@ -84,7 +84,7 @@
static void OnSize(ChildWnd* pChildWnd, WPARAM wParam, LPARAM lParam)
{
if (wParam != SIZE_MINIMIZED) {
- //resize_tree(pChildWnd, LOWORD(lParam), HIWORD(lParam));
+ //resize_tree(pChildWnd, LOWORD(lParam), HIWORD(lParam));
}
}
@@ -104,155 +104,154 @@
ChildWnd* pChildWnd = (ChildWnd*)GetWindowLong(hWnd, GWL_USERDATA);
ASSERT(pChildWnd);
- if (1) {
- switch(message) {
- case WM_CREATE:
+ switch(message) {
+ case WM_CREATE:
+ return 0;
+
+ case WM_MDIACTIVATE: // set an alternate menu here
+ if (lParam == (LPARAM)hWnd) {
+ } else {
+ }
+ DrawMenuBar(hFrameWnd);
+ // return 0;
+ break;
+
+ case WM_PAINT:
+ OnPaint(hWnd, pChildWnd);
+ return 0;
+
+ case WM_NCDESTROY:
+ // SetWindowLong(hWnd, GWL_USERDATA, 0);
+ break;
+
+ case WM_SETCURSOR:
+ if (LOWORD(lParam) == HTCLIENT) {
+ POINT pt;
+ GetCursorPos(&pt);
+ ScreenToClient(hWnd, &pt);
+
+ if (pt.x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 &&
pt.x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
+ SetCursor(LoadCursor(0, IDC_SIZEWE));
+ return TRUE;
+ }
+ }
+ //goto def;
+ break;
+
+ case WM_LBUTTONDOWN: {
+ RECT rt;
+ int x = LOWORD(lParam);
+ GetClientRect(hWnd, &rt);
+ if (x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 &&
x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
+ last_split = pChildWnd->nSplitPos;
+#ifdef _NO_EXTENSIONS
+ draw_splitbar(hWnd, last_split);
+#endif
+ SetCapture(hWnd);
+ }
+ break;}
+
+ case WM_LBUTTONUP:
+ if (GetCapture() == hWnd) {
+#ifdef _NO_EXTENSIONS
+ RECT rt;
+ int x = LOWORD(lParam);
+ draw_splitbar(hWnd, last_split);
+ last_split = -1;
+ GetClientRect(hWnd, &rt);
+ pChildWnd->nSplitPos = x;
+ //resize_tree(pChildWnd, rt.right, rt.bottom);
+#endif
+ ReleaseCapture();
+ }
+ break;
+
+#ifdef _NO_EXTENSIONS
+ case WM_CAPTURECHANGED:
+ if (GetCapture()==hWnd && last_split>=0)
+ draw_splitbar(hWnd, last_split);
+ break;
+#endif
+ case WM_KEYDOWN:
+ if (wParam == VK_ESCAPE)
+ if (GetCapture() == hWnd) {
+ RECT rt;
+#ifdef _NO_EXTENSIONS
+ draw_splitbar(hWnd, last_split);
+#else
+ pChildWnd->nSplitPos = last_split;
+#endif
+ GetClientRect(hWnd, &rt);
+ //resize_tree(pChildWnd, rt.right, rt.bottom);
+ last_split = -1;
+ ReleaseCapture();
+ SetCursor(LoadCursor(0, IDC_ARROW));
+ }
+ break;
+
+ case WM_MOUSEMOVE:
+ if (GetCapture() == hWnd) {
+ RECT rt;
+ int x = LOWORD(lParam);
+#ifdef _NO_EXTENSIONS
+ HDC hdc = GetDC(hWnd);
+ GetClientRect(hWnd, &rt);
+ rt.left = last_split-SPLIT_WIDTH/2;
+ rt.right = last_split+SPLIT_WIDTH/2+1;
+ InvertRect(hdc, &rt);
+ last_split = x;
+ rt.left = x-SPLIT_WIDTH/2;
+ rt.right = x+SPLIT_WIDTH/2+1;
+ InvertRect(hdc, &rt);
+ ReleaseDC(hWnd, hdc);
+#else
+ GetClientRect(hWnd, &rt);
+ if (x>=0 && x<rt.right) {
+ pChildWnd->nSplitPos = x;
+ resize_tree(pChildWnd, rt.right, rt.bottom);
+ rt.left = x-SPLIT_WIDTH/2;
+ rt.right = x+SPLIT_WIDTH/2+1;
+ InvalidateRect(hWnd, &rt, FALSE);
+ UpdateWindow(pChildWnd->left.hWnd);
+ UpdateWindow(hWnd);
+ UpdateWindow(pChildWnd->right.hWnd);
+ }
+#endif
+ }
+ break;
+
+#ifndef _NO_EXTENSIONS
+ case WM_GETMINMAXINFO:
+ DefMDIChildProc(hWnd, message, wParam, lParam);
+ {LPMINMAXINFO lpmmi = (LPMINMAXINFO)lParam;
+ lpmmi->ptMaxTrackSize.x <<= 1;//2*GetSystemMetrics(SM_CXSCREEN) /
SM_CXVIRTUALSCREEN
+ lpmmi->ptMaxTrackSize.y <<= 1;//2*GetSystemMetrics(SM_CYSCREEN) /
SM_CYVIRTUALSCREEN
+ break;}
+#endif
+
+ case WM_SETFOCUS:
+ SetCurrentDirectory(pChildWnd->szPath);
+ SetFocus(pChildWnd->nFocusPanel? pChildWnd->hRightWnd:
pChildWnd->hLeftWnd);
+ break;
+/*
+ case WM_COMMAND:
+ pane = GetFocus()==pChildWnd->left.hWnd? &pChildWnd->left:
&pChildWnd->right;
+ switch(LOWORD(wParam)) {
+ case ID_WINDOW_NEW_WINDOW:
return 0;
-
- case WM_MDIACTIVATE: // set an alternate menu here
- if (lParam == (LPARAM)hWnd) {
- } else {
- }
- DrawMenuBar(hFrameWnd);
-// return 0;
+ default:
+ return pane_command(pane, LOWORD(wParam));
break;
-
- case WM_PAINT:
- OnPaint(hWnd, pChildWnd);
- return 0;
-
- case WM_NCDESTROY:
- //SetWindowLong(hWnd, GWL_USERDATA, 0);
- break;
-
- case WM_SETCURSOR:
- if (LOWORD(lParam) == HTCLIENT) {
- POINT pt;
- GetCursorPos(&pt);
- ScreenToClient(hWnd, &pt);
-
- if (pt.x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 &&
pt.x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
- SetCursor(LoadCursor(0, IDC_SIZEWE));
- return TRUE;
- }
- }
- //goto def;
- break;
-
- case WM_LBUTTONDOWN: {
- RECT rt;
- int x = LOWORD(lParam);
- GetClientRect(hWnd, &rt);
- if (x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 &&
x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
- last_split = pChildWnd->nSplitPos;
-#ifdef _NO_EXTENSIONS
- draw_splitbar(hWnd, last_split);
-#endif
- SetCapture(hWnd);
- }
- break;}
-
- case WM_LBUTTONUP:
- if (GetCapture() == hWnd) {
-#ifdef _NO_EXTENSIONS
- RECT rt;
- int x = LOWORD(lParam);
- draw_splitbar(hWnd, last_split);
- last_split = -1;
- GetClientRect(hWnd, &rt);
- pChildWnd->nSplitPos = x;
- //resize_tree(pChildWnd, rt.right, rt.bottom);
-#endif
- ReleaseCapture();
- }
- break;
-
-#ifdef _NO_EXTENSIONS
- case WM_CAPTURECHANGED:
- if (GetCapture()==hWnd && last_split>=0)
- draw_splitbar(hWnd, last_split);
- break;
-#endif
- case WM_KEYDOWN:
- if (wParam == VK_ESCAPE)
- if (GetCapture() == hWnd) {
- RECT rt;
-#ifdef _NO_EXTENSIONS
- draw_splitbar(hWnd, last_split);
-#else
- pChildWnd->nSplitPos = last_split;
-#endif
- GetClientRect(hWnd, &rt);
- //resize_tree(pChildWnd, rt.right, rt.bottom);
- last_split = -1;
- ReleaseCapture();
- SetCursor(LoadCursor(0, IDC_ARROW));
- }
- break;
-
- case WM_MOUSEMOVE:
- if (GetCapture() == hWnd) {
- RECT rt;
- int x = LOWORD(lParam);
-#ifdef _NO_EXTENSIONS
- HDC hdc = GetDC(hWnd);
- GetClientRect(hWnd, &rt);
- rt.left = last_split-SPLIT_WIDTH/2;
- rt.right = last_split+SPLIT_WIDTH/2+1;
- InvertRect(hdc, &rt);
- last_split = x;
- rt.left = x-SPLIT_WIDTH/2;
- rt.right = x+SPLIT_WIDTH/2+1;
- InvertRect(hdc, &rt);
- ReleaseDC(hWnd, hdc);
-#else
- GetClientRect(hWnd, &rt);
- if (x>=0 && x<rt.right) {
- pChildWnd->nSplitPos = x;
- resize_tree(pChildWnd, rt.right, rt.bottom);
- rt.left = x-SPLIT_WIDTH/2;
- rt.right = x+SPLIT_WIDTH/2+1;
- InvalidateRect(hWnd, &rt, FALSE);
- UpdateWindow(pChildWnd->left.hWnd);
- UpdateWindow(hWnd);
- UpdateWindow(pChildWnd->right.hWnd);
- }
-#endif
- }
- break;
-
-#ifndef _NO_EXTENSIONS
- case WM_GETMINMAXINFO:
- DefMDIChildProc(hWnd, message, wParam, lParam);
- {LPMINMAXINFO lpmmi = (LPMINMAXINFO)lParam;
- lpmmi->ptMaxTrackSize.x <<= 1;//2*GetSystemMetrics(SM_CXSCREEN) /
SM_CXVIRTUALSCREEN
- lpmmi->ptMaxTrackSize.y <<= 1;//2*GetSystemMetrics(SM_CYSCREEN) /
SM_CYVIRTUALSCREEN
- break;}
-#endif
-
- case WM_SETFOCUS:
- SetCurrentDirectory(pChildWnd->szPath);
- SetFocus(pChildWnd->nFocusPanel? pChildWnd->hRightWnd: pChildWnd->hLeftWnd);
- break;
-/*
- case WM_COMMAND:
- pane = GetFocus()==pChildWnd->left.hWnd? &pChildWnd->left:
&pChildWnd->right;
- switch(LOWORD(wParam)) {
- case ID_WINDOW_NEW_WINDOW:
- return 0;
- default:
- return pane_command(pane, LOWORD(wParam));
- break;
- }
- break;
+ }
+ break;
*/
- case WM_SIZE:
+ case WM_SIZE:
if (wParam != SIZE_MINIMIZED) {
OnSize(pChildWnd, wParam, lParam);
}
// fall through
- default: def:
+ // default: def:
return DefMDIChildProc(hWnd, message, wParam, lParam);
- }
+ }
return DefMDIChildProc(hWnd, message, wParam, lParam);
}
Modified: trunk/rosapps/templates/mdi/framewnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/mdi/framewnd.c?r…
==============================================================================
--- trunk/rosapps/templates/mdi/framewnd.c [iso-8859-1] (original)
+++ trunk/rosapps/templates/mdi/framewnd.c [iso-8859-1] Sun Apr 26 13:06:35 2015
@@ -70,12 +70,12 @@
MoveWindow(hMDIClient,
prect->left-1,prect->top-1,prect->right+2,prect->bottom+1, TRUE);
}
-static void resize_frame(HWND hWnd, int cx, int cy)
+/* static void resize_frame(HWND hWnd, int cx, int cy)
{
RECT rect = {0, 0, cx, cy};
resize_frame_rect(hWnd, &rect);
-}
+}*/
void resize_frame_client(HWND hWnd)
{
Modified: trunk/rosapps/templates/mdi/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/mdi/main.c?rev=6…
==============================================================================
--- trunk/rosapps/templates/mdi/main.c [iso-8859-1] (original)
+++ trunk/rosapps/templates/mdi/main.c [iso-8859-1] Sun Apr 26 13:06:35 2015
@@ -92,28 +92,27 @@
};
ATOM hChildWndClass = RegisterClass(&wcChild); // register child windows class
#else
- WNDCLASSEX wcChild = {
- sizeof(WNDCLASSEX),
- CS_HREDRAW | CS_VREDRAW/*style*/,
- ChildWndProc,
- 0/*cbClsExtra*/,
- sizeof(HANDLE)/*cbWndExtra*/,
- hInstance,
- LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MDI_APP)),
- LoadCursor(0, IDC_ARROW),
- 0/*hbrBackground*/,
- 0/*lpszMenuName*/,
- szChildClass,
- (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDC_MDI_APP), IMAGE_ICON,
- GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED)
-
- };
- ATOM hChildWndClass = RegisterClassEx(&wcChild); // register child windows class
+ // WNDCLASSEX wcChild = {
+ // sizeof(WNDCLASSEX),
+ // CS_HREDRAW | CS_VREDRAW/*style*/,
+ // ChildWndProc,
+ // 0/*cbClsExtra*/,
+ // sizeof(HANDLE)/*cbWndExtra*/,
+ // hInstance,
+ // LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MDI_APP)),
+ // LoadCursor(0, IDC_ARROW),
+ // 0/*hbrBackground*/,
+ // 0/*lpszMenuName*/,
+ // szChildClass,
+ // (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDC_MDI_APP), IMAGE_ICON,
+ // GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED)
+ // };
+ // ATOM hChildWndClass = RegisterClassEx(&wcChild); // register child windows
class
#endif
HMENU hMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDC_MDI_APP));
HMENU hMenuOptions = GetSubMenu(hMenu, ID_OPTIONS_MENU);
- HMENU hChildMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDC_MDI_APP_CHILD));
+ // HMENU hChildMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDC_MDI_APP_CHILD));
INITCOMMONCONTROLSEX icc = {
sizeof(INITCOMMONCONTROLSEX),
Modified: trunk/rosapps/templates/mdi/main.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/mdi/main.h?rev=6…
==============================================================================
--- trunk/rosapps/templates/mdi/main.h [iso-8859-1] (original)
+++ trunk/rosapps/templates/mdi/main.h [iso-8859-1] Sun Apr 26 13:06:35 2015
@@ -33,7 +33,7 @@
#include "resource.h"
-#include "../../lib/ros2win/ros2win.h"
+// #include "../../lib/ros2win/ros2win.h"
////////////////////////////////////////////////////////////////////////////////
Added: trunk/rosapps/templates/old_wordpad/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/old_wordpad/CMak…
==============================================================================
--- trunk/rosapps/templates/old_wordpad/CMakeLists.txt (added)
+++ trunk/rosapps/templates/old_wordpad/CMakeLists.txt [iso-8859-1] Sun Apr 26 13:06:35
2015
@@ -0,0 +1,13 @@
+
+list(APPEND SOURCE
+ dialogs.c
+ editwnd.c
+ mainwnd.c
+ misc.c
+ opensave.c
+ wordpad.c)
+
+add_executable(old_wordpad ${SOURCE} wordpad.rc)
+set_module_type(old_wordpad win32gui UNICODE)
+add_importlibs(old_wordpad user32 gdi32 comdlg32 advapi32 shell32 comctl32 msvcrt
kernel32 ntdll)
+add_cd_file(TARGET old_wordpad DESTINATION reactos/system32 FOR all)
Propchange: trunk/rosapps/templates/old_wordpad/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native