Changed file format to include dependency table.
[ttodo.git] / frame.cc
blob94a57985c5c40b4a7e023264641842cc1a8f6a6e
1 // Copyright (c) 2006 by Mike Sharov <msharov@users.sourceforge.net>
2 //
3 // frame.cc
4 //
6 #include "frame.h"
7 #include <unistd.h>
9 /// Default constructor.
10 CTodoFrame::CTodoFrame (void)
11 : CWindow (),
12 m_Doc ()
14 AddChild (new CTodoList);
15 AddChild (new CEntryEditDialog);
16 assert (pane_Last == Children().size());
19 /// Creates all child windows.
20 void CTodoFrame::OnCreate (void)
22 CWindow::OnCreate();
23 m_Doc.RegisterView (this);
26 /// Registers each child pane with the document.
27 void CTodoFrame::OnInitialUpdate (void)
29 CWindow::OnInitialUpdate();
30 m_Doc.RegisterView (&TodoList());
31 m_Doc.RegisterView (&EntryEditor());
32 if (access (".todo", R_OK) == 0)
33 m_Doc.LoadData();
36 /// Allows each child pane to close the frame by closing itself.
37 void CTodoFrame::OnChildClose (uoff_t i)
39 CWindow::OnChildClose (i);
40 Close();
43 /// Resizes and places child windows.
44 void CTodoFrame::OnResize (rcrect_t wr)
46 CWindow::OnResize (wr);
47 TodoList().OnResize (Rect (0, 0, wr.Width(), wr.Height() - 8));
48 EntryEditor().OnResize (Rect (0, wr.Height() - 8, wr.Width(), 8));