コード例 #1
0
BOOL CPluginFrame2::Initialize()
{
	m_pMainFrame = (CMainFrame*) AfxGetApp ()->m_pMainWnd;
	m_bMoreTabs = _App.View_MoreTabs ();

	
	if (FALSE == _PluginMgr.LoadPlugins (this))
		return FALSE;

	int cMenuImages;

	for (int i = 0; i < _PluginMgr.GetPluginCount (); i++)
	{
		fsPluginInfo &plug = _PluginMgr.Plugin (i);
		if (i < 3 || m_bMoreTabs)
			m_wndTabs.InsertItem (i, plug.strName);
		else if (i == 3)
			m_wndTabs.InsertItem (i, ">>");

		::ShowWindow (plug.hWnd, SW_HIDE);
		
		if (plug.pbmpMenuImages)
		{
			
			cMenuImages = m_pMainFrame->m_imgsTool.GetImageCount ();
			m_pMainFrame->m_imgsTool.Add (plug.pbmpMenuImages, RGB (255, 0, 255));
			m_pMainFrame->m_dimgsTool.Add (plug.pbmpMenuDImages, RGB (255, 0, 255));
			delete plug.pbmpMenuImages;
			delete plug.pbmpMenuDImages;
			plug.pbmpMenuImages = plug.pbmpMenuDImages = NULL;
			
			

			int j = 0;
			for (j = 0; j < plug.cMenuMainImages; j++)
			{
				plug.pMenuMainImages [j].iCheckImage += cMenuImages;
				plug.pMenuMainImages [j].iImage += cMenuImages;
			}

			for (j = 0; j < plug.cMenuViewImages; j++)
			{
				plug.pMenuViewImages [j].iCheckImage += cMenuImages;
				plug.pMenuViewImages [j].iImage += cMenuImages;
			}
		}
	}

	int iPlug = _App.ActivePlugin ();
	if (iPlug >= _PluginMgr.GetPluginCount () || iPlug < 0)
		iPlug = 0;
	if (m_bMoreTabs == FALSE && iPlug > 2)
		iPlug = 0;

	SetActivePlugin (iPlug);

	return TRUE;
}
コード例 #2
0
ファイル: plugtoolbar.cpp プロジェクト: pedia/raidget
BOOL CPlugToolBar::Initialize()
{
    m_pMainFrame = (CMainFrame*) AfxGetApp ()->m_pMainWnd;


    if (FALSE == _PluginMgr.LoadPlugins (m_pPlugFrame))
        return FALSE;

    int cMenuImages;

    for (int i = 0; i < _PluginMgr.GetPluginCount (); i++)
    {
        fsPluginInfo &plug = _PluginMgr.Plugin (i);
        AddString (plug.strName);
        ::ShowWindow (plug.hWnd, SW_HIDE);

        if (plug.pbmpMenuImages)
        {

            cMenuImages = m_pMainFrame->m_imgsTool.GetImageCount ();
            m_pMainFrame->m_imgsTool.Add (plug.pbmpMenuImages, RGB (255, 0, 255));
            m_pMainFrame->m_dimgsTool.Add (plug.pbmpMenuDImages, RGB (255, 0, 255));
            delete plug.pbmpMenuImages;
            delete plug.pbmpMenuDImages;
            plug.pbmpMenuImages = plug.pbmpMenuDImages = NULL;



            for (int j = 0; j < plug.cMenuMainImages; j++)
            {
                plug.pMenuMainImages [j].iCheckImage += cMenuImages;
                plug.pMenuMainImages [j].iImage += cMenuImages;
            }

            for (int j = 0; j < plug.cMenuViewImages; j++)
            {
                plug.pMenuViewImages [j].iCheckImage += cMenuImages;
                plug.pMenuViewImages [j].iImage += cMenuImages;
            }
        }
    }

    int iPlug = _App.ActivePlugin ();
    if (iPlug >= _PluginMgr.GetPluginCount () || iPlug < 0)
        iPlug = 0;

    SetActivePlugin (iPlug);

    return TRUE;
}