473,385 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

can't force redraw of my frame

Hi!
I want to show a blinking text over my derived CMDIChildWnd-class. The
blinking is done by one view which is hold by my frame. I set up a timer and
write text to the parent frame, which works fine. But I can't get the text
away the next time the timer fires. Here is some code:

void MyView::OnTimer(UINT nIDEvent)
{
if (nIDEvent!=1) return;
showText = !showText;
// Call base class handler.
CView::OnTimer(nIDEvent);

CUserFrame* frame = (CUserFrame*)(this->GetParentFrame());
CRect clientRect;
frame->GetClientRect(&clientRect);

if (showText){
// display the text --------- THIS WORKS FINE
CFont font;
CDC* dc = frame->GetDC();
font.CreatePointFont (720, _T ("Arial"));
CFont* oldFond = dc->SelectObject (&font);;
dc->SetBkMode (TRANSPARENT);
dc->SetTextColor(RGB(255,100,0));
dc->DrawText(_T("blink"), clientRect, DT_SINGLELINE | DT_CENTER |
DT_VCENTER);
dc->SelectObject (oldFond);
frame->ReleaseDC(dc);
}else{
// remove the text -------------- DOESN'T WORK

// here are many things I tried, but without success
::InvalidateRect(frame->m_hWnd,0,TRUE);
::InvalidateRect(frame->m_hWnd,&clientRect,TRUE);
::UpdateWindow(frame->m_hWnd);
frame->UnlockWindowUpdate();
frame->Invalidate(true);
frame->UpdateWindow();
frame->RedrawWindow();
frame->my2View->UnlockWindowUpdate(); /* my2View is anoter
view that the frame holds (It has a static splitter)*/
frame->my2View->InvalidateRect(&clientRect);
frame->my2View->Invalidate(true);
frame->my2View->UpdateWindow();
frame->my2View->RedrawWindow();
AfxGetMainWnd()->RedrawWindow();

/* To be sure that the code is working corect I added a drawText
here,
which is displayed correctly above the first text and is under
the "blink" after the next timer event */
CDC* dc = frame->GetDC();
dc->DrawText(_T("hello..."), clientRect, DT_SINGLELINE | DT_CENTER |
DT_VCENTER);
frame->ReleaseDC(dc);
}
}

So the result of the above code is that "blink" is written on my window,
then "hello" is written above it, than "blink" again... but the other text
will never be deleted.
Anyone any ideas why this is so, why the window is not redrawn, so the
"blink" should disapear, becaus it is not in the frames OnPaint()?

Thanks for any help
Maik
Jul 22 '05 #1
2 3420
"Maik Wiege" <mi*****@gmx.de> wrote in message
news:bu*************@news.t-online.com...
Hi!
I want to show a blinking text over my derived CMDIChildWnd-class. The blinking is done by one view which is hold by my frame. I set up a timer and write text to the parent frame, which works fine. But I can't get the text away the next time the timer fires. Here is some code:


This is a very advanced subject. We cannot help you here. You should
post in a newsgroup devoted to blinking text.

Jonathan
Jul 22 '05 #2
Jonathan Turkanis wrote:
"Maik Wiege" <mi*****@gmx.de> wrote in message
news:bu*************@news.t-online.com...
Hi!
I want to show a blinking text over my derived CMDIChildWnd-class.
The
blinking is done by one view which is hold by my frame. I set up a


timer and
write text to the parent frame, which works fine. But I can't get


the text
away the next time the timer fires. Here is some code:

This is a very advanced subject. We cannot help you here. You should
post in a newsgroup devoted to blinking text.


Actually, we can't help you here because it is and MFC question.
Go to a VisualC newsgroup.

:)

Jorge L.

Jonathan

Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marc | last post by:
Hi all, I have an application that uses a Pmw ComboBox to display a list that is dynamic. The user has the ability to add and delete items from the list at different points in the program. ...
3
by: Phil | last post by:
how do I force a window, pened alone, to be displayed in its frame set? tried this: if (parent.location.href == self.location.href) { window.location.href = '../'; } the problem is that...
0
by: Maik Wiege | last post by:
Hi! I want to show a blinking text over my derived CMDIChildWnd-class. The blinking is done by one view which is hold by my frame. I set up a timer and write text to the parent frame, which works...
20
by: Crirus | last post by:
I have a 20x16 array of objects. I need a way to iterate through the array and only consider few rows and few columns. To be clearer, sometimes I need only first 2 rows and last 3 columns to be...
2
by: Don | last post by:
Is there anyway to force an area of the desktop to redraw in VB.NET? - Don
3
by: beatdown | last post by:
Hi all, I have a set of Javascript functions that dinamically update the contents of a HTML <selectelement, depending on the value of another <select>. For easy understanding: I select a...
10
by: markwalker84 | last post by:
Hello everyone! Got a bit of a problem... Two of the panels on my program contain a number of check boxes. The exact number of which is determined by a pair of variables. I have recently...
0
by: adubra | last post by:
Hi there, I am using a device context (DC) and a buffer to successfully draw to screen. However, when I update the DC at very high frame rate and drag the frame containing the image very quickly...
2
by: dmc2409 | last post by:
Well, I am more a desigber than developer. Need to solve the folloving problem. I have a page on, lets call it Firstserver. It opens Page1, Page2 and Page3 on Secondserver through a frame on the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.