#ifndef TREE_WINDOW_CLASS
#define TREE_WINDOW_CLASS

/*****************************************************************************\
*                                                                             *
*  Name   : tree_window                                                       *
*  Author : Chris Koeritz                                                     *
*                                                                             *
*  Purpose:                                                                   *
*                                                                             *
*    Implements a window that manages the tree control for navigation in      *
*  an explorer style application.                                             *
*                                                                             *
*******************************************************************************
* Copyright (c) 1998-$now By Author.  This program is free software; you can  *
* redistribute it and/or modify it under the terms of the GNU General Public  *
* License as published by the Free Software Foundation; either version 2 of   *
* the License or (at your option) any later version.  This is online at:      *
*     http://www.fsf.org/copyleft/gpl.html                                    *
* Please send any updates to: fred@gruntose.com                               *
\*****************************************************************************/

#include "mfc_dll.h"

#include <basis/portable.h>
#include <mrc_ext/mrcext.h>

// forward.
class bitmap_tree;
class derived_bitmap_tree;
class visual_tree_node;

//hmmm: move more cool stuff from name_tree into here.

class MFC_EXTENSIONS_CLASS_STYLE tree_window : public CMRCSizeControlBar
{
public:
  tree_window();
  virtual ~tree_window();

  bitmap_tree &tree_control();
    // allows access to the tree control embedded here.

  // handlers for click events can be over-ridden.  the base class does
  // nothing with these.
  virtual void handle_right_click() {}
  virtual void handle_double_click() {}

protected:
  DECLARE_MESSAGE_MAP()
  void OnClose();  // override shutdown to whack tree nodes.
  static CRect initial_window();  // returns a default window size.
  virtual BOOL Create(CWnd * pParent, LPCTSTR lpszTitle, UINT nID = 1,
          DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM,
          const RECT &rect = initial_window());
  void OnSizedOrDocked(int cx, int cy, BOOL bFloating, int flags);
    // manages resizing the tree within the outer control.
  void OnContextMenu(CWnd* pWnd, CPoint point);

private:
  derived_bitmap_tree *_tree_control;   // our tree control child window.
};

#endif

