/
Channel_control2.cpp
69 lines (45 loc) · 1.12 KB
/
Channel_control2.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Channel_cont.cpp : implementation file
//
#include "stdafx.h"
#include "SLControl.h"
#include "Channel_control.h"
#include "Channel_tab.h"
// Channel_cont
IMPLEMENT_DYNAMIC(Channel_control, CTabCtrl)
Channel_control::Channel_control()
{
no_of_tab_pages=1;
tab_pages[0]=new Channel_tab;
}
Channel_control::~Channel_control()
{
// Delete tabs
int i;
for (i=0;i<no_of_tab_pages;i++)
delete tab_pages[i];
}
BEGIN_MESSAGE_MAP(Channel_control, CTabCtrl)
END_MESSAGE_MAP()
// Channel_control message handlers
void Channel_control::Init(void)
{
current_page=0;
tab_pages[0]->Create(IDD_CHANNEL_TAB,this);
tab_pages[0]->ShowWindow(SW_SHOW);
SetRectangle();
}
void Channel_control::SetRectangle(void)
{
CRect tabRect, itemRect;
int nX, nY, nXc, nYc;
GetClientRect(&tabRect);
GetItemRect(0, &itemRect);
nX=itemRect.left;
nY=itemRect.bottom+1;
nXc=tabRect.right-itemRect.left-1;
nYc=tabRect.bottom-nY-1;
tab_pages[0]->SetWindowPos(&wndTop, nX, nY, nXc, nYc, SWP_SHOWWINDOW);
for(int nCount=1; nCount < no_of_tab_pages; nCount++){
tab_pages[nCount]->SetWindowPos(&wndTop, nX, nY, nXc, nYc, SWP_HIDEWINDOW);
}
}