Minor mod.

svn path=/trunk/; revision=3234
This commit is contained in:
Robert Dickenson 2002-07-15 20:02:06 +00:00
parent 2f8748afe5
commit a4ae51d977

View file

@ -34,8 +34,6 @@
#include <stdio.h> #include <stdio.h>
#endif #endif
#include <shellapi.h>
//#include <winspool.h>
#include <windowsx.h> #include <windowsx.h>
#include <shellapi.h> #include <shellapi.h>
#include <ctype.h> #include <ctype.h>
@ -153,10 +151,6 @@ static void init_output(HWND hWnd)
HTREEITEM AddEntryToTree(HWND hwndTV, Entry* entry) HTREEITEM AddEntryToTree(HWND hwndTV, Entry* entry)
{ {
HTREEITEM hItem = 0; HTREEITEM hItem = 0;
#if 0
hItem = AddItemToTree(hwndTV, entry->data.cFileName, entry->level);
#else
//HTREEITEM AddItemToTree(HWND hwndTV, LPTSTR lpszItem, int nLevel)
TVITEM tvi; TVITEM tvi;
TVINSERTSTRUCT tvins; TVINSERTSTRUCT tvins;
static HTREEITEM hPrev = (HTREEITEM)TVI_FIRST; static HTREEITEM hPrev = (HTREEITEM)TVI_FIRST;
@ -222,7 +216,6 @@ HTREEITEM AddEntryToTree(HWND hwndTV, Entry* entry)
} }
*/ */
hItem = hPrev; hItem = hPrev;
#endif
return hItem; return hItem;
} }
@ -322,31 +315,6 @@ static BOOL InitTreeViewImageLists(HWND hwndTV)
return TRUE; return TRUE;
} }
// CreateTreeView - creates a tree view control.
// Returns the handle to the new control if successful,
// or NULL otherwise.
// hwndParent - handle to the control's parent window.
static HWND CreateTreeView(HWND hwndParent, int id)
{
RECT rcClient; // dimensions of client area
HWND hwndTV; // handle to tree view control
// Get the dimensions of the parent window's client area, and create
// the tree view control.
GetClientRect(hwndParent, &rcClient);
hwndTV = CreateWindowEx(0, WC_TREEVIEW, _T("Tree View"),
WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
0, 0, rcClient.right, rcClient.bottom,
hwndParent, (HMENU)id, hInst, NULL);
// Initialize the image list, and add items to the control.
if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV)) {
DestroyWindow(hwndTV);
return NULL;
}
return hwndTV;
}
#ifndef _MSC_VER #ifndef _MSC_VER
#define NMTVDISPINFO TV_DISPINFO #define NMTVDISPINFO TV_DISPINFO
#define NMTVDISPINFO TV_DISPINFO #define NMTVDISPINFO TV_DISPINFO
@ -433,7 +401,6 @@ static BOOL OnExpanding(HWND hWnd, NMTREEVIEW* pnmtv)
{ {
static int expanding; static int expanding;
//LPARAM parm = pnmtv->itemNew.lParam;
Entry* entry = (Entry*)pnmtv->itemNew.lParam; Entry* entry = (Entry*)pnmtv->itemNew.lParam;
TRACE(_T("TreeWndProc(...) OnExpanding() entry: %p\n"), entry); TRACE(_T("TreeWndProc(...) OnExpanding() entry: %p\n"), entry);
@ -483,7 +450,7 @@ static LRESULT CALLBACK TreeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
case TVN_ITEMEXPANDING: case TVN_ITEMEXPANDING:
return OnExpanding(hWnd, (NMTREEVIEW*)lParam); return OnExpanding(hWnd, (NMTREEVIEW*)lParam);
break; break;
// case TVN_SELCHANGED: case TVN_SELCHANGED:
// return OnSelChanged((NMTREEVIEW*)lParam); // return OnSelChanged((NMTREEVIEW*)lParam);
// break; // break;
#if 0 #if 0
@ -516,6 +483,31 @@ static LRESULT CALLBACK TreeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
return CallWindowProc(g_orgTreeWndProc, hWnd, message, wParam, lParam); return CallWindowProc(g_orgTreeWndProc, hWnd, message, wParam, lParam);
} }
// CreateTreeView - creates a tree view control.
// Returns the handle to the new control if successful,
// or NULL otherwise.
// hwndParent - handle to the control's parent window.
static HWND CreateTreeView(HWND hwndParent, int id)
{
RECT rcClient; // dimensions of client area
HWND hwndTV; // handle to tree view control
// Get the dimensions of the parent window's client area, and create
// the tree view control.
GetClientRect(hwndParent, &rcClient);
hwndTV = CreateWindowEx(0, WC_TREEVIEW, _T("Tree View"),
WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
0, 0, rcClient.right, rcClient.bottom,
hwndParent, (HMENU)id, hInst, NULL);
// Initialize the image list, and add items to the control.
if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV)) {
DestroyWindow(hwndTV);
return NULL;
}
return hwndTV;
}
//void create_tree_window(HWND parent, Pane* pane, int id, int id_header, LPTSTR lpszFileName) //void create_tree_window(HWND parent, Pane* pane, int id, int id_header, LPTSTR lpszFileName)
void CreateTreeWnd(HWND parent, Pane* pane, int id) void CreateTreeWnd(HWND parent, Pane* pane, int id)
{ {