本文整理汇总了C++中CModifiedButton类的典型用法代码示例。如果您正苦于以下问题:C++ CModifiedButton类的具体用法?C++ CModifiedButton怎么用?C++ CModifiedButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CModifiedButton类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectDirectory
void COptionsDirectoriesPage::SelectDirectory(LanguageStringID Title, CModifiedEditBox & EditBox, CModifiedButton & Default, CModifiedButton & selected)
{
wchar_t Buffer[MAX_PATH], Directory[MAX_PATH];
LPITEMIDLIST pidl;
BROWSEINFOW bi;
stdstr InitialDir = EditBox.GetWindowText();
bi.hwndOwner = m_hWnd;
bi.pidlRoot = NULL;
bi.pszDisplayName = Buffer;
bi.lpszTitle = GS(Title);
bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
bi.lpfn = (BFFCALLBACK)SelectDirCallBack;
bi.lParam = (DWORD)InitialDir.c_str();
if ((pidl = SHBrowseForFolderW(&bi)) != NULL)
{
if (SHGetPathFromIDListW(pidl, Directory))
{
stdstr path;
CPath SelectedDir(path.FromUTF16(Directory), "");
EditBox.SetChanged(true);
EditBox.SetWindowText(SelectedDir);
Default.SetChanged(true);
Default.SetCheck(BST_UNCHECKED);
selected.SetCheck(BM_SETCHECK);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
}
}
}
示例2: UseSelectedClicked
void COptionsDirectoriesPage::UseSelectedClicked(UINT /*Code*/, int id, HWND /*ctl*/)
{
CModifiedButton * Button = NULL;
switch (id)
{
case IDC_PLUGIN_DEFAULT: Button = &m_PluginDefault; break;
case IDC_PLUGIN_OTHER: Button = &m_PluginDefault; break;
case IDC_AUTO_DEFAULT: Button = &m_AutoSaveDefault; break;
case IDC_AUTO_OTHER: Button = &m_AutoSaveDefault; break;
case IDC_INSTANT_DEFAULT: Button = &m_InstantDefault; break;
case IDC_INSTANT_OTHER: Button = &m_InstantDefault; break;
case IDC_SNAP_DEFAULT: Button = &m_ScreenShotDefault; break;
case IDC_SNAP_OTHER: Button = &m_ScreenShotDefault; break;
case IDC_TEXTURE_DEFAULT: Button = &m_TextureDefault; break;
case IDC_TEXTURE_OTHER: Button = &m_TextureDefault; break;
}
if (Button == NULL)
{
return;
}
if (!Button->IsChanged() || Button->IsReset())
{
if ((int)Button->GetMenu() == id)
{
return;
}
}
Button->SetChanged(true);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
}
示例3: ResetDefaultSelected
void COptionsDirectoriesPage::ResetDefaultSelected(CModifiedButton & ButtonDefault, CModifiedButton & ButtonSelected, SettingID Type)
{
if (!ButtonDefault.IsChanged())
{
return;
}
bool UseSelected;
g_Settings->LoadDefaultBool(Type, UseSelected);
ButtonDefault.SetCheck(!UseSelected);
ButtonSelected.SetCheck(UseSelected);
ButtonDefault.SetReset(true);
}
示例4: UpdateDefaultSelected
void COptionsDirectoriesPage::UpdateDefaultSelected(CModifiedButton & Button, SettingID Type)
{
if (Button.IsChanged())
{
bool bUseSelected = (Button.GetCheck() & BST_CHECKED) == 0;
g_Settings->SaveBool(Type, bUseSelected);
if (Type == Directory_TextureUseSelected && !bUseSelected)
{
g_Settings->DeleteSetting(Directory_TextureSelected);
}
}
if (Button.IsReset())
{
g_Settings->DeleteSetting(Type);
}
}
示例5: HleAudioChanged
void COptionPluginPage::HleAudioChanged(UINT /*Code*/, int id, HWND /*ctl*/)
{
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)
{
CModifiedButton * Button = iter->second;
if ((int)Button->GetMenu() != id)
{
continue;
}
if ((Button->GetCheck() & BST_CHECKED) != 0)
{
int res = MessageBoxW(m_hWnd, wGS(MSG_SET_HLE_AUD_MSG).c_str(), wGS(MSG_SET_HLE_AUD_TITLE).c_str(), MB_ICONWARNING | MB_YESNO);
if (res != IDYES)
{
Button->SetCheck(BST_UNCHECKED);
return;
}
}
Button->SetChanged(true);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
break;
}
}