newntui/activex/tabselector/src/tabselectorctl.cpp
//--------------------------------------------------------------------------------------- 
// Creating this window will result in creating all child windows - tab control and three
// lists: Categories selector, Queries selector and Groups selector.
//--------------------------------------------------------------------------------------- 
Creating this window will result in creating all child windows - tab control and three
lists: Categories selector, Queries selector and Groups selector.
Creating this window will result in creating all child windows - tab control and three lists : Categories selector Queries selector and Groups selector .
int CTabSelectorCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)  {
	if (COleControl::OnCreate(lpCreateStruct) == -1)
		return -1;
    m_Tab.Create(WS_CHILD | WS_VISIBLE, 
				 CRect(lpCreateStruct->x, 
		               lpCreateStruct->y,
			           lpCreateStruct->x+lpCreateStruct->cx,
					   lpCreateStruct->y+lpCreateStruct->cy
				),
                this, 
				IDC_TAB);
	TC_ITEM item;
	item.mask         = TCIF_TEXT;
    item.pszText      = "Categories";     
    item.cchTextMax   = 20;     
	m_Tab.InsertItem(0,&item);
	item.mask         = TCIF_TEXT;
    item.pszText      = "Queries";     
    item.cchTextMax   = 20;     
	m_Tab.InsertItem(1,&item);
	item.mask         = TCIF_TEXT;
    item.pszText      = "Groups";     
    item.cchTextMax   = 20;     
	m_Tab.InsertItem(2,&item);
	infoFont.CreateFont(14,0,0,0,0,0,0,0,0,0,0,0,0,"Arial");
	m_Tab.SetFont(&infoFont,FALSE);
    m_Categories.Create("Categories Selector",
		                 WS_CHILD | WS_VISIBLE,
		                 CRect(lpCreateStruct->x, 
		                       lpCreateStruct->y,
			                   lpCreateStruct->x+lpCreateStruct->cx,
					           lpCreateStruct->y+lpCreateStruct->cy
						 ),
 					     this, 
					     IDC_CATEGORIES);
    m_Queries.Create("Queries Selector",
		              WS_CHILD | WS_VISIBLE,
		              CRect(lpCreateStruct->x, 
		                    lpCreateStruct->y,
			                lpCreateStruct->x+lpCreateStruct->cx,
					        lpCreateStruct->y+lpCreateStruct->cy
					   ),
 					   this, 
					   IDC_QUERIES);
    m_Groups.Create("Groups Selector",
		            WS_CHILD | WS_VISIBLE,
		            CRect(lpCreateStruct->x, 
		                  lpCreateStruct->y,
			              lpCreateStruct->x+lpCreateStruct->cx,
					      lpCreateStruct->y+lpCreateStruct->cy
					),
 					this, 
					IDC_GROUPS);
	return 0;
}
int CTabSelectorCtrl :: OnCreate ( LPCREATESTRUCT lpCreateStruct ) { if ( COleControl :: OnCreate ( lpCreateStruct ) == -1 ) return -1 ; m_Tab . Create ( WS_CHILD | WS_VISIBLE , CRect ( lpCreateStruct -> x , lpCreateStruct -> y , lpCreateStruct -> x + lpCreateStruct -> cx , lpCreateStruct -> y + lpCreateStruct -> cy ) , this , IDC_TAB ) ; TC_ITEM item ; item . mask = TCIF_TEXT ; item . pszText = " " ; item . cchTextMax = 20 ; m_Tab . InsertItem ( 0 , & item ) ; item . mask = TCIF_TEXT ; item . pszText = " " ; item . cchTextMax = 20 ; m_Tab . InsertItem ( 1 , & item ) ; item . mask = TCIF_TEXT ; item . pszText = " " ; item . cchTextMax = 20 ; m_Tab . InsertItem ( 2 , & item ) ; infoFont . CreateFont ( 14 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " " ) ; m_Tab . SetFont ( & infoFont , FALSE ) ; m_Categories . Create ( " " , WS_CHILD | WS_VISIBLE , CRect ( lpCreateStruct -> x , lpCreateStruct -> y , lpCreateStruct -> x + lpCreateStruct -> cx , lpCreateStruct -> y + lpCreateStruct -> cy ) , this , IDC_CATEGORIES ) ; m_Queries . Create ( " " , WS_CHILD | WS_VISIBLE , CRect ( lpCreateStruct -> x , lpCreateStruct -> y , lpCreateStruct -> x + lpCreateStruct -> cx , lpCreateStruct -> y + lpCreateStruct -> cy ) , this , IDC_QUERIES ) ; m_Groups . Create ( " " , WS_CHILD | WS_VISIBLE , CRect ( lpCreateStruct -> x , lpCreateStruct -> y , lpCreateStruct -> x + lpCreateStruct -> cx , lpCreateStruct -> y + lpCreateStruct -> cy ) , this , IDC_GROUPS ) ; return 0 ; }
Creating this window will result in creating all child windows - tab control and three
lists: Categories selector, Queries selector and Groups selector.
Creating this window will result in creating all child windows - tab control and three lists : Categories selector Queries selector and Groups selector .
// Creating tab selector to select active component // Adding tabs - components names // Creating categories component // Creatind queries component // Creating groups component