mirror of
https://github.com/reactos/reactos.git
synced 2024-11-27 21:43:32 +08:00
[ROSAPPS] Add previously built templates back to build. Fix several warnings in dialog and mdi template. This should be it for rosapps stuff
svn path=/trunk/; revision=67435
This commit is contained in:
parent
b9f7c1566a
commit
6a5d0fedd8
@ -2,3 +2,4 @@ add_subdirectory(applications)
|
||||
add_subdirectory(demos)
|
||||
add_subdirectory(drivers)
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(templates)
|
||||
|
3
rosapps/templates/CMakeLists.txt
Normal file
3
rosapps/templates/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
add_subdirectory(dialog)
|
||||
add_subdirectory(mdi)
|
||||
add_subdirectory(old_wordpad)
|
14
rosapps/templates/dialog/CMakeLists.txt
Normal file
14
rosapps/templates/dialog/CMakeLists.txt
Normal file
@ -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)
|
@ -1,6 +1,6 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resrc1.h"
|
||||
// #include "resrc1.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -137,7 +137,7 @@ LRESULT CreateMemoryDialog(HINSTANCE hinst, HWND hwndOwner, LPSTR lpszMessage)
|
||||
*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
|
||||
|
11
rosapps/templates/mdi/CMakeLists.txt
Normal file
11
rosapps/templates/mdi/CMakeLists.txt
Normal file
@ -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)
|
@ -44,14 +44,14 @@
|
||||
|
||||
static void draw_splitbar(HWND hWnd, int x)
|
||||
{
|
||||
RECT rt;
|
||||
HDC hdc = GetDC(hWnd);
|
||||
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);
|
||||
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 OnPaint(HWND hWnd, ChildWnd* pChildWnd)
|
||||
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 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||
ChildWnd* pChildWnd = (ChildWnd*)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
ASSERT(pChildWnd);
|
||||
|
||||
if (1) {
|
||||
switch(message) {
|
||||
case WM_CREATE:
|
||||
return 0;
|
||||
switch(message) {
|
||||
case WM_CREATE:
|
||||
return 0;
|
||||
|
||||
case WM_MDIACTIVATE: // set an alternate menu here
|
||||
if (lParam == (LPARAM)hWnd) {
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
//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);
|
||||
draw_splitbar(hWnd, last_split);
|
||||
#endif
|
||||
SetCapture(hWnd);
|
||||
}
|
||||
break;}
|
||||
SetCapture(hWnd);
|
||||
}
|
||||
break;}
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
if (GetCapture() == hWnd) {
|
||||
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);
|
||||
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;
|
||||
ReleaseCapture();
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef _NO_EXTENSIONS
|
||||
case WM_CAPTURECHANGED:
|
||||
if (GetCapture()==hWnd && last_split>=0)
|
||||
draw_splitbar(hWnd, last_split);
|
||||
break;
|
||||
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;
|
||||
case WM_KEYDOWN:
|
||||
if (wParam == VK_ESCAPE)
|
||||
if (GetCapture() == hWnd) {
|
||||
RECT rt;
|
||||
#ifdef _NO_EXTENSIONS
|
||||
draw_splitbar(hWnd, last_split);
|
||||
draw_splitbar(hWnd, last_split);
|
||||
#else
|
||||
pChildWnd->nSplitPos = last_split;
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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;}
|
||||
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_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;
|
||||
}
|
||||
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;
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
@ -70,12 +70,12 @@ static void resize_frame_rect(HWND hWnd, PRECT prect)
|
||||
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)
|
||||
{
|
||||
|
@ -92,28 +92,27 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
};
|
||||
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),
|
||||
|
@ -33,7 +33,7 @@ extern "C" {
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
#include "../../lib/ros2win/ros2win.h"
|
||||
// #include "../../lib/ros2win/ros2win.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
13
rosapps/templates/old_wordpad/CMakeLists.txt
Normal file
13
rosapps/templates/old_wordpad/CMakeLists.txt
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user