1 /*
2  *  ReactOS Application
3  *
4  *  panelwnd.c
5  *
6  *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */
22 
23 #ifdef _MSC_VER
24 #include "stdafx.h"
25 #else
26 #define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
27 #include <windows.h>
28 #include <commctrl.h>
29 #include <stdlib.h>
30 #include <malloc.h>
31 #include <memory.h>
32 #include <tchar.h>
33 #include <process.h>
34 #include <stdio.h>
35 #endif
36 
37 #include <assert.h>
38 #define ASSERT assert
39 
40 #include "main.h"
41 #include "panelwnd.h"
42 
43 ////////////////////////////////////////////////////////////////////////////////
44 
45 static void OnPaint(HWND hWnd, ChildWnd* pChildWnd)
46 {
47     PAINTSTRUCT ps;
48     RECT rt;
49     GetClientRect(hWnd, &rt);
50     BeginPaint(hWnd, &ps);
51 
52 //    lastBrush = SelectObject(ps.hdc, (HBRUSH)GetStockObject(WHITE_BRUSH));
53 //    Rectangle(ps.hdc, rt.left, rt.top-1, rt.right, rt.bottom+1);
54 //    SelectObject(ps.hdc, lastBrush);
55 //    rt.top = rt.bottom - GetSystemMetrics(SM_CYHSCROLL);
56     FillRect(ps.hdc, &rt, GetStockObject(BLACK_BRUSH));
57 /*
58     rt.left = pChildWnd->nSplitPos-SPLIT_WIDTH/2;
59     rt.right = pChildWnd->nSplitPos+SPLIT_WIDTH/2+1;
60     lastBrush = SelectBrush(ps.hdc, (HBRUSH)GetStockObject(COLOR_SPLITBAR));
61     Rectangle(ps.hdc, rt.left, rt.top-1, rt.right, rt.bottom+1);
62     SelectObject(ps.hdc, lastBrush);
63 #ifdef _NO_EXTENSIONS
64     rt.top = rt.bottom - GetSystemMetrics(SM_CYHSCROLL);
65     FillRect(ps.hdc, &rt, GetStockObject(BLACK_BRUSH));
66 #endif
67  */
68     EndPaint(hWnd, &ps);
69 }
70 
71 
72 //
73 //  FUNCTION: ChildWndProc(HWND, unsigned, WORD, LONG)
74 //
75 //  PURPOSE:  Processes messages for the pChildWnd windows.
76 //
77 //  WM_COMMAND  - process the application menu
78 //  WM_PAINT    - Paint the main window
79 //  WM_DESTROY  - post a quit message and return
80 //
81 //
82 LRESULT CALLBACK PanelWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
83 {
84 //  Pane* pane;
85 //  ChildWnd* pChildWnd = (ChildWnd*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
86 //  ChildWnd* new_child;
87 //  ASSERT(pChildWnd);
88 
89     if (1) {
90         switch(message) {
91         case WM_CREATE:
92             break;
93         case WM_PAINT:
94             OnPaint(hWnd, 0/*pChildWnd*/);
95             break;
96 /*
97         case WM_COMMAND:
98             pane = GetFocus()==pChildWnd->left.hWnd? &pChildWnd->left: &pChildWnd->right;
99             switch(LOWORD(wParam)) {
100             case ID_WINDOW_NEW_WINDOW:
101                 break;
102             default:
103                 return pane_command(pane, LOWORD(wParam));
104             }
105             break;
106  */
107         default:
108             return DefWindowProc(hWnd, message, wParam, lParam);
109         }
110     }
111     return 0;
112 }
113