/**********************************************************

	treev.h				(C) T. Arai  1994

 *********************************************************/


#ifndef _APPLICATIONVIEW
#include <sol\appview.h>
#endif
#ifndef _DC
#include <sol\dc.h>
#endif
#ifndef _FILEDIALOG
#include <sol\filedlg.h>
#endif
#ifndef _DRAWABLETREE
#include <sol\drawtree.h>
#endif

#ifndef _FONT
#include <sol\font.h>
#endif

#ifndef _TREEVIEWER
#define _TREEVIEWER

class TreeViewer :public ApplicationView {
	Font*		  font;
	int	          range;
	DrawableTree* tree;
	FileDialog*   fileSelector;
  protected:
	void	      BuildName(DrawableNode* node, char* delim, 
				char* buffer, int len);
	FileDialog*   GetFileSelector();
	virtual long  LeftButtonDown(Event* event);
	virtual long  LeftButtonDoubleClick(Event* event);
	void 	      Load(Action* action);
	long 	      Paint(Event* event);
	long		  Size(Event* event);
	DrawableNode* Search(int x, int y);
	void 	      SetTree(DrawableTree* tree1);
	void 	      SetTreeScrollRange(DC* dev);
	void	      Open(Action* action);
  public:
	TreeViewer(Application* applet, char* caption, Args* args);
	~TreeViewer();
        DrawableTree* GetTree() { return tree; }
};

#endif
