|
My problem is that when i rotate my multiline text 180 degrees , the text is rotated but the ordering of lines in the text is wrong as the first line comes as last and last line comes as first(for eg. if i have two lines line1 & line2 then after rotation line2 is displayed and below it line1 is diaplayed).I have passed the DT_WORDBREAK as parameter to the CDC drawtext function to handle word wrapping.
Is ther any other way to handle rotation of multiline text?
Kindly let me know
|
|
|
|
|
The following example shows how to rotate text at any angle (doesn't work on 95/98/ME). It renders text at (50, 50) rotated 30 degress clockwise.
--------------------------------------
CPaintDC dc(this);
int OldMode = SetGraphicsMode(dc.m_hDC, GM_ADVANCED);
static const double pi = 4.0*atan(1.0);
static const double angle = 30.0*(pi/180.0);
static const XFORM xf = {cos(angle), sin(angle),
-sin(angle), cos(angle),
0, 0};
SetWorldTransform(dc.m_hDC, &xf);
CRect rcClient;
GetClientRect(&rcClient);
rcClient += CPoint(50, 50);
dc.DrawText(_T("Hello\nThere"), -1, &rcClient, 0);
SetGraphicsMode(dc.m_hDC, OldMode);
--------------------------------------
Steve
|
|
|
|
|
hi all,
plz tell me how to draw colored button in mfc
thanks in advanced
Rahul here
|
|
|
|
|
You have to use ownerdraw...
- NS -
|
|
|
|
|
|
Hi rahul.shendurnikar,
You can use derived CButton and use WM_DRAWITEM in class
|
|
|
|
|
Hi all,
I have a CTreeCtrl as a child of a docking window (CMyBar). In my docking window class I set a handle just like this:
(
CMyBar.cpp)<br />
ON_NOTIFY(TVN_SELCHANGED, ID_TREE, OnTreeChange) ...<br />
The declaration of the function is
(CMyBar.h)<br />
afx_msg void CMyBar::OnTreeChange(NMHDR *hdr, LRESULT *NotUsed)<br />
I had to explicity add the ON_NOTIFY handler because the Visual Studio6 ClassWizard doesn't show the ON_NOTIFY event for my docking class (CMyBar), (don't know why?).
As far as I know CTreeCtrl does send ON_NOTIFY notifications to it's parent (CMyBar). Spying++ CMyBar window class shows CMyBar gets WM_NOTIFY messages...
Now all this crap doesn't work (OnTreeChange never gets called), and I'm to figure out what's going on and what's wrong with it.
Would be really happy if someone can answer this question...
Thank you!
|
|
|
|
|
try to look with spy on the Tree Control properties, perhaps it has a flag indicating not sending a parent notify (WM_PARENTNOTIFY).....in my code the selchange does call the parent notification and the method OnTreeChange does get called....
hope this helps
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi Yaron,
Thanks for the reply... But the problem is my parent window (CMyBar) does get WM_NOTIFY and VM_PARENTNOTIFY messages(I've checked it with Spy), but my method OnTreeChange never gets called...
I'm new to MFC and I'm sure I'm missing something here.
Jim Jim
|
|
|
|
|
well, if you have checked it with spy and the Bar does get the WM_NOTIFY message, then check the id of the tree control (IDC_TREE) check the name of the function.....other than that it suppose to work....
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote: well, if you have checked it with spy and the Bar does get the WM_NOTIFY message, then check the id of the tree control (IDC_TREE) check the name of the function.....other than that it suppose to work....
Thanks for your help! You're right, it was a an incorrect id of the tree control.
Jim Jim
|
|
|
|
|
hi all,
i am unable to access the property page control values from another property page.
// snippet of the code
CPropertySheet dlg(_T("Hellow"), this, 0);
one a; //First Property Page
two b; //second Property Page
three c; //third Property Page
dlg.AddPage(&a);
dlg.AddPage(&b);
dlg.AddPage(&c);
dlg.SetWizardMode();
dlg.DoModal();
//================================================
if the first property page contains the ComboBox with some values i am trying to acces the values in the second property page as
one* m_Main2 = (one *) GetParent();
CString str;
for(int i =0;i< m_Main2->p->GetCount();i++)
{
m_Main2->p->GetLBText(i,str); // p is the pointer of the combobox
MessageBox(str);
}
where p is the pointer of combobox control in the first property sheet.
any solutions for this please.
thanks
uday.
uday kiran
|
|
|
|
|
The dialog of property will be created only if it is shown once. That is why you can't access them.
- NS -
|
|
|
|
|
As each tab loses focus, store the control's values in the sheet (parent).
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have a big project and when run application, VC report leak memory but I don't know variable is cause leak memory? Can you help me
-----------------
conglt
|
|
|
|
|
Install Bounds checker
never say die
|
|
|
|
|
Bounds checker is good but expensive, I can't buy it
-----------------
conglt
-- modified at 3:28 Tuesday 18th April, 2006
|
|
|
|
|
|
thanks
-----------------
conglt
|
|
|
|
|
|
thanks
-----------------
conglt
|
|
|
|
|
Hi all
Can someone tell me steps I need to take in order to change my programs default MFC icon to the icon I want ?
Thanks.
I am having some strange problems, when simply rename the icon i want to IDR_MAINFRAME
|
|
|
|
|
where u see in the code LoadIcon and IDR_MAINFRAME change the IDR_MAINFRAME to your desired icon (use the MAKEINTRESOURCE maco if it an icon from the resources)
hope it helps
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi big_denny_200
Example
HICON h=LoadIcon(AfxGetApp()->m_hInstance,(LPCTSTR)IDI_ICON1);
SetIcon(h,0);
|
|
|
|
|
Hi friends,
1)What is user of global static variables.
2) can i user those vars in other files with extern keyword?
Vikram S
|
|
|
|