Commit removed for windows
[ttodo.git] / frame.cc
blob8a0ed0b899eb6dd3d68a433487d1f31e566f98ba
1 // Copyright (c) 2006 by Mike Sharov <msharov@users.sourceforge.net>
2 //
3 // frame.cc
4 //
6 #include "frame.h"
8 /// Default constructor.
9 CTodoFrame::CTodoFrame (void)
10 : CWindow ()
12 AddChild (new CTodoList);
13 AddChild (new CEntryEditDialog);
14 assert (pane_Last == Children().size());
17 /// Registers each child pane with the document.
18 void CTodoFrame::OnInitialUpdate (void)
20 CWindow::OnInitialUpdate();
21 Document()->RegisterView (&TodoList());
22 Document()->RegisterView (&EntryEditor());
25 /// Allows each child pane to close the frame by closing itself.
26 void CTodoFrame::OnChildClose (uoff_t i)
28 CWindow::OnChildClose (i);
29 Close();
32 /// Resizes and places child windows.
33 void CTodoFrame::OnResize (rcrect_t wr)
35 CWindow::OnResize (wr);
36 TodoList().OnResize (Rect (0, 0, wr.Width(), wr.Height() - 8));
37 EntryEditor().OnResize (Rect (0, wr.Height() - 8, wr.Width(), 8));