 |
|
 |
Nice control, just needs a couple of very small changes (to the CCoolBtn.cpp file) to allow you to be able to place a button control in your dialog (rather than creating it at runtime).
In Constructor add the following line:
CCoolBtn::CCoolBtn()
{
...
m_pParentWnd = NULL;
...
}
In the PreSubclassWindow() function do the following:
void CCoolBtn::PreSubclassWindow()
{
...
if(m_pParentWnd == NULL)
m_pParentWnd = GetOwner();
...
}
|
|
|
|
 |
|
|
 |
|
 |
The article does not have any content nor is anything explained.
|
|
|
|
 |
|
 |
And come to think of it neither do you - go back to hole where thou came from.
|
|
|
|
 |
|
 |
You are a son of a bitch! Mind your language you dick head. If you cannot write good articles stop posting.
|
|
|
|
 |
|
 |
Sheetal_Joshi wrote: You are a son of a bitch! Mind your language you dick head
Okay there, seems somebody needs to take their medication.
Sheetal_Joshi wrote: If you cannot write good articles stop posting.
Jeez I stopped along time ago, thanks to sh*ts like you.
Anyway I eagerly awaiting to see YOUR article, although I could be waiting a long time.
|
|
|
|
 |
|
 |
I dont like how the author flames other developers for no reason other than to be cruel.
|
|
|
|
 |
|
 |
How stupid?! The voting should be based on the quality of the article and not based on how the author communicates with someone else.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
 |
|
 |
It was a conflct when somebody else and you've taken up the right to join in, well feel free.
|
|
|
|
 |
|
 |
Message Automatically Removed
|
|
|
|
 |
|
 |
Hi,
Your work offers a great help in my project. Thank you very much.
However, i faced a problem: mislocation of the button when my project is run and tested on other PC.
Scenario:
i created a button in the OnInitialUpdate() and place it on a FormView.
RECT stRect;
stRect.left = 0+454;
stRect.top = 0+197;
stRect.right = 454+74;
stRect.bottom = 197+23;
CRect rect1(stRect);
m_btn.Create("&Settings", WS_TABSTOP | WS_CHILD |WS_VISIBLE, rect1 ,this,IDC_SETTING);
Problem:
When this program is run on other PC, the button is no longer at the place i desired. It jumps to other location! why?
I've tested on windows resolution, but doesn't solve the prolem.
Please advice. Thank you!
|
|
|
|
 |
|
 |
This control was almost exactly what I needed for an application I'm working on. However, I've made a couple of minor additions to the code:
1) By default, the left side of the menu is aligned with the left side of the button. Since this looks a little strange in cases where the button is wider than the menu, I've added a method to specify whether the menu should be right- or left-aligned.
2) Added a method to set a callback function to dynamically create the menu, if desired. (I notice this has already been done by others, but isn't included in the source code from this site)
3) Added a method to set a callback function for handling menu selections, rather than using window messages.
I felt that these changes increased the flexibility of what is already an excellent control . The mods are easy enough to make, but if you want the source just drop me an email.
Cheers,
Dion Campbell
|
|
|
|
 |
|
 |
I've made a few small additions to the code:
- Using OBM_COMBO bitmap arrow
- Enabled use of popup menu resource
- Popup menu using keyboard (VK_DOWN)
The modified project is here: http://www.code.trak.dk
|
|
|
|
 |
|
|
 |
|
 |
In AddImage the line
ASSERT( m_menu.SetMenuItemBitmaps( nIndex, MF_BYPOSITION, &bmpEnabled, &bmpDisabled ) );
should be
VERIFY( m_menu.SetMenuItemBitmaps( nIndex, MF_BYPOSITION, &bmpEnabled, &bmpDisabled ) );
Best wishes,
Hans
|
|
|
|
 |
|
 |
I have also added two new features to this class: a callback function, which allows you to load the menu at the time the menu is being dropped (for example, for a Back button); and the ability to load the menu from a resource id.
Please let me know if you want me to email the source to you - the CP email form does not allow attachments.
Best wishes,
Hans
hdietrich2@hotmail.com
|
|
|
|
 |
|
 |
Hans
Feel free to email the source I will include and update the article occordingly
|
|
|
|
 |
|
 |
What is your email address? I cannot email via CodeProject - the email form does not allow attachments.
|
|
|
|
 |
|
 |
well, this article should be well descriptive for the beginners. try improving it!!
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
 |
|
 |
Eat my shorts...
|
|
|
|
 |
|
 |
Well, I have looked very much around to find a menu button implementation. This one has following weak points:
- Not visually definable
- Not very well isolated
- Not reusable across applications
Derek Lakin seems to spend much more time on this subject.
See: http://www.salamandersoftware.biz/products/cbuttonssl.htm
CButtonSSL has these advantages:
- Visually definable
- You can define your menu in the VC menu editor with flyouts, check marks etc.
- In completely isolated and reusable class form
- plus much more extras
Suha Aktan
|
|
|
|
 |
|
 |
So - go and use the other button - I'm really not interested on what you think.
|
|
|
|
 |
|
 |
Please do not take it personally, Normski.
My aim is to suggest an alternative to the public.
Let's make peace
|
|
|
|
 |
|
 |
Sorry for being -ne (that's negative) I get a lot of folks saying "if it could just do that" or "these a bug - fix it", one reason why I didn't post updates or fixes to all of my articles.
Apologies accepted!
|
|
|
|
 |
|
 |
but i don't see any support for winxp themeing
and before you say this one neither, watch the thread below
|
|
|
|
 |