当前位置: 首页>>代码示例>>C++>>正文


C++ CModifiedComboBox::GetItemDataPtr方法代码示例

本文整理汇总了C++中CModifiedComboBox::GetItemDataPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ CModifiedComboBox::GetItemDataPtr方法的具体用法?C++ CModifiedComboBox::GetItemDataPtr怎么用?C++ CModifiedComboBox::GetItemDataPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CModifiedComboBox的用法示例。


在下文中一共展示了CModifiedComboBox::GetItemDataPtr方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ResetComboBox

bool COptionPluginPage::ResetComboBox(CModifiedComboBox & ComboBox, SettingID Type)
{
    if (!ComboBox.IsChanged())
    {
        return false;
    }

    ComboBox.SetReset(true);
    stdstr Value = g_Settings->LoadDefaultString(Type);
    for (int i = 0, n = ComboBox.GetCount(); i < n; i++)
    {
        const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox.GetItemDataPtr(i);
        if (PluginPtr == NULL)
        {
            continue;
        }

        const CPluginList::PLUGIN * Plugin = *PluginPtr;
        if (Plugin->FileName != Value)
        {
            continue;
        }
        ComboBox.SetCurSel(i);
        return true;
    }
    return false;
}
开发者ID:cxd4,项目名称:project64,代码行数:27,代码来源:SettingsPage-Plugin.cpp

示例2: ApplyComboBoxes

void COptionPluginPage::ApplyComboBoxes(void)
{
    for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter++)
    {
        CModifiedComboBox * ComboBox = cb_iter->second;
        if (ComboBox->IsChanged())
        {
            int index = ComboBox->GetCurSel();
            if (index == CB_ERR)
            {
                return;
            }

            const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index);
            if (PluginPtr == NULL)
            {
                return;
            }

            const CPluginList::PLUGIN * Plugin = *PluginPtr;

            g_Settings->SaveString(cb_iter->first, Plugin->FileName.c_str());
        }
        if (ComboBox->IsReset())
        {
            g_Settings->DeleteSetting(cb_iter->first);
            ComboBox->SetReset(false);
        }
    }
}
开发者ID:cxd4,项目名称:project64,代码行数:30,代码来源:SettingsPage-Plugin.cpp

示例3: UpdatePageSettings

void COptionPluginPage::UpdatePageSettings(void)
{
    UpdateCheckBoxes();
    for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter++)
    {
        CModifiedComboBox * ComboBox = cb_iter->second;
        stdstr SelectedValue;

        ComboBox->SetChanged(g_Settings->LoadStringVal(cb_iter->first, SelectedValue));
        for (int i = 0, n = ComboBox->GetCount(); i < n; i++)
        {
            const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(i);
            if (PluginPtr == NULL)
            {
                continue;
            }
            const CPluginList::PLUGIN * Plugin = *PluginPtr;
            if (Plugin == NULL)
            {
                continue;
            }
            if (_stricmp(SelectedValue.c_str(), Plugin->FileName.c_str()) != 0)
            {
                continue;
            }
            ComboBox->SetDefault((WPARAM)Plugin);
        }
    }
    PluginItemChanged(GFX_LIST, GFX_ABOUT, false);
    PluginItemChanged(AUDIO_LIST, AUDIO_ABOUT, false);
    PluginItemChanged(CONT_LIST, CONT_ABOUT, false);
    PluginItemChanged(RSP_LIST, RSP_ABOUT, false);
}
开发者ID:cxd4,项目名称:project64,代码行数:33,代码来源:SettingsPage-Plugin.cpp

示例4: ShowAboutButton

void COptionPluginPage::ShowAboutButton ( int id )
{
	CModifiedComboBox * ComboBox = NULL;
	for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++)
	{
		if ((int)(cb_iter->second->GetMenu()) != id)
		{
			continue;
		}
		ComboBox = cb_iter->second;
		break;
	}
	if (ComboBox == NULL)
	{
		return;
	}
	int index = ComboBox->GetCurSel();
	if (index == CB_ERR) 
	{
		return; 
	}
	
	const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index);
	if (PluginPtr == NULL)
	{
		return;
	}

	const CPluginList::PLUGIN * Plugin = *PluginPtr;
	if (Plugin == NULL)
	{
		return;
	}
	
	//Load the plugin
	UINT LastErrorMode = SetErrorMode( SEM_FAILCRITICALERRORS );
	HMODULE hLib = LoadLibrary(Plugin->FullPath);		
	SetErrorMode(LastErrorMode);
	if (hLib == NULL)
	{
		return;
	}
	
	//Get DLL about
	void (__cdecl *DllAbout) ( HWND hWnd );
	DllAbout = (void (__cdecl *)(HWND))GetProcAddress( hLib, "DllAbout" );
	
	//call the function from the dll
	if (DllAbout != NULL)
		DllAbout(m_hWnd);

	FreeLibrary(hLib);
}
开发者ID:YNG,项目名称:project64,代码行数:53,代码来源:Settings+Page+-+Plugin.cpp

示例5: ApplyComboBoxes

void COptionPluginPage::ApplyComboBoxes ( void )
{
	for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++)
	{
		CModifiedComboBox * ComboBox = cb_iter->second;
		if (ComboBox->IsChanged())
		{
			int index = ComboBox->GetCurSel();
			if (index == CB_ERR) 
			{
				return; 
			}

			const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index);
			if (PluginPtr == NULL)
			{
				return;
			}

			const CPluginList::PLUGIN * Plugin = *PluginPtr;

			g_Settings->SaveString(cb_iter->first,Plugin->FileName.c_str());
			switch (Plugin->Info.Type)
			{
			case PLUGIN_TYPE_RSP:        g_Settings->SaveBool(Plugin_RSP_Changed,true); break;
			case PLUGIN_TYPE_GFX:        g_Settings->SaveBool(Plugin_GFX_Changed,true); break;
			case PLUGIN_TYPE_AUDIO:      g_Settings->SaveBool(Plugin_AUDIO_Changed,true); break;
			case PLUGIN_TYPE_CONTROLLER: g_Settings->SaveBool(Plugin_CONT_Changed,true); break;
			default:
				g_Notify->BreakPoint(__FILE__,__LINE__);
			}
		}
		if (ComboBox->IsReset())
		{
			g_Settings->DeleteSetting(cb_iter->first);
			ComboBox->SetReset(false);
		}
	}
}
开发者ID:YNG,项目名称:project64,代码行数:39,代码来源:Settings+Page+-+Plugin.cpp

示例6: PluginItemChanged

void COptionPluginPage::PluginItemChanged(int id, int AboutID, bool bSetChanged)
{
    CModifiedComboBox * ComboBox = NULL;
    for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter++)
    {
        if ((int)(cb_iter->second->GetMenu()) != id)
        {
            continue;
        }
        ComboBox = cb_iter->second;
        break;
    }
    if (ComboBox == NULL)
    {
        return;
    }

    int index = ComboBox->GetCurSel();
    if (index == CB_ERR)
    {
        return;
    }
    const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index);
    if (PluginPtr)
    {
        const CPluginList::PLUGIN * Plugin = *PluginPtr;
        if (Plugin)
        {
            ::EnableWindow(GetDlgItem(AboutID), Plugin->AboutFunction);
        }
    }

    if (bSetChanged)
    {
        ComboBox->SetChanged(true);
        SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
    }
}
开发者ID:cxd4,项目名称:project64,代码行数:38,代码来源:SettingsPage-Plugin.cpp


注:本文中的CModifiedComboBox::GetItemDataPtr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。