|
Can´t compile the Sample with VS2010.
Something seems to be wrong with ::~CMemDC
1>nafxcw.lib(afxglobals.obj) : error LNK2005: "public: virtual __thiscall CMemDC::~CMemDC(void)" (??1CMemDC@@UAE@XZ) ist bereits in XPButton.obj definiert.
1>.\Release\xpbtn.exe : fatal error LNK1169: Mindestens ein mehrfach definiertes Symbol gefunden.
How to fix this ?
|
|
|
|
|
Rename the "CMemDC" , e.g. CMemDC1
I guess because there is already a class named "CMemDC" without the XPButton files .
If you add the XPButton files to the project , it says "redifinition" or something similar due to my compile result .
|
|
|
|
|
As was said before, when you use a non white color background, the round rectangle button drawn by this CXPButton class is stil visible in a non-rounded white rectangular frame...
Is there a way to handle that so that the frame is also rounded and XPstyle on such a different colored background?
|
|
|
|
|
great work....Congragulations
|
|
|
|
|
My sincere apologies, i was not using CDialog::OnInitDialog(); in my implimentation.
Cheers,
Mujeeb.
|
|
|
|
|
The button is really nice, Appreciate you for that..
I am facing a small problem with this XP-style button, this works fine for any dialog, but when i add the event handler, InitDialog, the button looses the xp-style.
Please help...
Mujeeb Ahmed.
|
|
|
|
|
I can see many CXPButton ,but no CXPEdit.Who has it,can he send to me ?Thank you.:->
Don't ask.Just do it!
|
|
|
|
|
|
Hi
nice buttons, but when I convert my existing ones to XPButtons, the tooltips which worked previously when hovering over the buttons, no longer work. Is there a way to fix this ?
|
|
|
|
|
good job!
The four corners of the button have not deal to transparent.
so i put the button on the window with colors backgroud, the button will not so nice.
TKS!
Harbor Hu
|
|
|
|
|
how did you fix this bug?
|
|
|
|
|
vjairamDoes any have fix for this
|
|
|
|
|
Hi
The XP-style Button Control is fine, the problem is, only the Buttons show in XP-style, but what bout the other controls like the Edit box, List controls and other dialog box controls, they are still in the old style...
Can anyone tell me how to change the other controls to XP-style, so that the dialog box doesn't looks odd.
Thanks and Regards
Manoj Singh
|
|
|
|
|
If I create XP buttons in my own workspace I can't see the buttons but I can click on it. What's wrong?
|
|
|
|
|
void yourbuttonclass::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
...
GetWindowText(strText);
CFont* oldFont = pDC->SelectObject(GetParent()->GetFont());
...
pDC->SelectObject(oldFont);
return;
}
|
|
|
|
|
void yourbuttonclass::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
...
GetWindowText(strText);
CFont* oldFont = pDC->SelectObject(GetParent()->GetFont());
...
pDC->SelectObject(oldFont);
return;
}
|
|
|
|
|
I found a little bug in this control; here's what I changed:
1) i did not want the BOLD font, so used another font, but that's personal...
2) if you use '&Ok' to underline the O of 'Ok', it works okay for disabled buttons, not for enabled. This code fixes that bug.
Ivo
// Draw the text
if (!m_title.IsEmpty()/*!strText.IsEmpty()*/)
{
CFont *oldFont=(CFont*)pDC->SelectStockObject(DEFAULT_GUI_FONT);
CString displayName=m_title;
displayName.Remove('&');
CSize Extent = pDC->GetTextExtent(displayName/*strText*/);
CPoint pt( rect.CenterPoint().x - Extent.cx/2,
rect.CenterPoint().y - Extent.cy/2 );
if (state & ODS_SELECTED)
pt.Offset(1,1);
int nMode = pDC->SetBkMode(TRANSPARENT);
//pOldPen = pDC->SelectObject(pBoundryPen);
//CFont *pOldFont = SelectStockFont( pDC );
if (state & ODS_DISABLED)
pDC->DrawState(pt, Extent, m_title/*strCaption*/, DSS_DISABLED, TRUE, 0, (HBRUSH)NULL);
else
pDC->DrawState(pt, Extent, m_title/*strCaption*/, DSS_NORMAL, TRUE, 0, (HBRUSH)NULL);
//pDC->TextOut(pt.x, pt.y, m_title/*strCaption*/);
//pDC->SelectObject(pOldPen);
//pDC->SelectObject(pOldFont);
pDC->SetBkMode(nMode);
pDC->SelectObject(oldFont);
}
|
|
|
|
|
|
I can find a lot of CXPButton, CButtonXP, CWinXPButton...
but I cannot find the CXPEdit or CEditXP except WTL
|
|
|
|
|
I like the button style but I want to set buttons to different initial color states. The pushed state or hover state can be common to all buttons.
Bob
|
|
|
|
|
hi, is you your button class accept Icons if yes tell me hwo???
please reply,
Thanks,
Bye
liquid
|
|
|
|
|
|
I compile the project and i don´t know how to change font, can you help me?
thanks
|
|
|
|
|
|
Ok, I forgot it, I´m trying to learn Visual c++, I'm not very experimented with the Functions, so could you give me an example, p.ex. with the font MS Sans Serif?
|
|
|
|