|
I need something similar to MSWord's "Type Your Title Here" or "[Type the document title]" thing in the view, so that the user can do in-place editing of the doc's title. How to start on this?
Please suggest.
Thanks
Ronnie.
|
|
|
|
|
Where is this at?
"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
|
|
|
|
|
This is still at start
I have this idea..
I will draw the text "Type Title Here" at the top of doc.
When user clicks on this text I will show a rectangle surrounding the text and a cursor at that position.
User types the title, I'll accept the input character by character and display it. As soon as the user clicks outside the rectangle I will hide the rectangle.
Should I go on with this? or
Have a better idea?
Please suggest.
Thanks
Ron
|
|
|
|
|
Hi All,
I am trying to open a web page using the following code.
ShellExecute(this->m_hWnd, _T("open"), _T("www.xyz.com"), NULL, NULL, SW_SHOWNORMAL);
It works well.
Consider,
Default browser is Mozilla Firefox.
An instance of the Mozilla Firefox is running with some tabs open in it.
The above code will open a new tab (www.xyz.com) in the existing instance.
Now what i want is to open my web page with new instance.
Thanks & Regards,
K. Sushilkumar.
|
|
|
|
|
You will have to retrieve the path to the default browser and directly execute it, passing in the URL as a parameter.
ShellExecute(this->m_hWnd, _T("open"), pathToBrowser, _T("www.xyz.com"), NULL, SW_SHOWNORMAL);
|
|
|
|
|
Hi,
This ShellExecute documentation[^] states:
If the default Web browser currently runs, ShellExecute tells the instance that runs to go to your Uniform Resource Locator (URL). If it is not running, ShellExecute starts the application and then browses to your URL.
Looks like the default behavior. You may need to use CreateProcess[^] instead.
Best Wishes,
-David Delaune
|
|
|
|
|
below code will open in new instance
ShellExecute(this->m_hWnd, _T("open"), _T("firefox.exe"), _T("www.google.com"), NULL, SW_SHOWNORMAL);
or
ShellExecute(this->m_hWnd, _T("open"), _T("iexplore.exe"), _T("www.google.com"), NULL, SW_SHOWNORMAL);
|
|
|
|
|
K. Sushilkumar wrote: The above code will open a new tab (www.xyz.com) in the existing instance K. Sushilkumar wrote: Now what i want is to open my web page with new instance.
Firefox decides (depending on the options you select in Firefox) where a URL should be opened. Your program has no way of altering that.
|
|
|
|
|
I have created a push button in a Toolbar. I want to add image to this button.How can i do this.
|
|
|
|
|
Did you see CToolBar::LoadBitmap?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I want to add for a particular button
|
|
|
|
|
Source code:
CButton btn;
btn.Create("TEST",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,rect,m_ToolBar,ID_BTN);
m_ToolBar.SetButtonInfo(21, ID_BTN, TBBS_PUSHBUTTON, IDB_CANCEL);
|
|
|
|
|
Is it possible to add image
|
|
|
|
|
I suggest you to look in here[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
if ((nFlags & MK_LBUTTON) && (this == GetCapture()))
{
m_SecondPoint = point;
if (m_pTempElement)
{
m_pTempElement->Draw(&aDC);
delete m_pTempElement;
m_pTempElement = 0;
}
m_pTempElement = CreateElement();
m_pTempElement->Draw(&aDC);
}
This is a code of a message handler in a drawing application which now supports drawing lines, rectangles and circles.
We save the first cursor position in the Mouse button down handler
The CreateElement() creates an element (rectangle, circle, line, curve) on the heap and returns a pointer to it.
I don't understand why do we need to redraw the old element. Like I created an element and then a mouse move occurs then why do we draw it two times? First, in the inner if block and second, after the if block.
It is drawing over the previously drawn element in the inner if block right?
|
|
|
|
|
Please elaborate.
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]
|
|
|
|
|
Looks like the Draw method is using an XOR pen, which is a common method for drawing shapes. An XOR operation is similar to inverting the colours, so by drawing it the second time, you effectively erase the old shape before drawing the shape at the new position.
|
|
|
|
|
I have a property page with a static control area defined as
CONTROL "",IDC_TEMP_GRPH,"Static",SS_GRAYFRAME,154,44,135,129
I am handling WM_PAINT message and the following piece of code gets executed:
CDC* pDC = new CDC(GetDC(this->m_hWnd));
HWND hStatic = GetDlgItem(m_hWnd,IDC_TEMP_GRPH);
RECT pirect;
GetClientRect(hStatic,&pirect);
COLORREF bkColor; bkColor = RGB(225,0,0);
HBRUSH hBrush = ::CreateSolidBrush(bkColor);
::FillRect(GetDC(hStatic),&pirect,hBrush);
The problem is I am not able to see this solid color block. It appears blinking while I drag the Property Sheet but disappears when I switch to next page and switch back to that page. Can anyone please tell me what is missing here?
|
|
|
|
|
Rather than painting from your dialog, try over-riding the static control.
Have a look at this article:
http://www.codeproject.com/KB/miscctrl/generic_picker.aspx[^]
It's not talked about in the article itself, but it uses an owner draw static control to do the pretty picture bit. Feel free to stealreuse it from me.
Iain.
|
|
|
|
|
Got my 5 , thank you for posting it.
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]
|
|
|
|
|
Thanks. I've got so much useful code from CP, I like to give back when I can.
I hope you've added yourself to pointy haired thread hijackers list...
Iain.
|
|
|
|
|
Iain Clarke wrote:
I hope you've added yourself to pointy haired thread hijackers list...
Well, since I'm (together with Rajesh) the proud founder of the Brigade, my name is necessarily there.
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]
|
|
|
|
|
Thanks. But I foound out what was missing from my code. I had to add
PAINTSTRUCT ps;
HDC hdc = ::BeginPaint(m_hWnd, &ps);
at the start and
::EndPaint(m_hWnd, &ps);
at end of my code snippet and it works.
|
|
|
|
|
First, use CPaintDC in the WM_PAINT message handler, not GetDC, and second, when you do this:
GetClientRect(hStatic,&pirect);
You get the client area of the static, not its position in the client area of its parent. If you want to know where the static lies inside of its parent use some coord mapping functions or simply this:
RECT pirect;
GetWindowRect(hStatic,&pirect);
ScreenToClient(&pirect);
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
I am using SDK so CPaintDC is ruled out. So I have to add BeginPaint() and EndPaint() instead fro it to work.
|
|
|
|