|
Thanx for your quick reply.
Yeah, that was really silly question.
I should know that.
|
|
|
|
|
Oh, one more thing
how that is done with tabbed dialog boxes?
I did that in single dialog box, works fine, but in the tabbed dialog boxes i cant manage.
thanx.
|
|
|
|
|
|
well,
for Cancel button I need nothing,
what I need is when the OK button pressed, to check if the Edit Box is Empty, if it is empty, not closing the dialog (Tabbed) Box, go set the Focus to that Edit Box.
I managed to check the Edit, but the Dialog (tabbed) Box closes.
I do not press te Cancel Button.
|
|
|
|
|
You need to do validation in the page's OnKillActive() function. Returning FALSE will keep the user from switching to the other tab(s). Also, When the OK button is clicked, OnKillActive() is called first to see if it is ok to proceed. Set breakpoints in these two methods to see how things work.
|
|
|
|
|
Exceter wrote:
when I press the OK Button I want to check if there are any empty edit boxes, and if there are, not to closing the dialog box go to that edit box?
Do not allow the OK button to be clicked until ALL controls contain valid data. Your users will be very annoyed that the OK button is allowed to be clicked when there is invalid data; this violates the basic principles of GUI design.
|
|
|
|
|
How can I disallow the OK button in tabbed dialog box?
|
|
|
|
|
It was not meant to be "disallowed." See my reply about OnKillActive() .
|
|
|
|
|
Hello,
I've been out of the MFC world for about a year. Do y'all recommend upgrading to VC++.net from 6.0? Reasons?
thanks!
JennyP
|
|
|
|
|
The compiler and standard library are much better.
The IDE is different - some people like it some don't.
If you are just using MFC then I wouldn't bother.
|
|
|
|
|
TomM wrote:
The IDE is different
That's a nice way of putting it. I'd call it "horrible" along with the awful unusable new MSDN viewer.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Hi,
I am using a CDateTimeCtrl in my application to display a date picker control.
The problem is that I can't seem to find any method in it to set the date...
When I instantiate it, it comes up with today's date and that's all.
I have a COleDateTime object that I am sure I can use to init the control, but how ?
Thanks,
Shay
|
|
|
|
|
Did you have a look at CDateTimeCtrl::SetTime?
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
I have my CEditorView class, which is derived from CRichEditView. I put a breakpoint in my CEditorView::OnDraw function and it was never getting called. Why is OnDraw not getting called?
Reason is, I want to be able to draw the line numbers and a margin, but I can't now that OnDraw is not getting called?
Any help is appreciated!!
|
|
|
|
|
is it virtual? What is the signature of CEditorView::OnDraw ?
|
|
|
|
|
The definition for CEditorView::OnDraw is:
virtual void OnDraw( CDC *pDC );
|
|
|
|
|
Sorry - had to ask . I think problem is the following
void CCtrlView::OnPaint()
{
// this is done to avoid CView::OnPaint
Default();
}
Default - is just a call to default winproc, instead of
CView call to OnDraw(&dc);
|
|
|
|
|
OK, where is CCtrlView? Do I have to call Default to avoid this problem? I appreciate your responses, but I am a little confused about how to fix this with your current reply.
|
|
|
|
|
Looking at the class def for CRichEditView there is no virtual OnDraw() function. I've never used CRichEditView but I assume it is quite different to other CView derived classes.
I suggest you have a look at some of the articles here on CP that use CRichEditView and see how they go about any drawing of there own.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
If I modify a static variable in my derived CView class, let's say the text color, how can I make ALL views in my MDI App update to use the new color ? What I want is for "AllDocs" to "UpdateAllViews".
|
|
|
|
|
The point of doc/view and the UpdateAllViews feature is that you're storing the data in the document. When that data is updated, calling UpdateAllViews allerts all views working with that data that it has changed.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
Well, consider Visual Studio. If you have 5 source files open ( the documents ), and you go and change the text color in the options menu, ALL the views will update. The color of the text being displayed in the view is common to ALL views. It is NOT part of the data.
|
|
|
|
|
What you described was nothing like this. You described a piece of data belonging to one view whose change you wanted announced to other views. What you're comparing to in VS is a global setting used with all views.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
I said a "static" variable in the class. It does NOT belong to one view, it belongs ( is shared by ) ALL instances of that view class.
|
|
|
|
|
You were not very clear about whether or not this was a single view type or if you had other view types. At any rate, people like myself freely give our time to help others as a gesture of community spirit. Your rudeness surely won't help you garner much help around here.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|