|
See here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I created a class derived from CStatic control. I used this class to create a control similar to a clock control in which a needle rotated continously to show some value. I used onPaint to draw the control's face and a timer to change the position of the needle. In the onTimer function, I used the CDC object to change the position of the line and I am calling the Invalidate function.
I used this control by adding a static control in a dialog in a application. and then created a member variable for the static control and changed member to be an object of my class.
Now when I run the application, my control works fine. But a small blink seems to appear when the needle changes position.
If anybody has suggestions to avoid the blink, Please tell me.
Thanks in Advance,
Mohan
|
|
|
|
|
manohar_balu wrote: I used the CDC object to change the position of the line and I am calling the Invalidate function.
If you are already changing the line position on DC why call invalidate again. Or else dont change just call Invalidate in Timer.
Regards,
Sandip.
|
|
|
|
|
This is because it is getting painted twice for every WM_PAINT it receives. The problem is the WM_ERASEBKGND message, which is sent every time we call BeginPaint. This isn't a problem really - Windows is doing us a favour, because the default action for WM_ERASEBKGND is to draw a nice window background for us (using the window's default background brush), which we can then paint on top of in the WM_PAINT handler.
However, our WM_PAINT handler also draws the control's background, so there is no point in this happening twice. Therefore, we need to prevent the default WM_ERASEBKGND behaviour from happending. As usual, there are a number of ways to do this.
Set the window's background brush to NULL. (Set the hbrBackground member of the WNDCLASS structure to zero when you register the window class).
Return non-zero in the WM_ERASEBKGND message handler.
-@SuDhIrKuMaR@-
|
|
|
|
|
You can use double buffering. Draw the clock on an in-memory bitmap, and in your OnPaint () handler just BitBlt the bitmap to the OnPaint CDC.
|
|
|
|
|
Is it possible to layout the text content of a RichEditCtrl in form of two columns ?
Thank you in advance.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
Are you opposed to using a list control for this?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
may be. Becuase I am just using the RichEditCtrl for its printing possibilities : I am doing a chess program. I show moves notation using certain control, but when I have to do the printing, I just call a certain hidden RichEditCtrl to receive my moves tString, then it is of its responsibility to lay them optimally, ie know when to return to the line, when to add another page when space isn't enough..etc.
Just to avoid using complex or lengthy things my own.
The problem is that the standard way chess printing is when moves notation is laid out in two columns, like a newspaper. For that reason I asked about how to do it in RichEdit control.
last day I checked paraformat and I think with it I can restrain certian text to the left side, but what about the right side, how can i tell the rich edit to display the remaining paragrphs to the right of the page ?
Anyway, thank you for your willingness to help me.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
hINTModuleState wrote: ...but when I have to do the printing, I just call a certain hidden RichEditCtrl to receive my moves tString, then it is of its responsibility to lay them optimally, ie know when to return to the line, when to add another page when space isn't enough..etc.
Just to avoid using complex or lengthy things my own.
Fair enough. When adding to the richedit control, use a tab or spaces as the column separator. You might also consider changing its font to something fixed-spaced.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Suppose I have the following moves notation text :
1.Nf3 Nf6 2.c4 g6 3.Nc3 Bg7 4.d4 O-O 5.Bf4 d5 6.Qb3 dxc4 7.Qxc4 c6 8.e4 1 -0
It must not be displayed as :
1.Nf3 Nf6 2.c4 g6 3.Nc3 Bg7 4.d4 O-O
4.d4 O-O 5.Bf4 d5 6.Qb3 dxc4 7.Qxc4 c6
8.e4 1 -0
No, but rather this way, which is very difficult to do by embeddins tab caracters onto the moves String :
1.Nf3 Nf6 2.c4 g6 6.Qb3 dxc4 7.Qxc4 c6
3.Nc3 Bg7 4.d4 O-O 8.e4 1 -0
4.d4 O-O 5.Bf4 d5
Big problem.Would you receive screenshots of my prog. ?
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
hINTModuleState wrote: 1.Nf3 Nf6 2.c4 g6 6.Qb3 dxc4 7.Qxc4 c6
3.Nc3 Bg7 4.d4 O-O 8.e4 1 -0
4.d4 O-O 5.Bf4 d5
This actually looks like four columns mixed with two, and move #4 has been repeated. How about:
1.Nf3 Nf6 2.c4 g6
3.Nc3 Bg7 4.d4 O-O
5.Bf4 d5 6.Qb3 dxc4
7.Qxc4 c6 8.e4 1 -0
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
Please anyone can tell me how can i block enter all keys of keyboard in Edit box of Combo control.
I just dont want to use DroList property.
Thank in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
modified on Tuesday, August 5, 2008 6:45 AM
|
|
|
|
|
simply disable it...
EnableWindow(/*param set to false*/)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
please read my post again i m modified it
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
can you please explain your problem clearly? I tried following the posts underneath this thread but was not able to get much out of it.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
"_$h@nky_" wrote: how can i block enter all keys of keyboard in Edit box control
What exactly you want to achieve can you explain.
You can set 'Readonly' property of text box if you don't want user to change the contents.
Use combobox style "Droplist".
Does this help.
Regards,
Sandip.
modified on Tuesday, August 5, 2008 6:36 AM
|
|
|
|
|
i dont want to use droplist property,because i generate a problem in my applcation.
i just want to stop enter values in Edit box of Combo box control.
there is any suggestion for this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
What problem can you explain??
I don't think there is any other option.
Regards,
Sandip.
|
|
|
|
|
In my application in one phase i save some values of this combo box in database.
in second phase when i again open the dialog box for check saved values,
than in case of drop list the saved values are not shown,while in case of dropdown its done.
so i just dont want to use droplist option.
and i want to stop enter value in edit box of combo box because i already add string in combo box in OnInitialUpdate function of Dialog.
I dont want to enter any other values.
so please tell me what can i do.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Can you paste relevant code here..
"_$h@nky_" wrote: in second phase when i again open the dialog box for check saved values,
than in case of drop list the saved values are not shown,while in case of dropdown its done.
I don't understand this. It has nothing to do with combo style.
Regards,
Sandip.
|
|
|
|
|
i cant it is in diffrent parts.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote:
in second phase when i again open the dialog box for check saved values,
than in case of drop list the saved values are not shown,while in case of dropdown its done.
Whether you use the CBS_DROPDOWN or CBS_DROPDOWNLIST style, that has nothing to do with how you add items to the combobox, or whether they are displayed or not.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Good Morning,
I have a problem with vfw (Video for Windows) and could need some advices.
I tryed to catch a single frame from a webcam.
I've got not much experience in programming with visual c++, i would be very thankful for any help.
The Code looks like this:
HWND hwndVideo; // Is a global Variable
//create capture window
hwndVideo = capCreateCaptureWindow((LPCWSTR)"WebCam", WS_CHILD | WS_VISIBLE, 0 ,0, (int)640, (int)480, m_CamWnd, (int)3);
//start the Preview
capPreviewRate(hwndVideo, 20);
capPreview(hwndVideo, true);
//I tryed to get the frame with capGrabFrame, but i wasnt able to get the framedata.
capGrabFrame(hwndVideo);
// or
capGrabFrameNoStop(hwndVideo);
How can i get the framedata to work with it???
|
|
|
|
|
|