5 Author: Misza (misza@ihug.com.au)
7 (C) 2002 OpenBeOS under MIT license
11 #include "DUNWindow.h"
12 TreeView::TreeView(BRect r
) : BView(r
,"miszaView",B_FOLLOW_TOP
,B_WILL_DRAW
)
17 void TreeView::MouseUp(BPoint point
)
18 { //controls what get resized and how
21 GetMouse(&where
, &buttons
);
28 if(!status
)//if view is hidden
33 ((DUNWindow
*)Window())->DoResizeMagic();
40 ((DUNWindow
*)Window())->DoResizeMagic();
44 void TreeView::MouseDown(BPoint point
)
46 SetMouseEventMask(B_POINTER_EVENTS
,B_LOCK_WINDOW_FOCUS
);
51 void TreeView::Draw(BRect updateRect
)
52 { //colours for drawing the triangle
55 SetLowColor(150,150,150);
56 if(status
&& !down
)//if view is showing
59 FillTriangle(BPoint(0,2),BPoint(8,2),BPoint(4,6),B_SOLID_LOW
);
60 StrokeTriangle(BPoint(0,2),BPoint(8,2),BPoint(4,6),B_SOLID_HIGH
);
62 else if (!status
&& !down
){
64 FillTriangle(BPoint(2,0),BPoint(2,8),BPoint(6,4),B_SOLID_LOW
);
65 StrokeTriangle(BPoint(2,0),BPoint(2,8),BPoint(6,4),B_SOLID_HIGH
);
70 SetLowColor(100,100,0);
71 FillTriangle(BPoint(0,6),BPoint(6,0),BPoint(6,6),B_SOLID_LOW
);
72 StrokeTriangle(BPoint(0,6),BPoint(6,0),BPoint(6,6),B_SOLID_HIGH
);
77 SetLowColor(150,150,150);
81 void TreeView::SetTreeViewStatus(bool condition
)