1 #ifndef __BF_GUI_FUNC_H__
2 #define __BF_GUI_FUNC_H__
3
4 #include <View.h>
5 #include <Window.h>
6 #include "BL_Tools.h"
7 #include "BF_GUI_TopMenu.h"
8 #include "BF_Node.h"
9
10
11 #define BF_PANEL_WINPOS_LEFT true
12 #define BF_PANEL_WINPOS_RIGHT false
13
14 class BF_GUI_Panel:public BView{
15 public:
16 bool bWinPos_OnLeft;
17
18 BF_GUI_Panel(
19 const BRect& o_Rect,
20 const char* pc_FirstName,
21 bool b_WinPos_OnLeft);
22
23 ~BF_GUI_Panel();
24
25
26
27 virtual void MouseDown(BPoint point);
28 virtual void MouseUp(BPoint point);
29 virtual void KeyDown(const char *bytes, int32 numBytes);
30 virtual void Draw(BRect o_Rect);
31
32 void Enable(bool b_Enable);
33 bool Enabled();
34 bool Close();
35
36 void Run_TopMenu();
37
38 virtual void MakeFocus(bool focused = true);
39
40 float HeaderHeight();
41 float BottomHeight();
42 BRect BottomRect();
43
44 void SetHeader(const char *pc_Header,BBitmap * po_SIcon=NULL);
45
46 void DrawBackground(const BRect & o_Rect) const;
47 void Draw_OpenTransaction();
48 void Draw_CloseTransaction(BRect * po_RectDest=NULL);
49 void DrawStringCheck(const char *pc_Text,float f_Width,BPoint & o_Point,BFont *po_Font=NULL);
50
51 void SayFriend_About_CursorChanged( const char *pc_NodePath,
52 const char *pc_NodeName,
53 int i_NodeType);
54
55
56 virtual void Nodes_GetAll(BF_NodeList& lo_ResultNode,bool b_ReqIcons);
57 virtual void Nodes_SetSelectingByName( BF_NodeList* plo_ReqNode,uint i_SelAction,bool b_ReqUpdate=true);
58
59
60
61 virtual void StoreVars(BF_GUI_Setup_Vars_Panel & o_Setup) const;
62
63 virtual void MessageReceived(BMessage* po_Message);
64 virtual void FrameResized(float width, float height);
65
66 virtual bool OnMouseDown(BPoint & o_Point);
67 virtual bool OnMouseUp(BPoint & o_Point);
68
69 virtual bool OnKeyDown(const char *bytes, int32 numBytes);
70 virtual bool OnBeforeKeyDown(const char *bytes, int32 numBytes);
71
72 virtual void DrawPanel(BRect & o_Rect);
73
74 virtual void NavPressInHeader(const BPoint & o_Point);
75
76
77 virtual bool OnClose();
78 virtual void OnEnable(bool b_Enable);
79 virtual void OnFocus(bool b_Focused);
80
81 virtual BRect ClientRect();
82
83 virtual void DrawHeader(bool b_IsFocus);
84 virtual void DrawBottom(const char *pc_Text,bool b_DrawBack);
85
86 virtual void PrepareKeysMenu();
87 virtual void PrepareCmdLine();
88 virtual void PrepareTopMenuItem(BF_GUI_TopMenu_HItem *po_HItem);
89
90 virtual const BL_String Path()const;
91
92 virtual void ActionCopyFrom_Run(BL_String & s_Path,BF_NodeCollection & lo_Node,bool b_Move);
93 virtual void Action_CopyToBuffer(){};
94 virtual void Action_PasteFromBuffer(){};
95 virtual void Action_Friend_NewCursor(const char *pc_NodePath,const char *pc_NodeName,int32 i_NodeType){};
96
97 virtual void SetupUpdated();
98
99
100
101 private:
102 int32 iDisableCount;
103 int32 iRenderDeep;
104
105 public:
106 bool bFixedFocus,bNeedUpdateAfterEnable;
107 BL_String sHeader;
108 BBitmap *poHeaderSIcon;
109
110 protected:
111 BView *poRender;
112 BBitmap *poRenderBitmap;
113
114 int32 RenderDeep()const {return iRenderDeep;} ;
115
116 };
117
118
119 void
120 BF_GUI_Func_PanelsEnable(bool b_Enable,bool b_OperRosterAlso=true);
121
122 void
123 BF_GUI_Func_PanelsShow(bool b_Show);
124
125 void
126 BF_GUI_Func_RedrawDialogs();
127
128 bool
129 BF_GUI_Func_EnableDialog(const char *pc_Name,bool b_Enable);
130
131 void
132 BF_GUI_Func_CloseDialog(BView *po_Dialog);
133
134 bool
135 BF_GUI_Func_AddChildToMainView(BView *po_View);
136
137 void
138 BF_GUI_MakeFocusTo(BView *po_View);
139