示例#1
0
LRESULT RecipesView::OnCreate(LPCREATESTRUCT createStruct)
{
    DWORD style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
	/*
    m_listview.Create(m_hWnd, rcDefault, NULL, style | LVS_REPORT | LVS_SINGLESEL, WS_EX_CLIENTEDGE);*/
	

	m_recipePanel.Create(m_hWnd);
	m_recipePanel.ShowWindow(SW_SHOWNOACTIVATE);
	m_filterConnection = m_recipePanel.connectSettingsChanged(boost::bind(&RecipesView::onFilterSettingsChanged, this));
	/*
	m_buttonRefresh.Create(m_hWnd);
	m_buttonRefresh.ShowWindow(SW_SHOWNOACTIVATE);*/

    m_webview.Create(m_hWnd);
   // m_webview.ShowWindow(SW_SHOWNOACTIVATE);
	m_webview.SetHTML(_T("<html><body></body></html>"));


    CImageList imageList;
    imageList.CreateFromImage(IDB_PATTERNMATCH_VIEW, 16, 1, CLR_DEFAULT, IMAGE_BITMAP,
        LR_CREATEDIBSECTION | LR_DEFAULTSIZE);

    m_toolbar.Create(GetTopLevelWindow(), NULL, _T("RecipesViewToolBar"),
        ATL_SIMPLE_TOOLBAR_PANE_STYLE | TBSTYLE_LIST,
        TBSTYLE_EX_MIXEDBUTTONS);
    m_toolbar.SetButtonStructSize();
    m_toolbar.SetImageList(imageList);
    m_toolbar.AutoSize();

    return 0;
}
示例#2
0
LRESULT IdentifyView::onCreate(LPCREATESTRUCT createStruct)
{
    RECT myRect = { 0, 0, createStruct->cx, createStruct->cy };
    //RECT identRect = { 0, 0, 250, createStruct->cy };
    //RECT gridRect = { 250, 0, createStruct->cx, createStruct->cy };

    DWORD splitterStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;

    // Create child windows
    m_splitter.Create(m_hWnd, myRect, NULL, splitterStyle);
    m_splitter.SetSplitterExtendedStyle(0);
    m_splitter.SetDlgCtrlID(IDW_SPLITTER);

    DWORD gridStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_OWNERDATA;
    m_identifyList->Create(m_splitter.m_hWnd, rcDefault, NULL, gridStyle, WS_EX_CLIENTEDGE);
    m_identifyList->SetDlgCtrlID(IDW_IDENTLIST);

    m_datagrid->Create(m_splitter.m_hWnd, rcDefault, NULL, gridStyle, WS_EX_CLIENTEDGE);
    m_datagrid->SetDlgCtrlID(IDW_DATAGRID);

    m_splitter.SetSplitterPanes(m_identifyList->m_hWnd, m_datagrid->m_hWnd);
    m_splitter.SetActivePane(SPLIT_PANE_LEFT);
    m_splitter.SetSplitterPos(250);

    // Assign a datamodel to the list of identifyables.
    m_identifyListModel.reset(new IdentifyListDataModel(m_db));
    m_identifyList->setModel(m_identifyListModel);
    m_identifyList->autosizeColumnsUseData();

    DlgResize_Init(false, false);

    // Build the toolbar
    TBBUTTON buttons[1];
    buttons[0].iBitmap = 0;
    buttons[0].idCommand = ID_HELP;
    buttons[0].fsState = TBSTATE_ENABLED;
    buttons[0].fsStyle = TBSTYLE_BUTTON | BTNS_SHOWTEXT | BTNS_AUTOSIZE;
    buttons[0].dwData = NULL;
    buttons[0].iString = (INT_PTR)_T("Help");

    CImageList imageList;
    imageList.CreateFromImage(IDB_IDENTIFY_VIEW, 16, 1, CLR_DEFAULT, IMAGE_BITMAP, LR_CREATEDIBSECTION | LR_DEFAULTSIZE);

    m_toolbar.Create(GetTopLevelWindow(), NULL, _T("IdentifyViewToolBar"), 
        ATL_SIMPLE_TOOLBAR_PANE_STYLE | TBSTYLE_LIST, 
        TBSTYLE_EX_MIXEDBUTTONS);
    m_toolbar.SetButtonStructSize();
    m_toolbar.SetImageList(imageList);
    m_toolbar.AddButtons(ARRAYSIZE(buttons), buttons);
    m_toolbar.AutoSize();

    return 0;
}
示例#3
0
LRESULT CSearchBarView::OnCreate(LPCREATESTRUCT lpcs)
{
    ATLVERIFY(m_ctrlEditorView.Create(*this, rcDefault, NULL, CHILD_WND_STYLE));
    m_ctrlEditorView.ModifyStyle(0, ES_LEFT | ES_AUTOHSCROLL | ES_VERTICAL);

    // Set up the bitmap buttons.
    ATLVERIFY(m_btnSearch.Create(*this, rcDefault, NULL, CHILD_WND_STYLE));

    CImageList iml;
    iml.CreateFromImage(IDB_BITMAP3, 40, 0, CLR_NONE, IMAGE_BITMAP, 
        LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS | LR_CREATEDIBSECTION);
    m_btnSearch.SetImageList(iml.Detach());
    m_btnSearch.SetImages(0, 3, 1, 2);
    m_btnSearch.SetBitmapButtonExtendedStyle(BMPBTN_HOVER, BMPBTN_HOVER);

    SetMsgHandled(false);
    return 0;
}
示例#4
0
LRESULT CMainFrame::OnCreate(LPCREATESTRUCT /*lParam*/)
{
	//
	// create command bar window
	//
	HWND hWndCmdBar = m_CmdBar.Create(
		m_hWnd,
		rcDefault,
		NULL,
		ATL_SIMPLE_CMDBAR_PANE_STYLE);

	// attach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.SetImageSize(CSize(9,9));
	//	m_CmdBar.LoadImages(IDR_MAINFRAME);
	// remove old menu
	SetMenu(NULL);

	// set title
	CString strTitle;
	strTitle.LoadString( IDS_APPLICATION );
	SetWindowText(strTitle);

	//
	// setting up a tool bar
	//
	// patria:
	//
	// We are loading an empty tool bar.
	// If we directly load a tool bar using a bitmap which does not
	// match with windows system palette, the application may crash
	// in Windows 2000.
	// As an workaround, we just create a simple tool bar with
	// an empty bitmap and replace them later.
	//
	HWND hWndToolBar = CreateSimpleToolBarCtrl(
		m_hWnd, 
		IDR_EMPTY_TOOLBAR, 
		FALSE, 
		ATL_SIMPLE_TOOLBAR_PANE_STYLE | TBSTYLE_LIST);

	m_wndToolBar.Attach( hWndToolBar );
	m_wndToolBar.SetExtendedStyle( TBSTYLE_EX_MIXEDBUTTONS | TBSTYLE_EX_DRAWDDARROWS );

	//
	// patria:
	//
	// Some bitmaps are distorted when used with TB_ADDBITMAP
	// which is sent from CreateSimpleToolBarCtrl when the bitmap is not true color.
	// This is the case with IO-DATA's tool bar image.
	// As an workaround, we can directly create a image list directly
	// and replace the image list of the tool bar, which corrects such misbehaviors.
	//
	{
		CImageList imageList;
		WORD wWidth = 32; // we are using 32 x 32 buttons
		imageList.CreateFromImage(
			IDR_MAINFRAME, 
			wWidth, 
			1, 
			CLR_DEFAULT,
			IMAGE_BITMAP,
			LR_CREATEDIBSECTION | LR_DEFAULTSIZE);
		m_wndToolBar.SetImageList(imageList);
	}

	TBBUTTON tbButton = { 0 };
	TBBUTTONINFO tbButtonInfo = { 0 };
	TBREPLACEBITMAP replaceBitmap = { 0 };

	// Add strings to the tool bar
	m_wndToolBar.SetButtonStructSize(sizeof(TBBUTTON));
	for ( int i=0; i < m_wndToolBar.GetButtonCount(); i++ )
	{
		CString strCommand;

		m_wndToolBar.GetButton( i, &tbButton );
		tbButtonInfo.cbSize	= sizeof(TBBUTTONINFO);
		tbButtonInfo.dwMask = TBIF_STYLE;
		m_wndToolBar.GetButtonInfo( tbButton.idCommand, &tbButtonInfo );
		tbButtonInfo.dwMask = TBIF_TEXT | TBIF_STYLE;
		strCommand.LoadString( tbButton.idCommand );
		strCommand = strCommand.Right(
			strCommand.GetLength() - strCommand.Find('\n') - 1
			);
		tbButtonInfo.pszText = 
			const_cast<LPTSTR>(static_cast<LPCTSTR>(strCommand));
		tbButtonInfo.cchText = strCommand.GetLength();
		tbButtonInfo.fsStyle |= BTNS_SHOWTEXT | BTNS_AUTOSIZE;
		m_wndToolBar.AddString( tbButton.idCommand );
		m_wndToolBar.SetButtonInfo( tbButton.idCommand, &tbButtonInfo );
	}

#define ATL_CUSTOM_REBAR_STYLE \
	((ATL_SIMPLE_REBAR_STYLE & ~RBS_AUTOSIZE) | CCS_NODIVIDER)

	//
	// patria: reason to use ATL_CUSTOM_REBAR_STYLE
	//
	// ATL_SIMPLE_REBAR_STYLE (not a NO_BRODER style) has a problem
	// with theme-enabled Windows XP, 
	// rendering some transparent lines above the rebar.
	// 

	CreateSimpleReBar(ATL_CUSTOM_REBAR_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(m_wndToolBar.m_hWnd, NULL, TRUE);

	CReBarCtrl reBar = m_hWndToolBar;
	DWORD cBands = reBar.GetBandCount();
	for (DWORD i = 0; i < cBands; ++i)
	{
		REBARBANDINFO rbi = {0};
		rbi.cbSize = sizeof(REBARBANDINFO);
		rbi.fMask = RBBIM_STYLE;
		reBar.GetBandInfo(i, &rbi);
		rbi.fStyle |= RBBS_NOGRIPPER;
		reBar.SetBandInfo(i, &rbi);
	} 

// work on status bar, progress bar
	CreateSimpleStatusBar();

	CRect rectPgs;
	::GetClientRect(m_hWndStatusBar, &rectPgs);
	rectPgs.DeflateRect(1,2,1,2);
	rectPgs.right = 300;
	m_wndRefreshProgress.Create(m_hWndStatusBar, &rectPgs, NULL, WS_CHILD | WS_VISIBLE);

	m_wndRefreshProgress.SetRange32(0, 100);
	m_wndRefreshProgress.SetPos(50);

	m_wndRefreshProgress.ShowWindow(SW_HIDE);

	//
	// Comments from the author
	// (http://www.viksoe.dk/code/treelistview.htm)
	//
	// It is wise to add the TVS_DISABLEDRAGDROP and TVS_SHOWSELALWAYS 
	// styles to the tree control for best result.
	//
	m_viewTreeList.Create(
		*this, rcDefault, NULL,
		WS_BORDER | WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
		TVS_SHOWSELALWAYS | TVS_DISABLEDRAGDROP /* | TVS_HASLINES */ );


	m_viewTreeList.Initialize();
	m_viewTreeList.GetTreeControl().SetIndent(24);

	m_hWndClient = m_viewTreeList;

	UIAddToolBar(m_wndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);

	// TODO : It will be better if we display splash window while
	//		the treeview is initialized

	PostMessage(WM_COMMAND, IDM_TOOL_REFRESH, 0);


	m_hEventCallback = 
		::NdasRegisterEventCallback(NdasEventCallback,m_hWnd);


	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	// FIXME : We need to remember the window size
	//CRect rectResize;
	//GetClientRect( rectResize );
	//rectResize = CRect( rectResize.TopLeft(), CSize(500, 500) );
	//ClientToScreen( rectResize );
	//MoveWindow( rectResize );
	//CenterWindow();

	return 0;
}
示例#5
0
void CPlugin::OnActivate( void )
{
  OutputDebugString("CPlugin::OnActivate() called\n");

  sys_Printf(BIC_INFO,"%s Plugin by %s Activated\n", m_Name, m_Author);

  // do activation/initialisation code here

  g_ImageListID = HydraIRC_GetNewImageListID();

  int i;

  for (i = 0 ; i < TOOLBAR_BUTTON_COUNT; i ++)
    ToolbarIDs[i] = HydraIRC_GetNewToolbarID();

  /*
  g_hToolbarImageList = HydraIRC_GetToolbarImageList();
  if (g_hToolbarImageList)
  {
    g_ToolbarImageList.Attach(g_hToolbarImageList);

    g_FirstImage = g_ToolbarImageList.GetImageCount();
	  g_ToolbarBitmap.LoadBitmap(IDB_TOOLBAR);
	  g_ToolbarImageList.Add( g_ToolbarBitmap, RGB(255,0,255));
    g_LastImage = g_ToolbarImageList.GetImageCount() - 1;
  }
  else
    sys_Printf(BIC_ERROR,"%s: Failed to get imagelist!\n",Plugin.m_Name);
  */

#ifdef HYDRAIRC_0.3.163
/*
  In HydraIRC <= 0.3.163 HydraIRC_GetToolbar returned the HWND of the toolbar itself
  but attachking a ReBar and Using GetBandInfo no-longer worked (probably due to WTL 8 changes)
  so in 0.3.164 it has been changed to returning the actual child window the holds the buttons.
*/
  g_hToolBarWnd = HydraIRC_GetToolbar();
  if (!g_hToolBarWnd) {
    sys_Printf(BIC_ERROR,"%s: Failed to get toolbar window!\n",Plugin.m_Name);
    return;
  }
  
  g_Rebar.Attach(g_hToolBarWnd);

	//REBARBANDINFO rbbi = { sizeof(REBARBANDINFO), RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_STYLE };
  REBARBANDINFO rbbi = { sizeof(REBARBANDINFO), RBBIM_CHILD };
  if (g_Rebar.GetBandInfo(1,&rbbi) == 0) {
    sys_Printf(BIC_ERROR,"%s: Failed to get toolbar band info!\n",Plugin.m_Name);
    return;
  }
  g_Toolbar.Attach(rbbi.hwndChild);
#else
  HWND toolbarChild = HydraIRC_GetToolbar();
  if (!toolbarChild) {
    sys_Printf(BIC_ERROR,"%s: Failed to get toolbar band info!\n",Plugin.m_Name);
    return;
  }

  g_Toolbar.Attach(toolbarChild);
#endif

  //g_ToolbarBitmap.LoadBitmap(IDB_TOOLBAR);

  //g_ToolbarImageList.Add( g_ToolbarBitmap, RGB(255,0,255));

  g_ToolbarImageList.CreateFromImage(IDB_TOOLBAR, 16, 17, RGB(255,0,255), IMAGE_BITMAP, LR_CREATEDIBSECTION | LR_SHARED);
  g_Toolbar.SetImageList(g_ToolbarImageList,g_ImageListID);

  //g_ToolbarImageList.Add( g_ToolbarBitmap, RGB(255,0,255));    

  TBBUTTON tb[TOOLBAR_BUTTON_COUNT];
  memset(tb, 0, sizeof(tb));
  int n = 0, image = 0;//g_FirstImage;

  tb[n].iBitmap = 0;
  tb[n].idCommand = ToolbarIDs[n];
  tb[n].fsState = TBSTATE_ENABLED;
  tb[n].fsStyle = TBSTYLE_SEP;

  n++;
  tb[n].iBitmap = MAKELONG(image++,g_ImageListID);
  tb[n].idCommand = ToolbarIDs[n];
  tb[n].fsState = TBSTATE_ENABLED;
  tb[n].fsStyle = TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE;
  //tb[n].iString = (int)("Show Winamp song\0");

  g_ButtonsAdded = g_Toolbar.AddButtons(TOOLBAR_BUTTON_COUNT,tb);

  // TODO: force a recalcuate of the toolbar's ideal size
  // see WTL::CFrameWindowImplBase::AddSimpleReBarBandCtrl
  // the bit where it calculates the size.
}
示例#6
0
/*
void SetPaneWidths(int* arrWidths, int nPanes)
{ 
    // find the size of the borders
    int arrBorders[3];
    m_status.GetBorders(arrBorders);

    // calculate right edge of default pane (0)
    arrWidths[0] += arrBorders[2];
    for (int i = 1; i < nPanes; i++)
        arrWidths[0] += arrWidths[i];

    // calculate right edge of remaining panes (1 thru nPanes-1)
    for (int j = 1; j < nPanes; j++)
        arrWidths[j] += arrBorders[2] + arrWidths[j - 1];

    // set the pane widths
    m_status.SetParts(m_status.m_nPanes, arrWidths); 
}

*/
LRESULT CMainFrame::OnCreate(LPCREATESTRUCT /*lParam*/)
{
	//
	// create command bar window
	//
	HWND hWndCmdBar = m_CmdBar.Create(
		m_hWnd,
		rcDefault,
		NULL,
		ATL_SIMPLE_CMDBAR_PANE_STYLE);

	// attach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.SetImageSize(CSize(9,9));
	//	m_CmdBar.LoadImages(IDR_MAINFRAME);
	// remove old menu
	SetMenu(NULL);

	// set title
	WTL::CString strTitle;
	strTitle.LoadString( IDS_APPLICATION );
	SetWindowText(strTitle);

	//
	// setting up a tool bar
	//
	HWND hWndToolBar = CreateSimpleToolBarCtrl(
		m_hWnd, 
		IDR_MAINFRAME, 
		FALSE, 
		ATL_SIMPLE_TOOLBAR_PANE_STYLE | TBSTYLE_LIST);

	m_wndToolBar.Attach( hWndToolBar );
	m_wndToolBar.SetExtendedStyle( TBSTYLE_EX_MIXEDBUTTONS | TBSTYLE_EX_DRAWDDARROWS );

	//
	// patria:
	//
	// Some bitmaps are distorted when used with TB_ADDBITMAP
	// which is sent from CreateSimpleToolBarCtrl when the bitmap is not true color.
	// This is the case with IO-DATA's tool bar image.
	// As an workaround, we can directly create a image list directly
	// and replace the image list of the tool bar, which corrects such misbehaviors.
	//
	{
		CImageList imageList;
		WORD wWidth = 32; // we are using 32 x 32 buttons
		imageList.CreateFromImage(
			IDR_MAINFRAME, 
			wWidth, 
			1, 
			CLR_DEFAULT,
			IMAGE_BITMAP,
			LR_CREATEDIBSECTION | LR_DEFAULTSIZE);
		m_wndToolBar.SetImageList(imageList);
	}

	TBBUTTON tbButton = { 0 };
	TBBUTTONINFO tbButtonInfo = { 0 };
	TBREPLACEBITMAP replaceBitmap = { 0 };

	// Add strings to the tool bar
	m_wndToolBar.SetButtonStructSize(sizeof(TBBUTTON));
	for ( int i=0; i < m_wndToolBar.GetButtonCount(); i++ )
	{
		WTL::CString strCommand;

		m_wndToolBar.GetButton( i, &tbButton );
		tbButtonInfo.cbSize	= sizeof(TBBUTTONINFO);
		tbButtonInfo.dwMask = TBIF_STYLE;
		m_wndToolBar.GetButtonInfo( tbButton.idCommand, &tbButtonInfo );
		tbButtonInfo.dwMask = TBIF_TEXT | TBIF_STYLE;
		strCommand.LoadString( tbButton.idCommand );
		strCommand = strCommand.Right(
			strCommand.GetLength() - strCommand.Find('\n') - 1
			);
		tbButtonInfo.pszText = 
			const_cast<LPTSTR>(static_cast<LPCTSTR>(strCommand));
		tbButtonInfo.cchText = strCommand.GetLength();
		tbButtonInfo.fsStyle |= BTNS_SHOWTEXT | BTNS_AUTOSIZE;
		m_wndToolBar.AddString( tbButton.idCommand );
		m_wndToolBar.SetButtonInfo( tbButton.idCommand, &tbButtonInfo );
	}

	//
	// Modify mirror button as drop down button
	//
	{
		TBBUTTON tb;

		m_wndToolBar.GetButton(
			m_wndToolBar.CommandToIndex(IDM_AGGR_MIRROR), 
			&tb);

		TBBUTTONINFO tbi = {0};
		tbi.cbSize = sizeof(TBBUTTONINFO);
		tbi.dwMask = TBIF_STYLE;
		m_wndToolBar.GetButtonInfo(IDM_AGGR_MIRROR, &tbi);
		tbi.fsStyle |= TBSTYLE_DROPDOWN;
		m_wndToolBar.SetButtonInfo( IDM_AGGR_MIRROR, &tbi);
	}

#define ATL_CUSTOM_REBAR_STYLE \
	((ATL_SIMPLE_REBAR_STYLE & ~RBS_AUTOSIZE) | CCS_NODIVIDER)

	//
	// patria: reason to use ATL_CUSTOM_REBAR_STYLE
	//
	// ATL_SIMPLE_REBAR_STYLE (not a NO_BRODER style) has a problem
	// with theme-enabled Windows XP, 
	// rendering some transparent lines above the rebar.
	// 

	CreateSimpleReBar(ATL_CUSTOM_REBAR_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(m_wndToolBar.m_hWnd, NULL, TRUE);

	CReBarCtrl reBar = m_hWndToolBar;
	DWORD cBands = reBar.GetBandCount();
	for (DWORD i = 0; i < cBands; ++i)
	{
		REBARBANDINFO rbi = {0};
		rbi.cbSize = sizeof(REBARBANDINFO);
		rbi.fMask = RBBIM_STYLE;
		reBar.GetBandInfo(i, &rbi);
		rbi.fStyle |= RBBS_NOGRIPPER;
		reBar.SetBandInfo(i, &rbi);
	} 

// work on status bar, progress bar
	CreateSimpleStatusBar();

//	m_wndStatusBar.SubclassWindow(m_hWndStatusBar);

	RECT rectRefreshProgress;
/*
#define ID_PANE_REFRESH_STATUS 1
	int anPanes[] = {ID_DEFAULT_PANE, ID_PANE_REFRESH_STATUS};

	m_wndStatusBar.SetPanes(anPanes, sizeof(anPanes) / sizeof(int), false);

	int anWidths[] = {400, -1};
	m_wndStatusBar.SetParts(sizeof(anWidths) / sizeof(int), anWidths);

	m_wndStatusBar.GetPaneRect(ID_DEFAULT_PANE, &rectRefreshProgress);
	m_wndStatusBar.GetPaneRect(ID_PANE_REFRESH_STATUS, &rectRefreshProgress);
*/
//	m_wndStatusBar.GetWindowRect(&rectRefreshProgress);
	::GetClientRect(m_hWndStatusBar, &rectRefreshProgress);
	rectRefreshProgress.right = 300;
	m_wndRefreshProgress.Create(m_hWndStatusBar, &rectRefreshProgress, NULL, WS_CHILD | WS_VISIBLE);

	m_wndRefreshProgress.SetRange32(0, 100);
	m_wndRefreshProgress.SetPos(50);

	m_wndRefreshProgress.ShowWindow(SW_HIDE);

/*
	m_wndStatusBar.SetPaneText(ID_DEFAULT_PANE, _T("text1"));
	m_wndStatusBar.SetPaneText(ID_PANE_REFRESH_STATUS, _T("text2"));
*/

	m_wndHorzSplit.Create(*this, rcDefault, NULL, 
		WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);

	m_viewTree.Create(
		m_wndHorzSplit, 
		rcDefault, 
		NULL, 
		WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN 
		| TVS_HASLINES | /* TVS_LINESATROOT | */ TVS_SHOWSELALWAYS, 
		WS_EX_CLIENTEDGE
		);

	m_viewList.Create(
		m_wndHorzSplit, 
		rcDefault, 
		NULL, 
		WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
		LVS_ICON | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS, 
		WS_EX_CLIENTEDGE
		);

	m_viewList.Initialize();

	m_wndHorzSplit.SetSplitterPanes(m_viewList, m_viewTree);
	m_wndHorzSplit.m_cxyMin = 130;



	m_viewTreeList.Create(
		*this, rcDefault, NULL,
		WS_BORDER | WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);


	m_viewTreeList.Initialize();
//	m_viewTreeList._Init();

//	m_viewTreeList.SubclassWindow(m_hWnd);

	m_hWndClient = m_wndHorzSplit;
	m_hWndClient = m_viewTreeList;

	UIAddToolBar(m_wndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);

	// TODO : It will be better if we display splash window while
	//		the treeview is initialized

	m_bRefreshing = FALSE;
	::InitializeCriticalSection(&m_csThreadRefreshStatus);
//	StartRefreshStatus();
//	PostMessage(WM_COMMAND, IDM_AGGR_REFRESH, 0);


	m_hEventCallback = 
		::NdasRegisterEventCallback(pNdasEventProc,m_hWnd);


	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	// FIXME : We need to remember the window size
	CRect rectResize;
	GetClientRect( rectResize );
	rectResize = CRect( rectResize.TopLeft(), CSize(500, 500) );
	ClientToScreen( rectResize );
	MoveWindow( rectResize );
	CenterWindow();
	return 0;
}
示例#7
0
void CClassView::InitImageList()
{
	CImageList il;
	il.CreateFromImage(IDB_PROJIMAGE, 16, 1, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
	SetImageList(il);
}