2 * Windows GUI for olsr.org
\r
3 * Copyright (C) 2004 Thomas Lopatic (thomas@lopatic.de)
\r
5 * This file is part of olsr.org.
\r
7 * olsr.org is free software; you can redistribute it and/or modify
\r
8 * it under the terms of the GNU General Public License as published by
\r
9 * the Free Software Foundation; either version 2 of the License, or
\r
10 * (at your option) any later version.
\r
12 * olsr.org is distributed in the hope that it will be useful,
\r
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 * GNU General Public License for more details.
\r
17 * You should have received a copy of the GNU General Public License
\r
18 * along with olsr.org; if not, write to the Free Software
\r
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
24 #include "Frontend.h"
\r
25 #include "MyTabCtrl.h"
\r
28 #define new DEBUG_NEW
\r
30 static char THIS_FILE[] = __FILE__;
\r
33 MyTabCtrl::MyTabCtrl()
\r
37 MyTabCtrl::~MyTabCtrl()
\r
41 BEGIN_MESSAGE_MAP(MyTabCtrl, CTabCtrl)
\r
42 //{{AFX_MSG_MAP(MyTabCtrl)
\r
43 ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnSelchange)
\r
47 void MyTabCtrl::InitTabDialogs(CStringArray *Interfaces,
\r
48 CStringArray *Addresses)
\r
54 m_Dialog2.Interfaces = Interfaces;
\r
55 m_Dialog2.Addresses = Addresses;
\r
57 m_Dialog1.Create(GetParent());
\r
58 m_Dialog2.Create(GetParent());
\r
59 m_Dialog3.Create(GetParent());
\r
60 m_Dialog4.Create(GetParent());
\r
62 Dialogs[0] = &m_Dialog2;
\r
63 Dialogs[1] = &m_Dialog1;
\r
64 Dialogs[2] = &m_Dialog3;
\r
65 Dialogs[3] = &m_Dialog4;
\r
69 for (i = 0; i < 4; i++)
\r
71 GetClientRect(Client);
\r
72 AdjustRect(FALSE, Client);
\r
75 GetParent()->ScreenToClient(Win);
\r
77 Client.OffsetRect(Win.left, Win.top);
\r
79 Dialogs[i]->SetWindowPos(&wndTop, Client.left, Client.top,
\r
80 Client.Width(), Client.Height(), SWP_HIDEWINDOW);
\r
86 void MyTabCtrl::DisplayTabDialog()
\r
89 Dialogs[Sel]->ShowWindow(SW_HIDE);
\r
93 Dialogs[Sel]->ShowWindow(SW_SHOW);
\r
96 void MyTabCtrl::OnSelchange(NMHDR* pNMHDR, LRESULT* pResult)
\r
100 DisplayTabDialog();
\r