|
This is really excellent and gets full marks from me.
Keep up the good work!
JohnJ
http://www.rainbow-innov.co.uk
|
|
|
|
|
I am using your code in a UNICODE project, so I had to modify bit. It works fine so far.
However, I have a question:
Why didn't you base your CSAPrefsSubDlg on CPropertyPage. This way it is very easy to implement OnApply and the like in the pages
Did I miss anything?
|
|
|
|
|
no real reason. i think when i wrote this, the settings pages i was using were already dialogs, not property pages. i just carried it along.
-c
Civilization is the limitless multiplication of unnecessary necessities.
Mark Twain
|
|
|
|
|
I wrote to Chris about it six month ago, and sent my code fix... But with no effect.
Chris, thanks, your class was really helpful for me!
|
|
|
|
|
Can you post here your fix?
thanks
|
|
|
|
|
in SAPrefsSubDlg.cpp / PreTranslateMessage:
change this:
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_ESCAPE))
{
return TRUE;
}
to this:
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_ESCAPE))
{
GetParent()->PostMessage(WM_CLOSE);
return TRUE;
}
Civilization is the limitless multiplication of unnecessary necessities.
Mark Twain
|
|
|
|
|
Here's my fix (for that version of SAPrefs I downloaded in September 2001):
BOOL CSAPrefsSubDlg::PreTranslateMessage(MSG* pMsg)
{
// Don't let CDialog process the Escape key.
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_ESCAPE))
{
GetParent()->PostMessage(WM_COMMAND, IDCANCEL);
return TRUE;
}
// Don't let CDialog process the Return key, if a multi-line edit has focus
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_RETURN))
{
// Special case: if control with focus is an edit control with
// ES_WANTRETURN style, let it handle the Return key.
TCHAR szClass[10];
CWnd* pWndFocus = GetFocus();
if (((pWndFocus = GetFocus()) != NULL) &&
IsChild(pWndFocus) &&
(pWndFocus->GetStyle() & ES_WANTRETURN) &&
GetClassName(pWndFocus->m_hWnd, szClass, 10) &&
(lstrcmpi(szClass, _T("EDIT")) == 0))
{
pWndFocus->SendMessage(WM_CHAR, pMsg->wParam, pMsg->lParam);
return TRUE;
}
return FALSE;
}
return CDialog::PreTranslateMessage(pMsg);
}
|
|
|
|
|
Chris,
Excellent work! Top marks! I have incorporated it into my main project and it works beautifully. I also took your code and made a new class that would make SAPrefs perform as a wizard with next/previous/finish buttons, and I only added about 40 lines. Excellent!
Thanks again!
Alexander Wiseman
a.k.a Farseer
|
|
|
|
|
some comments:
1.support for OnApply and OnKillActive will be very suitable. TVN_SELCHANGING is good way to support OnKillActive. OnApply can be called from parent's OnOK handler.
2.Calling childs UpdateData from parent seems to be useless.
The interface itself is very nice. Thanks.
Serge.
|
|
|
|
|
I like this approach. It provides for a more organized, intuitive property page.
Another useful thing might be to make this into a view class. I might tackle that this summer unless someone beats me to it.
|
|
|
|
|
NISH IS A DISH ! HAHAHAHAH I AM FUNNY
|
|
|
|
|
Has anyone built the sample code under VC7?
I tried and found the by changing the definition of OnSetText from BOOL to LRESULT and removing the Enable3dControls() functions, it seems to work ok.
Can anyone verify this.
Thanks,
Rene Laviolette
|
|
|
|
|
I was just about to implement a settings page using this class, but we are getting in .NET on friday of next week and I don't want to work on it unless im sure it will work.. I would think it would work in .NET, but I am already worried about what I've written so far and its compatibility. I'll be checking this post to see if anyone can comfirm the .NET compatibility.
-dz
|
|
|
|
|
Yeah,I've used the great code in my app and it works well on the .Net.;P
|
|
|
|
|
Your code and sample are worthless bro! And you had the NERVE to say on another person's sample that yours was better! It isn't! You have no idea about how a prefs dialog is used? A prefs dialog is launched ALWAYS modeless from within a mainframe in common practice. Consider the OUTLOOK application! It is impossible to use your code in an Outlook like application where the Prefs dialog will, in most cases, be launched from a child window in a splitter! Your code will NOT lend itself to being launcjed in as modeless because your oref dialog are are modal and defined from OUTSIDE the main prefs dialog! Your approach is terrible and uselss bro!
But you did do a nice job drawing the comment bar above the list.
Bill SerGio
Bill Sergio
|
|
|
|
|
Billy Boy wrote:
A prefs dialog is launched ALWAYS modeless from within a mainframe in common practice.
This isn't true.
Billy Boy wrote:
Your approach is terrible and uselss bro!
Instead of posting insensitive comments like this, why don't you take the trouble to modify Chris' code to support modal/modeless behavior? The SAPrefs dialog has been used in commercial applications. Perhaps you think it's useless - but 63 users who've rated it 4.41 clearly don't think so.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Common people.. If you can't take critisism, get out of the field. If you code is bad, someone with more experience should definetly say so in order not to confuse others.
The guy had some valid arguments....
exo
|
|
|
|
|
exo wrote:
The guy had some valid arguments....
Like what?
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi
I been telling the others too. I don't believe it was the real Bill Sergio. I believe it was an imposter. And the new exo guy is a newly signed up guy. He was probably the imposter as well.
Nish
It's seven o'clock
On the dot
I'm in my drop top
Cruisin' the streets - Oh yeah
I got a real pretty, pretty little thing that's waiting for me
|
|
|
|
|
You're probably right. I just felt a response to the expressed sentiment was in order. I'm trying to keep the thread emotion free and objective, because I'd like to learn from the note author's wisdom, but there doesn't appear to be much evidence of that.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
If it wasn't for my 5th wisdom tooth, I would be all out of wisdom.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Ugh, my dentist wants me to have all 4 removed this year although they aren't causing me any pain. How much time should I allocate for recovery (per tooth)?
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I had all 4 done at once and was back eating hogies in a day (which was stupid, I got food in a socket). I went to work the next day.
If none of your teeth are impacted, then it isn't bad at all. 2-5 days IMHO. No pain after the first day. About the worst thing that can happen is a dry socket. Then you just go see the dentist again and they will clean the socket and repack it.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hmmm, my lower R is pretty badly impacted although I don't feel a darn thing. Maybe I should have it removed before my head explodes. Thanks for the encouraging prognosis.
From your usage of "hogie" I assumed you hail from Pennsylvania, but I see you're a resident of the Peach state. The reference to the edible object has also served to make me think of supper, although it's only 3:20pm and I've just consumed a delicious cafeteria cookie and little less than a gallon of coffee. But I'm rambling and shall cease and desist without further ado.
It's Friday...
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
little less than a gallon of coffee
yow. that would cause my head to explode.
-c
Smaller Animals Software, Inc.
You're the icing - on the cake - on the table - at my wake. Modest Mouse
|
|
|
|