mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 00:54:40 +00:00
Updated with changes due to file manager and registry editor work.
svn path=/trunk/; revision=3208
This commit is contained in:
parent
0a8fa54c83
commit
8c8c369504
4 changed files with 92 additions and 119 deletions
|
@ -100,11 +100,9 @@ static void OnSize(ChildWnd* pChildWnd, WPARAM wParam, LPARAM lParam)
|
||||||
//
|
//
|
||||||
LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static int last_split;
|
static int last_split;
|
||||||
// Pane* pane;
|
ChildWnd* pChildWnd = (ChildWnd*)GetWindowLong(hWnd, GWL_USERDATA);
|
||||||
ChildWnd* pChildWnd = (ChildWnd*)GetWindowLong(hWnd, GWL_USERDATA);
|
ASSERT(pChildWnd);
|
||||||
// ChildWnd* new_child;
|
|
||||||
ASSERT(pChildWnd);
|
|
||||||
|
|
||||||
if (1) {
|
if (1) {
|
||||||
switch(message) {
|
switch(message) {
|
||||||
|
@ -141,112 +139,101 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
//goto def;
|
//goto def;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_LBUTTONDOWN: {
|
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;
|
RECT rt;
|
||||||
int x = LOWORD(lParam);
|
int x = LOWORD(lParam);
|
||||||
|
draw_splitbar(hWnd, last_split);
|
||||||
|
last_split = -1;
|
||||||
GetClientRect(hWnd, &rt);
|
GetClientRect(hWnd, &rt);
|
||||||
|
pChildWnd->nSplitPos = x;
|
||||||
if (x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
|
//resize_tree(pChildWnd, rt.right, rt.bottom);
|
||||||
last_split = pChildWnd->nSplitPos;
|
|
||||||
#ifdef _NO_EXTENSIONS
|
|
||||||
draw_splitbar(hWnd, last_split);
|
|
||||||
#endif
|
#endif
|
||||||
SetCapture(hWnd);
|
ReleaseCapture();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
break;}
|
#ifdef _NO_EXTENSIONS
|
||||||
|
case WM_CAPTURECHANGED:
|
||||||
case WM_LBUTTONUP:
|
if (GetCapture()==hWnd && last_split>=0)
|
||||||
|
draw_splitbar(hWnd, last_split);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
case WM_KEYDOWN:
|
||||||
|
if (wParam == VK_ESCAPE)
|
||||||
if (GetCapture() == hWnd) {
|
if (GetCapture() == hWnd) {
|
||||||
#ifdef _NO_EXTENSIONS
|
|
||||||
RECT rt;
|
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
|
#ifdef _NO_EXTENSIONS
|
||||||
case WM_CAPTURECHANGED:
|
|
||||||
if (GetCapture()==hWnd && last_split>=0)
|
|
||||||
draw_splitbar(hWnd, last_split);
|
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
|
#else
|
||||||
pChildWnd->nSplitPos = last_split;
|
pChildWnd->nSplitPos = last_split;
|
||||||
#endif
|
#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);
|
GetClientRect(hWnd, &rt);
|
||||||
|
//resize_tree(pChildWnd, rt.right, rt.bottom);
|
||||||
|
last_split = -1;
|
||||||
|
ReleaseCapture();
|
||||||
|
SetCursor(LoadCursor(0, IDC_ARROW));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
rt.left = last_split-SPLIT_WIDTH/2;
|
case WM_MOUSEMOVE:
|
||||||
rt.right = last_split+SPLIT_WIDTH/2+1;
|
if (GetCapture() == hWnd) {
|
||||||
InvertRect(hdc, &rt);
|
RECT rt;
|
||||||
|
int x = LOWORD(lParam);
|
||||||
last_split = x;
|
#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.left = x-SPLIT_WIDTH/2;
|
||||||
rt.right = x+SPLIT_WIDTH/2+1;
|
rt.right = x+SPLIT_WIDTH/2+1;
|
||||||
InvertRect(hdc, &rt);
|
InvalidateRect(hWnd, &rt, FALSE);
|
||||||
|
UpdateWindow(pChildWnd->left.hWnd);
|
||||||
ReleaseDC(hWnd, hdc);
|
UpdateWindow(hWnd);
|
||||||
#else
|
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;
|
#endif
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
#ifndef _NO_EXTENSIONS
|
#ifndef _NO_EXTENSIONS
|
||||||
case WM_GETMINMAXINFO:
|
case WM_GETMINMAXINFO:
|
||||||
DefMDIChildProc(hWnd, message, wParam, lParam);
|
DefMDIChildProc(hWnd, message, wParam, lParam);
|
||||||
|
{LPMINMAXINFO lpmmi = (LPMINMAXINFO)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
|
||||||
lpmmi->ptMaxTrackSize.x <<= 1;//2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN
|
break;}
|
||||||
lpmmi->ptMaxTrackSize.y <<= 1;//2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN
|
|
||||||
break;}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
SetCurrentDirectory(pChildWnd->szPath);
|
SetCurrentDirectory(pChildWnd->szPath);
|
||||||
SetFocus(pChildWnd->nFocusPanel? pChildWnd->hRightWnd: pChildWnd->hLeftWnd);
|
SetFocus(pChildWnd->nFocusPanel? pChildWnd->hRightWnd: pChildWnd->hLeftWnd);
|
||||||
break;
|
break;
|
||||||
/*
|
/*
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
pane = GetFocus()==pChildWnd->left.hWnd? &pChildWnd->left: &pChildWnd->right;
|
pane = GetFocus()==pChildWnd->left.hWnd? &pChildWnd->left: &pChildWnd->right;
|
||||||
|
@ -259,14 +246,13 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
if (wParam != SIZE_MINIMIZED) {
|
if (wParam != SIZE_MINIMIZED) {
|
||||||
OnSize(pChildWnd, wParam, lParam);
|
OnSize(pChildWnd, wParam, lParam);
|
||||||
}
|
|
||||||
// fall through
|
|
||||||
default: def:
|
|
||||||
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
|
||||||
}
|
}
|
||||||
}
|
// fall through
|
||||||
|
default: def:
|
||||||
|
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
||||||
|
}
|
||||||
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "about.h"
|
#include "about.h"
|
||||||
#include "framewnd.h"
|
#include "framewnd.h"
|
||||||
//#include "childwnd.h"
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -58,21 +58,9 @@ TCHAR szChildClass[MAX_LOADSTRING];
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
|
||||||
//
|
|
||||||
// FUNCTION: InitInstance(HANDLE, int)
|
|
||||||
//
|
|
||||||
// PURPOSE: Saves instance handle and creates main window
|
|
||||||
//
|
|
||||||
// COMMENTS:
|
|
||||||
//
|
|
||||||
// In this function, we save the instance handle in a global variable and
|
|
||||||
// create and display the main program window.
|
|
||||||
//
|
|
||||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||||
{
|
{
|
||||||
// ChildWnd* pChildWnd;
|
|
||||||
|
|
||||||
WNDCLASSEX wcFrame = {
|
WNDCLASSEX wcFrame = {
|
||||||
sizeof(WNDCLASSEX),
|
sizeof(WNDCLASSEX),
|
||||||
CS_HREDRAW | CS_VREDRAW/*style*/,
|
CS_HREDRAW | CS_VREDRAW/*style*/,
|
||||||
|
@ -190,6 +178,8 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void UpdateStatusBar(void)
|
void UpdateStatusBar(void)
|
||||||
{
|
{
|
||||||
TCHAR text[260];
|
TCHAR text[260];
|
||||||
|
@ -219,6 +209,7 @@ static BOOL CALLBACK EnumWndProc(HWND hWnd, LPARAM lParam)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void ExitInstance(void)
|
void ExitInstance(void)
|
||||||
{
|
{
|
||||||
|
@ -232,7 +223,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
|
||||||
int nCmdShow)
|
int nCmdShow)
|
||||||
{
|
{
|
||||||
MSG msg;
|
MSG msg;
|
||||||
HACCEL hAccel;
|
// HACCEL hAccel;
|
||||||
HWND hMDIClient;
|
HWND hMDIClient;
|
||||||
|
|
||||||
// Initialize global strings
|
// Initialize global strings
|
||||||
|
@ -252,13 +243,13 @@ int APIENTRY WinMain(HINSTANCE hInstance,
|
||||||
if (!InitInstance(hInstance, nCmdShow)) {
|
if (!InitInstance(hInstance, nCmdShow)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
hAccel = LoadAccelerators(hInstance, (LPCTSTR)IDC_MDI_APP);
|
// hAccel = LoadAccelerators(hInstance, (LPCTSTR)IDC_MDI_APP);
|
||||||
hMDIClient = GetWindow(hFrameWnd, GW_CHILD);
|
hMDIClient = GetWindow(hFrameWnd, GW_CHILD);
|
||||||
|
|
||||||
// Main message loop:
|
// Main message loop:
|
||||||
while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
|
while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
|
||||||
if (!TranslateMDISysAccel(hMDIClient, &msg) &&
|
if (!TranslateMDISysAccel(hMDIClient, &msg) &&
|
||||||
!TranslateAccelerator(hFrameWnd/*hwndFrame*/, hAccel, &msg)) {
|
!TranslateAccelerator(hFrameWnd, hAccel, &msg)) {
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
* Based on Winefile, Copyright 2000 martin Fuchs <martin-fuchs@gmx.net>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __MAIN_H__
|
#ifndef __MAIN_H__
|
||||||
#define __MAIN_H__
|
#define __MAIN_H__
|
||||||
|
|
Loading…
Reference in a new issue