|
OK.Thanks for your feedback.
My best regards.
[EDIT]
I wondered why I used \u but I've discovered that it's C# equivalent [^] of the C++ syntax i.e C# routine.
Life is a stage and we are all actors!
modified on Monday, October 26, 2009 2:58 PM
|
|
|
|
|
Shaheen.India wrote: wcscpy(strUnicode[0],L"U+0985");
Should be
wcscpy(strUnicode[0],L"\x0985");
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
hello,
I have used ModifyStyle to modify the style of a window from readonly to noreadonly but it doesnt reflect in the window.
CRichEditCtrl m_Table;
m_Table->ModifyStyle(ES_READONLY,0,SWP_NOSIZE);
Wht must be the problem
|
|
|
|
|
some styles cant be modified at runtime. In that case you got to destroy the window and create another in its place. I sometimes use 2 windows for that case (only one visible)
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Try this:
SendMessage(hwnd,EM_SETREADONLY,1,0); // set readonly flag
SendMessage(hwnd,EM_SETREADONLY,0,0); // remove readonly flag
|
|
|
|
|
Have you used Spy++ to very the styles before/after the call to ModifyStyle() ? Have you tried using SetReadOnly(FALSE) method?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
prithaa wrote: CRichEditCtrl m_Table;
m_Table->ModifyStyle(ES_READONLY,0,SWP_NOSIZE);
This wont work as you have not got the Dialog item for your edit control ..
If you have an MFC application in the pretranslateMessage() or OnInitdialog() or where ever you want to introduce new property to the control :
GetDlgItem(Your RichEditControl's ID for eg.IDC_RICHEDIT_CTRL)->ModifyStyleEx(ES_READONLY,0,SWP_NOSIZE);
Invalidate();
If this answer helps Mark it as GOOD answer.
Regards,
Kushagra
|
|
|
|
|
Hey Guys,
I am in need of a method to keep my rectangle frame, drawn with OnMouseMove() and OnDraw() with coords specified from OnLButtonUp() and OnLButtonDown(), on the top of an image that is being updated with and OnTimer() function every some odd milliseconds. Here are a few code snippets:
Drawing the framerect:
void LiveFeed::OnMouseMove(UINT nFlags, CPoint point)
{
if (GetCapture() == this)
{
m_ptEnd = point;
Invalidate();
}
CRect r(m_ptStart, m_ptEnd);
CPaintDC dc(this);
dc.GetSafeHdc();
dc.FrameRect(&r,0);
}
void LiveFeed::OnDraw(CDC* pDC)
{
CRect r(m_ptStart, m_ptEnd);
pDC->FrameRect(&r,0);
}
Updating the image with OnTimer() The BlitX function just transfers an image to the specified window from a camera:
void LiveFeed::OnTimer(UINT nIDEvent)
{
XC_BlitX(cam->GetHandle(), m_hWnd, 0, 0, 640, 512, Window);
}
This setup causes my FrameRect to be drawn but then it gets covered by my image being updated. I need a way to draw on top of a refreshing image. I think I may need to use some sort of graphic control, but I am really unsure where to start to tackle this problem!
Any help would be appreciated and thanks in advance for taking the time to read my post!
-esc321
|
|
|
|
|
You should put all of your drawing stuff inside the OnDraw message handler. OnMouseMove and OnTimer should only change the state of your class and then notify the area should be updated (so that OnDraw will be called).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
what about an underestimated call of Invalidate() ?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
That's contemplated in 'notify the area should be updated'
It is a logical step, implementation details left as exercise.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Ah, i think I understand. If I move my image update function to OnDraw() it should keep everything on the same "Timer". If I try this, how do I get OnDraw() to be called? The timer?
|
|
|
|
|
When you need a re-paint to occur (and hence a call to OnDraw happen) you've to code the sequence
InvalidateRect(NULL);
UpdateWindow();
Please read the related documentation [^], [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: Heh - I should refresh more often...
I suggest you InvalidateRect /UpdateWindow , for the purpose...
Iain Clarke, Warrior Programmer wrote: Great minds think alike:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You need to do a bit of reading of windows stuff.
The OnDraw method is called from the OnPaint hander. That wraps WM_PAINT for you.
To make windows issue a WM_PAINT when next convenient, use InvalidateRect function.
Lastly, to force an update, use the UpdateWindow function.
If you search for those functions on msdn, hopefully how windows works will become clearer.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Ok. I have tried using Invlaidate and UpdateWindow to get a message to prompt the OnDraw function to no avail. I have added these to my OnInitDialog and to the OnTimer functions. If there is nothing drawn to begin with do these functions still work? Thanks to everyone for their timely responses.
|
|
|
|
|
So... OnDraw() is for MDI, OnPaint() SDI . Now all I need is a good hammer/smileyface option for my last 4 posts. Thanks guys.
|
|
|
|
|
It's a little more complex than that (but only a little).
The OS issues a WM_PAINT message. MFC by default uses a message handler called WM_PAINT. (See the OM_WM_PAINT macro).
On a lot of windows, that's as far as it goes. But CView implements a slight fancy version of OnPaint which does the whole BeginPaint / EndPaint functions, and calls a virtual method called OnDraw.
So, assuming you're drawing something in a vew class, forget about OnPaint, and just use OnDraw.
Again, assuming you used a wizard to make your MFC class, it will have given you an OnDraw method ready for you to fill in.
As a bonus, the printing stuff built into MFC also calls your OnDraw method for printing - so one bunch of code, two wins!
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
So, if I have an SDI, not a view class, I don't have built in OnDraw functionality. So in order to do what is needed I have to just stick everything that I want drawn with ON_WM_PAINT into OnPaint(). Correct? Sorry for the confuion with OnDraw and OnPaint.
|
|
|
|
|
You need to read your own code better.
SDI = Single Document Interface. You may only have one, but you still have a view.
Look at the classes. One of them will be CxxxxView, and inherit from CView, or CScrollView, or some other view class.
If you have a dialog only application, that's not SDI.
If I'm stull wrong, and you don;t have any classes that inherit from CView, or CDocument, then please tell me how you created your project.
Iain.
(Ok, SDI was also Strategic Defense Initiative, but I doubt you're writing that. If so, refresh issues are not your biggest problem).
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi All,
We are developing one program that capturing items under mouse in different browsers.
We are using IAccessible Interface and AccessibleObjectFromPoint to get the different elements of perticular item under mouse.
Right now we are facing a problem with Google chrome.
Its not giving any information of item under mouse, for example name,value,role ,etc...
Is there any method available to do this in Google Chrome with or without IAccessible?
Thanx in advance.
Jay.
|
|
|
|
|
Hmmm. My demo program here has no problem with Chrome. Take a look.
|
|
|
|
|
Hi Hans,
Thanx for your reply.
As in your given link documentation the code will work for Chrome version 1.
But we want all the information for Chrome version 4,So program failed to find chrome browser running.
To make chrome browser visible for XMSAALibTest exe,We had changed class name of chrome from "Chrome_XPFrame" to "Chrome_WindowImpl_0" in XMSAALibTest program.
And the output is as below for "EnumAllBrowserObjects" button.
XMSAALibTest v1.0
Found Google Chrome browser
Object enumeration started
NAMELESS[window - invisible] {Description: ?, Location: (-31997, -31473, -31947, -31453), Value: ?}
NAMELESS[application - visible,focusable] {Description: ?, Location: (-31997, -31473, -31947, -31453), Value: ?}
NAMELESS[editable text - visible,read only,focusable] {Description: ?, Location: (-31997, -31473, -31947, -31453), Value: ?}
Object enumeration complete
Writing XML to file MSAALib.xml
So we cannot get all information like IE or Firefox in XMSAALibTest.
Do we need to change more things in XMSAALibTest demo program to make XMSAALibTest exe workable for Google chrome version 4?
-Jay
|
|
|
|
|