|
abiemann wrote: //no need to erase background since SetBitmap covered everything up
this->Invalidate(FALSE);
You have a static control that is used to display a bitmap. Yes? Is it overlapping the other controls such that they are requiring this?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes, I have a static bitmap covering the entire Dialog window. Other controls (Buttons, Edit boxes) are ontop of this bitmap.
|
|
|
|
|
So are you rendering this image in the dialog's OnEraseBkgnd() method?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
no I haven't touched the OnEraseBkgnd() or OnPaint methods.
The code above is processed whenever the user presses a key or lets go of a key.
(I haven't worked much with MFC, so I'm still learning)
|
|
|
|
|
abiemann wrote: no I haven't touched the OnEraseBkgnd()...
Put your bitmap-rendering code in there and note the difference.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi David,
I've made the change and the background bitmap doesn't flicker at all, however, the controls ontop of the bitmap still flicker.
This is the change I've made:
KeyHandler now triggers OnEraseBkgnd instead of performing PatBlt
When the user presses a key, the key's number is stored in a private member variable of the Dialog.
To subsequently make it update the background image, the Dialogs' key handler performs :
this->Invalidate(TRUE);<br />
this->UpdateWindow();
OnEraseBkgnd now does the PatBlt of the static image behind the controls
Next, OnEraseBkgnd(CDC* pDC) is processed.
this handler first checks that a key was pressed, if so, it performs the targetDC.PatBlt (I just use the pDC that's passed in) then it returns TRUE.
If no key was pressed then I let this handler perform the default CDialog::OnEraseBkgnd(pDC)
After this change I noticed that the individual controls no longer need their RedrawWindow() called, however, they still flicker (but the background static image doesn't flicker at all now).
I've also removed the SetRedraw() calls
-- modified at 19:14 Thursday 6th September, 2007
|
|
|
|
|
Did you try adding the WS_CLIPCHILDREN style to the dialog as suggested by WalderMort?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
In other words, it works but it doesn't work.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Do you want to set some properties for a control?
|
|
|
|
|
No the properties won't change, but I'm calling quite a lot of RedrawWindow methods for the controls on the Dialog and I'm noticing that the bigger the controls, and the more there are, the more flicker I'm seeing.
|
|
|
|
|
did you try the WS_CLIP_CHILDREN flag? This alone would reduce a hell of a lot of flicker.
|
|
|
|
|
Good point! For whatever reason, when I see bitmap background code
I think skin, transparent controls, etc. For normal controls WS_CLIPCHILDREN
will work great!
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I've tried the following within ::OnInitDialog()
this->ModifyStyle(0, WS_CLIPCHILDREN);
but then nothing in the Dialog updates
|
|
|
|
|
Can someone tell me how to display the "inifinity symbol" inside of a listview item. For example, i was just using Azureus (bit torrent client) and noticed that they used this symbol under its ETA column. How do i do this?
Thanks
|
|
|
|
|
The string literal is:
"\xEC" (ASCII)
L"\x221E" (Unicode)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
There are two basic methods they might be using.
1. Font selection. They might have set the list ctrl font, or at least the font used when painting that part of the list ctrl, to a symbol font with an infinity symbol and then put ordinary text in the control corresponding to the charatcer number for the infinity symbol in the symbol font.
2. Overriding painting. They might have overriden aspects of the list control either using the custom draw, or owner draw approaches, probably custom draw and then be simply drawn the infinity symbol with a bit of GDI code, probably using a cached bitmap.
Search around for Custom Draw examples and Symbols fonts like WingDings. You'll have it cracked in no time.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Does anyone know where I can find a "Thumb Wheel" control?
It looks like a dial turned on its side with ridges on its edge (like a quarter) and it would be used like a slider to adjust a value.
A picture of a GUI that shows what I am looking for can be found here:
http://www.steptools.com/products/stviewer/images/st-viewer.gif[^]
Beth
-- modified at 10:31 Thursday 6th September, 2007
|
|
|
|
|
bscaer wrote: Does anyone know where I can find
You mean besides the internet?
|
|
|
|
|
In the documentation maybe ?
|
|
|
|
|
Did you see Button section on the codeproject?
|
|
|
|
|
I'm sure you could derive from the scrollbar class to create your own.
|
|
|
|
|
Create a class which derives from the CScrollBar class. The Thumb Wheel control functionality is similar to the scroll bar functionality. Instead of changing the view position with GetScrollPos() do your task. For example as in the figure shows rotate the image horizantally or vertically. And you can set range of angle (i.e 0-360) with the help of SetScrollRange(). On the OnPaint of your class draw the Thumb Wheel control as per your wish.
All the best....
Let me know your success.
Sreedhar DV
|
|
|
|
|
Hi I am using CreateWindowEx to call Create a new Window which has "tooltips_class32" (TOOLTIPS_CLASS) class and parent window as my Dialog Box. I am using Following code for that.
I am Using Win32 Application
<br />
ToolTipWnd = ::CreateWindowEx(WS_EX_TOPMOST,<br />
TOOLTIPS_CLASS,<br />
NULL,<br />
TTS_NOPREFIX | TTS_ALWAYSTIP,<br />
CW_USEDEFAULT,<br />
CW_USEDEFAULT,<br />
CW_USEDEFAULT,<br />
CW_USEDEFAULT,<br />
hWndDlg,
NULL,<br />
hInst,<br />
NULL);<br />
<br />
if ( ToolTipWnd == NULL )<br />
{<br />
DWORD Error;<br />
Error = GetLastError();<br />
MessageBox(NULL,L"Error",L"",0);<br />
}<br />
But I am getting 1407 as Erro Code which says "Cannot find window class".
I dont know where m i wrong. If you know please help me.
|
|
|
|
|
From MSDN (here)[^]:
To create a ToolTip control, call CreateWindowEx and specify the TOOLTIPS_CLASS window class. This class is registered when the common control DLL is loaded. To ensure that this DLL is loaded, include the InitCommonControlsEx function in your application.
Did you call InitCommonControlsEx function ?
|
|
|
|
|
Stop reading the documentation
|
|
|
|