本文整理汇总了C++中CButton::SetBitmap方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::SetBitmap方法的具体用法?C++ CButton::SetBitmap怎么用?C++ CButton::SetBitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::SetBitmap方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NuevoGrupoControles
void CGestionMineralesDlg::NuevoGrupoControles(int nIndice)
{
const unsigned __int8 nFilasMax = 20;
const unsigned __int8 nTamCheck = 15;
const unsigned __int8 nEspaciado = 25;
const unsigned __int8 nDistanciaColumnas = 200;
const unsigned __int8 nSangriaInicial = 40;
const unsigned __int8 nTamBotones = 15;
const unsigned __int8 nEspaciadoBotones = 25;
// lista para enlazar los indices iniciales con los reales de los vectores
//m_vecMap.push_back(nIndice);
unsigned int fila, columna;
CButton* pButton;
CString csInfo;
HBITMAP hBitmapEditar= (HBITMAP) m_bitmapEditar.GetSafeHandle();
HBITMAP hBitmapBorrar= (HBITMAP) m_bitmapBorrar.GetSafeHandle();
fila = nIndice % nFilasMax;
columna = nIndice / nFilasMax;
csInfo.Format("%-4s - %s",theApp.m_minerales.GetAbreviatura(nIndice), theApp.m_minerales.GetNombre(nIndice));
// Delete
pButton = new CButton;
pButton->Create("x",WS_CHILD | WS_VISIBLE |BS_BITMAP/*| BS_LEFTTEXT*/,
CRect(nSangriaInicial + columna*(nDistanciaColumnas+nEspaciadoBotones*2),
m_rect.bottom + nEspaciado*fila,
nSangriaInicial + columna*(nDistanciaColumnas+nEspaciadoBotones*2) + nTamBotones,
m_rect.bottom + nEspaciado*fila + nTamBotones ), this, CONTROLES_DINAMICOS_MIN + nIndice*3 +2);
pButton->SetBitmap(hBitmapBorrar);
m_vecDelete.push_back(pButton);
//Edit
pButton = new CButton;
pButton->Create("e",WS_CHILD | WS_VISIBLE |BS_BITMAP /*| BS_LEFTTEXT*/,
CRect(nSangriaInicial + columna*(nDistanciaColumnas+nEspaciadoBotones*2)+ nEspaciadoBotones,
m_rect.bottom + nEspaciado*fila,
nSangriaInicial + columna*(nDistanciaColumnas+nEspaciadoBotones*2)+ nEspaciadoBotones + nTamBotones,
m_rect.bottom + nTamBotones + nEspaciado*fila), this, CONTROLES_DINAMICOS_MIN + nIndice*3 +1);
pButton->SetBitmap(hBitmapEditar);
m_vecEdit.push_back(pButton);
//Check
pButton = new CButton;
pButton->Create(csInfo,WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX /*| BS_LEFTTEXT*/,
CRect(nSangriaInicial + columna*(nDistanciaColumnas+nEspaciadoBotones*2)+ nEspaciadoBotones*2,
m_rect.bottom + nEspaciado*fila,
nSangriaInicial + columna*(nDistanciaColumnas+nEspaciadoBotones*2)+ nEspaciadoBotones*2 + nDistanciaColumnas,
m_rect.bottom + nTamCheck + nEspaciado*fila), this, CONTROLES_DINAMICOS_MIN + nIndice*3);
pButton->SetCheck(theApp.m_minerales.m_list[nIndice]->m_bActivo);
m_vecCheck.push_back(pButton);
this->SetWindowPos(NULL,0,0,max(nSangriaInicial + columna*(nDistanciaColumnas+nEspaciadoBotones*2)+ nEspaciadoBotones*2 + nDistanciaColumnas + 50, m_rect.right),
m_rect.bottom + nTamCheck + nEspaciado*nFilasMax + 50, SWP_NOMOVE | SWP_NOZORDER); //+50 para el menu y barra de titulo
}
示例2:
BOOL CQSV2FLVDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // 设置大图标
SetIcon(m_hIcon, FALSE); // 设置小图标
// TODO: 在此添加额外的初始化代码
CString szTitle = _T("QSV2FLV ");
szTitle += STR_VERSION;
SetWindowText(szTitle);
m_bmpFold.LoadBitmap(IDB_BITMAP1);
CButton* pCtrl = (CButton*)GetDlgItem(IDC_BTN_PATH);
pCtrl->SetBitmap(m_bmpFold);
//设置列表
m_ctrlList.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
//插入列,序号,名称,对齐,列宽
m_ctrlList.InsertColumn(1,_T("序号"),LVCFMT_CENTER, 36);
m_ctrlList.InsertColumn(1,_T("文件"),LVCFMT_LEFT,400);
m_ctrlList.InsertColumn(2,_T("状态"),LVCFMT_LEFT,80);
//初始化工作线程
m_pWorkThread = ::GetWorkThread();
m_pWorkThread->SetHandleWnd(this);
SetWindowPos(&CWnd::wndTopMost, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE);
PostMessage(WM_TIMER, 0, 0);
return TRUE;
}
示例3: OnInitDialog
BOOL CCanvasRotateDlg::OnInitDialog()
{
CDialog::OnInitDialog();
BmpAnti90.LoadBitmap(IDB_BITMAP_ANTI90);
Bmp180.LoadBitmap(IDB_BITMAP_180);
BmpClock90.LoadBitmap(IDB_BITMAP_CLOCK90);
CButton *pButton = (CButton*)GetDlgItem(IDC_BUTTON_ANTI90);
pButton->SetBitmap((HBITMAP)BmpAnti90.GetSafeHandle());
pButton = (CButton*)GetDlgItem(IDC_BUTTON_CLOCK90);
pButton->SetBitmap((HBITMAP)BmpClock90.GetSafeHandle());
pButton = (CButton*)GetDlgItem(IDC_BUTTON_180);
pButton->SetBitmap((HBITMAP)Bmp180.GetSafeHandle());
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例4: InitButtonBitmap
void CImageViewerBar::InitButtonBitmap()
{
UINT i = 0;
CButton *pBut = NULL;
for (i = 0; i < 6; i++)
{
pBut = (CButton *)GetDlgItem(IDC_BUT1+i);
ASSERT(NULL != pBut);
pBut->SetBitmap(LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP1+i)));
}
}
示例5: ColorButtons
void CLightDlg::ColorButtons() {
CRect r;
CClientDC dc(this);
CButton *pBtn = (CButton *)GetDlgItem(IDC_BTN_COLOR);
pBtn->GetClientRect(&r);
colorBitmap.DeleteObject();
colorBitmap.CreateCompatibleBitmap(&dc, r.Width(), r.Height());
CDC MemDC;
MemDC.CreateCompatibleDC(&dc);
CBitmap *pOldBmp = MemDC.SelectObject(&colorBitmap);
{
CBrush br(RGB(color[0], color[1], color[2]));
MemDC.FillRect(r,&br);
}
dc.SelectObject(pOldBmp);
pBtn->SetBitmap(HBITMAP(colorBitmap));
}
示例6: OnInitDialog
BOOL CAVCameraDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
// 执行此操作
SetIcon(m_hIcon, TRUE); // 设置大图标
SetIcon(m_hIcon, FALSE); // 设置小图标
CButton* pButton = (CButton*)GetDlgItem(IDC_BUTTON_START);
ASSERT(pButton);
pButton->ModifyStyle(0, BS_BITMAP);
pButton->SetBitmap(LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PNG_START)));
// TODO: 在此添加额外的初始化代码
_dc = GetDlgItem(IDC_VIDEO_PLAYBACK)->GetDC();
_camera.refresh_sign.connect(boost::bind(&CAVCameraDlg::UpdateVideoFrame, this));
UpdateStatus(VideoMgr::CREATED);
return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
}
示例7: OnInitDialog
//.........这里部分代码省略.........
for (std::vector<std::wstring>::iterator iter = vGroups.begin();
iter != vGroups.end(); ++iter) {
m_ex_group.AddString(iter->c_str());
}
// Make sure Group combobox is wide enough
SetGroupComboBoxWidth();
size_t num_unkwn(0);
if (M_uicaller() != IDS_ADDENTRY)
num_unkwn = M_pci()->NumberUnknownFields();
if (num_unkwn > 0) {
CString cs_text;
cs_text.Format(IDS_RECORDUNKNOWNFIELDS, num_unkwn);
GetDlgItem(IDC_RECORDUNKNOWNFIELDS)->SetWindowText(cs_text);
GetDlgItem(IDC_RECORDUNKNOWNFIELDS)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_STATIC_RECORDUNKNOWNFIELDS)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_STATICGROUPRUNKNFLDS)->ShowWindow(SW_SHOW);
} else {
GetDlgItem(IDC_RECORDUNKNOWNFIELDS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATIC_RECORDUNKNOWNFIELDS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATICGROUPRUNKNFLDS)->ShowWindow(SW_HIDE);
}
// Note shortcuts have their own dialog for edit.
CString cs_text;
if (M_original_entrytype() == CItemData::ET_ALIASBASE ||
M_original_entrytype() == CItemData::ET_SHORTCUTBASE) {
// Show button to allow users to view dependents
cs_text.LoadString(M_original_entrytype() == CItemData::ET_ALIASBASE ?
IDS_VIEWALIASESBTN : IDS_VIEWSHORTCUTSBTN);
GetDlgItem(IDC_VIEWDEPENDENTS)->SetWindowText(cs_text);
GetDlgItem(IDC_VIEWDEPENDENTS)->ShowWindow(SW_SHOW);
cs_text.LoadString(M_original_entrytype() == CItemData::ET_ALIASBASE ?
IDS_ISANALIASBASE : IDS_ISASHORTCUTBASE);
GetDlgItem(IDC_STATIC_ISANALIAS)->SetWindowText(cs_text);
GetDlgItem(IDC_STATIC_ISANALIAS)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_MYBASE)->ShowWindow(SW_HIDE);
} else if (M_original_entrytype() == CItemData::ET_ALIAS) {
// Update password to alias form
// Show text stating that it is an alias
M_realpassword() = M_oldRealPassword() = m_password = m_password2 = M_base();
GetDlgItem(IDC_VIEWDEPENDENTS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_MYBASE)->SetWindowText(M_base());
GetDlgItem(IDC_STATIC_ISANALIAS)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_MYBASE)->ShowWindow(SW_SHOW);
} else if (M_original_entrytype() == CItemData::ET_NORMAL) {
// Normal - do none of the above
GetDlgItem(IDC_VIEWDEPENDENTS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATIC_ISANALIAS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_MYBASE)->ShowWindow(SW_HIDE);
}
if (prefs->GetPref(PWSprefs::ShowPWDefault)) {
ShowPassword();
} else {
HidePassword();
}
if (prefs->GetPref(PWSprefs::ShowNotesDefault)) {
ShowNotes();
} else {
HideNotes();
m_ex_notes.EnableMenuItem(PWS_MSG_CALL_NOTESZOOMIN, false);
m_ex_notes.EnableMenuItem(PWS_MSG_CALL_NOTESZOOMOUT, false);
}
CHARFORMAT cf = {0};
cf.cbSize = sizeof(cf);
m_ex_notes.SetSel(0, -1);
m_ex_notes.SendMessage(EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
m_iPointSize = cf.yHeight / 20;
// Set initial Word Wrap
m_ex_notes.SetTargetDevice(NULL, m_bWordWrap ? 0 : 1);
m_ex_notes.UpdateState(PWS_MSG_EDIT_WORDWRAP, m_bWordWrap);
// Load copy password bitmap
UINT nImageID = PWSprefs::GetInstance()->GetPref(PWSprefs::UseNewToolbar) ?
IDB_COPYPASSWORD_NEW : IDB_COPYPASSWORD_CLASSIC;
BOOL brc = m_CopyPswdBitmap.Attach(::LoadImage(
::AfxFindResourceHandle(MAKEINTRESOURCE(nImageID), RT_BITMAP),
MAKEINTRESOURCE(nImageID), IMAGE_BITMAP, 0, 0,
(LR_DEFAULTSIZE | LR_CREATEDIBSECTION | LR_SHARED)));
ASSERT(brc);
if (brc) {
FixBitmapBackground(m_CopyPswdBitmap);
CButton *pBtn = (CButton *)GetDlgItem(IDC_COPYPASSWORD);
ASSERT(pBtn != NULL);
if (pBtn != NULL)
pBtn->SetBitmap(m_CopyPswdBitmap);
}
UpdateData(FALSE);
m_bInitdone = true;
return TRUE;
}
示例8: OnInitDialog
//.........这里部分代码省略.........
m_pToolTipCtrl->AddTool(GetDlgItem(IDC_COPYPASSWORD), cs_ToolTip);
cs_ToolTip.LoadString(IDS_CLICKTOLISTENTRIES);
m_pToolTipCtrl->AddTool(GetDlgItem(IDC_POLICYLIST), cs_ToolTip);
if (!m_bReadOnly) {
cs_ToolTip.LoadString(IDS_CANCELPOLICYCHANGES);
m_pToolTipCtrl->AddTool(GetDlgItem(IDCANCEL), cs_ToolTip);
cs_ToolTip.LoadString(IDS_SAVEPOLICYCHANGES);
m_pToolTipCtrl->AddTool(GetDlgItem(IDOK), cs_ToolTip);
}
}
DWORD dwStyle = m_PolicyNames.GetExtendedStyle();
dwStyle |= (LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
m_PolicyNames.SetExtendedStyle(dwStyle);
dwStyle = m_PolicyEntries.GetExtendedStyle();
dwStyle |= (LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
m_PolicyEntries.SetExtendedStyle(dwStyle);
// Override default HeaderCtrl ID of 0
m_PolicyNames.GetHeaderCtrl()->SetDlgCtrlID(IDC_POLICYNAMES_HEADER);
m_PolicyEntries.GetHeaderCtrl()->SetDlgCtrlID(IDC_POLICYENTRIES_HEADER);
// BR1108 - Allow user to config these fonts as well
// Currently use same font as specified for list/tree view
m_PolicyNames.SetFont(Fonts::GetInstance()->GetCurrentFont());
m_PolicyDetails.SetFont(Fonts::GetInstance()->GetCurrentFont());
CString cs_text;
// Add columns
cs_text.LoadString(IDS_POLICYNAME);
m_PolicyNames.InsertColumn(0, cs_text);
cs_text.LoadString(IDS_USECOUNT);
m_PolicyNames.InsertColumn(1, cs_text, LVCFMT_CENTER);
UpdateNames();
// Select default == current database
m_iSelectedItem = 0;
m_PolicyNames.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);
// Add columns to policy details CListCtrl - Name and value
cs_text.LoadString(IDS_POLICYFIELD);
m_PolicyDetails.InsertColumn(0, cs_text, LVCFMT_CENTER);
cs_text.LoadString(IDS_VALUE);
m_PolicyDetails.InsertColumn(1, cs_text, LVCFMT_LEFT);
// Add columns to policy entries CListCtrl - Group, Title, Username
cs_text.LoadString(IDS_GROUP);
m_PolicyEntries.InsertColumn(0, cs_text, LVCFMT_CENTER);
cs_text.LoadString(IDS_TITLE);
m_PolicyEntries.InsertColumn(1, cs_text, LVCFMT_LEFT);
cs_text.LoadString(IDS_USERNAME);
m_PolicyEntries.InsertColumn(2, cs_text, LVCFMT_LEFT);
m_bViewPolicy = true;
// Show its details
UpdateDetails();
// Since we select the default, disable List & Delete
GetDlgItem(IDC_LIST_POLICYENTRIES)->EnableWindow(FALSE);
GetDlgItem(IDC_DELETE)->EnableWindow(FALSE);
Fonts::GetInstance()->ApplyPasswordFont(GetDlgItem(IDC_PASSWORD));
m_ex_password.SetSecure(false);
// Remove password character so that the password is displayed
m_ex_password.SetPasswordChar(0);
// Max. of 255 policy names allowed - only 2 hex digits used for number
if (m_MapPSWDPLC.size() >= 255)
GetDlgItem(IDC_NEW)->EnableWindow(FALSE);
// Load bitmap
BOOL brc;
UINT nImageID = PWSprefs::GetInstance()->GetPref(PWSprefs::UseNewToolbar) ?
IDB_COPYPASSWORD_NEW : IDB_COPYPASSWORD_CLASSIC;
brc = m_CopyPswdBitmap.Attach(::LoadImage(
::AfxFindResourceHandle(MAKEINTRESOURCE(nImageID), RT_BITMAP),
MAKEINTRESOURCE(nImageID), IMAGE_BITMAP, 0, 0,
(LR_DEFAULTSIZE | LR_CREATEDIBSECTION | LR_SHARED)));
ASSERT(brc);
if (brc) {
FixBitmapBackground(m_CopyPswdBitmap);
CButton *pBtn = (CButton *)GetDlgItem(IDC_COPYPASSWORD);
ASSERT(pBtn != NULL);
if (pBtn != NULL)
pBtn->SetBitmap(m_CopyPswdBitmap);
}
// No changes yet
GetDlgItem(IDC_UNDO)->EnableWindow(FALSE);
GetDlgItem(IDC_REDO)->EnableWindow(FALSE);
// Set focus on the policy names CListCtrl and so return FALSE
m_PolicyNames.SetFocus();
return FALSE;
}
示例9: OnInitDialog
//.........这里部分代码省略.........
pOK->GetWindowRect(&rcOK);
ScreenToClient(&rcOK);
int top = rcOK.top;
pOK->GetClientRect(&rcOK);
int left = (rc.right - rcOK.right) / 2;
pOK->MoveWindow(left, top, rcOK.right, rcOK.bottom);
CString cs_close(MAKEINTRESOURCE(IDS_CLOSE));
pOK->SetWindowText(cs_close);
// Hide the Cancel & Help buttons
GetDlgItem(IDCANCEL)->EnableWindow(FALSE);
GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
GetDlgItem(ID_HELP)->EnableWindow(FALSE);
GetDlgItem(ID_HELP)->ShowWindow(SW_HIDE);
Fonts::GetInstance()->ApplyPasswordFont(GetDlgItem(IDC_PASSWORD));
m_ex_password.SetSecure(false);
// Remove password character so that the password is displayed
m_ex_password.SetPasswordChar(0);
// Load bitmap
UINT nImageID = PWSprefs::GetInstance()->GetPref(PWSprefs::UseNewToolbar) ?
IDB_COPYPASSWORD_NEW : IDB_COPYPASSWORD_CLASSIC;
BOOL brc = m_CopyPswdBitmap.Attach(::LoadImage(
::AfxFindResourceHandle(MAKEINTRESOURCE(nImageID), RT_BITMAP),
MAKEINTRESOURCE(nImageID), IMAGE_BITMAP, 0, 0,
(LR_DEFAULTSIZE | LR_CREATEDIBSECTION | LR_SHARED)));
ASSERT(brc);
FixBitmapBackground(m_CopyPswdBitmap);
CButton *pBtn = (CButton *)GetDlgItem(IDC_COPYPASSWORD);
pBtn->SetBitmap(m_CopyPswdBitmap);
break;
}
case IDS_PSWDPOLICY:
// Set correct window title
cs_title.LoadString(m_policyname.IsEmpty() ? IDS_ADD_NAMED_POLICY : IDS_EDIT_NAMED_POLICY);
SetWindowText(cs_title);
// These are only used in Manage -> Password Policy
GetDlgItem(IDC_GENERATEPASSWORD)->EnableWindow(FALSE);
GetDlgItem(IDC_GENERATEPASSWORD)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_COPYPASSWORD)->EnableWindow(FALSE);
GetDlgItem(IDC_COPYPASSWORD)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_PASSWORD)->EnableWindow(FALSE);
GetDlgItem(IDC_PASSWORD)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_POLICYLIST)->EnableWindow(FALSE);
GetDlgItem(IDC_POLICYLIST)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_USENAMED_POLICY)->EnableWindow(FALSE);
GetDlgItem(IDC_USENAMED_POLICY)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATIC_NAMEDPOLICY)->ShowWindow(SW_SHOW);
if (!m_policyname.IsEmpty() && m_iter->second.usecount > 0) {
// Cannot edit the policy 'Name' if it is present and use count > 0
m_PolicyNameEdit.SetReadOnly(TRUE);
m_PolicyNameEdit.EnableWindow(FALSE);
}
m_PolicyNameEdit.SetWindowText(m_policyname);
// Max. length of policy name is 255 - only one byte used for length
// in database header
m_PolicyNameEdit.SetLimitText(255);
break;
示例10: OnInitDialog
//.........这里部分代码省略.........
gen2Rel = GetDlgItem(IDC_MOD1_RELEASE);
gen2End = GetDlgItem(IDC_MOD1_END);
gen2MulEd = GetDlgItem(IDC_M1M_EDIT);
gen2NdxEd = GetDlgItem(IDC_M1I_EDIT);
gen2AtkEd = GetDlgItem(IDC_M1A_EDIT);
gen2PckEd = GetDlgItem(IDC_M1P_EDIT);
gen2DecEd = GetDlgItem(IDC_M1D_EDIT);
gen2SusEd = GetDlgItem(IDC_M1S_EDIT);
gen2RelEd = GetDlgItem(IDC_M1R_EDIT);
gen2EndEd = GetDlgItem(IDC_M1E_EDIT);
InitValue(gen2Mul, gen2MulEd, 0, 100, 10);
InitValue(gen2Ndx, gen2NdxEd, 0, 500, 50);
InitValue(gen2Pck, gen2PckEd, 0, 500, 50);
InitValue(gen2Sus, gen2SusEd, 0, 500, 50);
InitValue(gen2End, gen2EndEd, 0, 500, 50);
InitValue(gen2Atk, gen2AtkEd, 0, 4000, 400);
InitValue(gen2Dec, gen2DecEd, 0, 4000, 400);
InitValue(gen2Rel, gen2RelEd, 0, 4000, 400);
gen3Mul = GetDlgItem(IDC_MOD2_MULT);
gen3Ndx = GetDlgItem(IDC_MOD2_START);
gen3Atk = GetDlgItem(IDC_MOD2_ATTACK);
gen3Pck = GetDlgItem(IDC_MOD2_PEAK);
gen3Dec = GetDlgItem(IDC_MOD2_DECAY);
gen3Sus = GetDlgItem(IDC_MOD2_SUSTAIN);
gen3Rel = GetDlgItem(IDC_MOD2_RELEASE);
gen3End = GetDlgItem(IDC_MOD2_END);
gen3MulEd = GetDlgItem(IDC_M2M_EDIT);
gen3NdxEd = GetDlgItem(IDC_M2I_EDIT);
gen3AtkEd = GetDlgItem(IDC_M2A_EDIT);
gen3PckEd = GetDlgItem(IDC_M2P_EDIT);
gen3DecEd = GetDlgItem(IDC_M2D_EDIT);
gen3SusEd = GetDlgItem(IDC_M2S_EDIT);
gen3RelEd = GetDlgItem(IDC_M2R_EDIT);
gen3EndEd = GetDlgItem(IDC_M2E_EDIT);
InitValue(gen3Mul, gen3MulEd, 0, 100, 10);
InitValue(gen3Ndx, gen3NdxEd, 0, 500, 50);
InitValue(gen3Pck, gen3PckEd, 0, 500, 50);
InitValue(gen3Sus, gen3SusEd, 0, 500, 50);
InitValue(gen3End, gen3EndEd, 0, 500, 50);
InitValue(gen3Atk, gen3AtkEd, 0, 4000, 400);
InitValue(gen3Dec, gen3DecEd, 0, 4000, 400);
InitValue(gen3Rel, gen3RelEd, 0, 4000, 400);
durValEd = GetDlgItem(IDC_DUR_EDIT);
durValEd.SetWindowText("4.0");
volValEd = GetDlgItem(IDC_VOL);
volValEd.SetWindowText("0.707");
btnPlay = GetDlgItem(IDC_PLAY);
btnLoop = GetDlgItem(IDC_LOOP);
btnStop = GetDlgItem(IDC_STOP);
RECT btnrc;
btnPlay.GetClientRect(&btnrc);
int cxy;
if ((btnrc.bottom - btnrc.top) < 30)
cxy = 16;
else
cxy = 32;
hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_PLAY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
btnPlay.SetIcon(hIcon);
hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_LOOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
btnLoop.SetIcon(hIcon);
hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
btnStop.SetIcon(hIcon);
btnStop.EnableWindow(FALSE);
CButton btnStyle;
HBITMAP bm;
btnStyle = GetDlgItem(IDC_STACK);
bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_STACK), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
btnStyle.SetBitmap(bm);
btnStyle.SetCheck(BST_CHECKED);
btnStyle = GetDlgItem(IDC_STACK2);
bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_STACK2), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
btnStyle.SetBitmap(bm);
btnStyle = GetDlgItem(IDC_WYE);
bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_WYE), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
btnStyle.SetBitmap(bm);
btnStyle = GetDlgItem(IDC_DELTA);
bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_DELTA), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
btnStyle.SetBitmap(bm);
btnStyle = GetDlgItem(IDC_COPY_CLIP);
hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_COPY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
btnStyle.SetIcon(hIcon);
btnStyle = GetDlgItem(IDC_SAVE);
hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_WVFILE), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
btnStyle.SetIcon(hIcon);
btnStyle = GetDlgItem(IDC_HELP2);
hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_HELP2), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
btnStyle.SetIcon(hIcon);
SetPreset(&resetParams);
return TRUE;
}
示例11: onInitDialog
//.........这里部分代码省略.........
m_ctrlToolTip.Create(EmoticonsDlg::m_hWnd, rcDefault, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_BALLOON, WS_EX_TOPMOST);
m_ctrlToolTip.SetDelayTime(TTDT_AUTOMATIC, 1000);
pos.left = 0;
pos.right = iSW + EMOTICONS_ICONMARGIN;
pos.top = 0;
pos.bottom = iSH + EMOTICONS_ICONMARGIN;
cleanHandleList();
auto l_Emotion = Emoticons.begin();
for (unsigned int iY = 0; iY < nYfor; iY++)
for (unsigned int iX = 0; iX < nXfor; iX++)
{
if (l_Emotion != Emoticons.end()) // TODO - merge
{
const auto i = *l_Emotion;
if ((iY * nXfor) + iX + 1 > l_Emoticons_size) break;
bool bNotDuplicated = (bUseAnimation ?
(i->getEmotionBmpPath() != lastEmotionPath ||
i->getEmotionGifPath() != lastAnimEmotionPath) :
i->getEmotionBmpPath() != lastEmotionPath);
// dve stejne emotikony za sebou nechceme
if (bNotDuplicated)
{
bool bCreated = false;
CGDIImage *pImage = nullptr;
if (bUseAnimation)
pImage = i->getAnimatedImage(MainFrame::getMainFrame()->m_hWnd, WM_ANIM_CHANGE_FRAME);
if (pImage)
{
const tstring smajl = i->getEmotionText();
CAnimatedButton *pemoButton = new CAnimatedButton(pImage);
m_BtnList.push_back(pemoButton);
pemoButton->Create(EmoticonsDlg::m_hWnd, pos, smajl.c_str(), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_FLAT | BS_BITMAP, WS_EX_TRANSPARENT);
m_ctrlToolTip.AddTool(*pemoButton, smajl.c_str());
bCreated = true;
}
else
{
if (const HBITMAP l_h_bm = i->getEmotionBmp(GetSysColor(COLOR_BTNFACE)))
{
CButton emoButton;
const tstring smajl = i->getEmotionText();
emoButton.Create(EmoticonsDlg::m_hWnd, pos, smajl.c_str(), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_FLAT | BS_BITMAP | BS_CENTER);
m_HandleList.push_back(l_h_bm);
emoButton.SetBitmap(l_h_bm);
m_ctrlToolTip.AddTool(emoButton, smajl.c_str());
DeleteObject((HGDIOBJ)emoButton);
bCreated = true;
}
}
if (bCreated)
{
// Calculate position of next button
pos.left = pos.left + iSW + EMOTICONS_ICONMARGIN;
pos.right = pos.left + iSW + EMOTICONS_ICONMARGIN;
if (pos.left >= (LONG)(nX * (iSW + EMOTICONS_ICONMARGIN)))
{
pos.left = 0;
pos.right = iSW + EMOTICONS_ICONMARGIN;
pos.top = pos.top + iSH + EMOTICONS_ICONMARGIN;
pos.bottom = pos.top + iSH + EMOTICONS_ICONMARGIN;
}
}
}
lastEmotionPath = i->getEmotionBmpPath();
if (bUseAnimation)
lastAnimEmotionPath = i->getEmotionGifPath();
++l_Emotion;
}
}
pos.left = -128;
pos.right = pos.left;
pos.top = -128;
pos.bottom = pos.top;
CButton emoButton;
emoButton.Create(EmoticonsDlg::m_hWnd, pos, _T(""), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_FLAT);
emoButton.SetFocus();
DeleteObject((HGDIOBJ)emoButton);
ShowWindow(SW_SHOW);
for (auto i = m_BtnList.cbegin(); i != m_BtnList.cend(); ++i)
{
(*i)->Update();
}
}
else PostMessage(WM_CLOSE);
return 0;
}