|
Did you try with SetFont?
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Hi all,
I have plced a Bitmap in my control in a static frame using the Load Image Function.Now the bitmap is seen as a compressed or expanded one depending on the bitmap selected to load in that frame. How can i make the bitmap to fit in my frame with the full size in such a manner that the visible part of the image is seen on the static frame and the remaining portions are seen when a scroll bar at bottom or side is moved?. In short how can i show a bitmap in a static frame with scrolling using load Image Function?.
With regards
|
|
|
|
|
Shibu wrote:
In short how can i show a bitmap in a static frame with scrolling
You can't. You'll have to create your own window which supports loading images and scrolling.
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
I was attempting to use ATL attributes in VS.NET in a MFC project (to hook to an event fired by a COM object) but in order to get it to compile had to include the [module(name="SomeName")] attribute. AFAIK this generates DllMain, DllRegisterServer, and whatnot code, but as an MFC app it already has a WinMain?! Well the app compiles and works, but I am wondering if this is correct or I am doing something wrong?
|
|
|
|
|
I have a small dialog window that is a child of my parent dialog. It has the topmost window style set so I can be doing things in other windows and have my small child window of my app still visible on top of everything. When I click on the title bar to move it around the screen, upon releasing the mouse button, the parent dialog box pops up to right under the child dialog. This isn't the behaviour I'm desiring (I'd like to be able to move the child window around without seeing the parent, but I'm not sure how to get around it, or what to do. Any ideas?
Also, i'm taking a plain dialog resource for it (no controls), and in my OnPaint function for that dialog, calling GetClientRect() and drawing right to that rect. Is this wise?
- Jason
(SonorkID 100.611)
The Code Project - Orange makes the art grow fonder
|
|
|
|
|
hu?
CParentDlg::ShowChild()
{
dialog dlg
ShowWindow(SW_HIDE)
if( dlg.DoModal()== IDOK)
{
//bla bla
}
ShowWindow(SW_SHOW)
-Drawing on that plain dlg that OnPaint (WM_DRAW) message should do no harm
Daniel O
|
|
|
|
|
Can I create a popup menu (context menu) and make it apear at once, no animation.
Can I get the height of the created menu, I'd like to position it exatcly above a button?
Thanks for help!
|
|
|
|
|
1) I think you can't. There is only one way to solve this problem - switch "menu effects" options off in Windows Settings. Of course, you can paint menu manually, but is it worthy of that efforts?
2) Point is that Windows can place popup menus in different directions relative to point that you indicated to menu. It depends on how close this menu is to bounds of screen. If you will adjust menu position manually, it may result a bug in some particular case
|
|
|
|
|
Roman Fadeyev wrote:
1) I think you can't. There is only one way to solve this problem - switch "menu effects" options off in Windows Settings. Of course, you can paint menu manually, but is it worthy of that efforts?
I used BCMenu class, but any other ownerdraw menu works too. I need to figure out what makes it non sliding here on WIn9x, but at least it works.
void CBCDialogMenuDlg::OnButtonMenu()
{
BCMenu menu;
menu.LoadMenu(IDR_MYTYPE);
BCMenu* pPopupMenu = (BCMenu*) menu.GetSubMenu(0);
ASSERT(pPopupMenu != NULL);
CRect rect;
m_away.GetWindowRect(rect);
pPopupMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.left, rect.top, this);
}
Roman Fadeyev wrote:
2) Point is that Windows can place popup menus in different directions relative to point that you indicated to menu. It depends how close this menu is to bounds of screen. If you will adjust menu position manually, it may result a bug in some particular case
good point. I'll make sure my window is big enough to hold the menu over the button.
|
|
|
|
|
When I said "paint menu manually" i indeed meant a ownerdraw menu. But remember that using of ownerdraw menus may lead to refusing from some Windows abilities as WinXP Themes and etc.
Somehow or other, we have found consensus
|
|
|
|
|
well.. I tried a bit with CButtonST. I can at least meassure the height of the menu there. Some code.... not finsihed yet, but seems to work:
void BCMenu::GetClientRect(LPRECT lpRect)
{
lpRect->left=0;
lpRect->top=0;
lpRect->bottom=0;
lpRect->right=0;
MEASUREITEMSTRUCT MIS;
BCMenuData *mdata;
UINT nID;
int num = GetMenuItemCount();
for(int i=num-1;i>=0;--i)
{
nID=GetMenuItemID(i);
mdata=FindMenuList(nID);
MIS.itemData = (DWORD) mdata;
MeasureItem(&MIS);
lpRect->bottom += MIS.itemHeight;
if(MIS.itemWidth > (unsigned) lpRect->right) lpRect->right = MIS.itemWidth;
}
lpRect->bottom+=5;
}
PS: I have choosen ownerdraw menu because I like the possibility bitmaps in menus
|
|
|
|
|
sliding is away, I used a onwerdraw menu.
Now I need to find out how to exactly position my menu... I think I will also figure that out now. thx
|
|
|
|
|
|
|
'TPM_NOANIMATION' is not declared (MSDN mentions it though).
I run WinME here and can't find this text string in any *.h file (I scanned my harddisk for it)
|
|
|
|
|
You can declare it yourself
TPM_VERNEGANIMATION=8192
TPM_NOANIMATION=16384
|
|
|
|
|
thx man!
But doesn't work on WinME.
Let me try compiling on XP.... yes, it works there.
#define TPM_NOANIMATION 16384
pPopupMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_NOANIMATION, rect.left, rect.top, this);
In which file do you have this definition, I can't even find it on my XP computer? However, I will choose a ownerdraw menu, b/c it works for Win9x/XP. I need to patch some more at class BCMenu (see other post in this thread), but this control looks nice on both Win9x/XP.
thanks for help! I will feedback the author of BCMenu later.
|
|
|
|
|
How to determine, that tooltip it will be displayed now, that it was possible to change his text.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
What kind of tooltip it is? Do you have your own CToolTipCtrl object or it's the one mainained by MFC?
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
I would like to use CToolTipCtrl if such it is possible.
At me is the control similar to a grid and for each column and a line I need to draw the individual text.
What can you advise me?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
|
Yes but message TTN_NEEDTEXT is sent once for all control. That this message is sent second time to me it was necessary to leave a control and then again to go on him. Such approach bad.
How to force the message to be sent at change of a line and a column inside a control.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
You need to check mouse cursor position in OnMouseMove. If you want to display tooltip, call m_tooltip.Activate(TRUE). If you want to turn off tooltip, call m_tooltip.Activate(FALSE). If you want to change the text of the tooltip, call Activate(FALSE), then Activate(TRUE).
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Many thanks. All seems works.
One more small question how to force to be displayed the balloon tooltip
Best regards,
Eugene Pustovoyt
|
|
|
|
|
In the sample, message 1 will be the expected return
message 2 always returns "Help Dir", what am i not doing right.
any helps always appreciated.
CString mDest;
1. AfxMessageBox(m_FileObject[t].m_Dest);
if (m_FileObject[t].m_Dest = "AppDir")
mDest = "App Dir";
if (m_FileObject[t].m_Dest = "SysDir")
mDest = "System Dir";
if (m_FileObject[t].m_Dest = "WinDir")
mDest = "Windows Dir";
if (m_FileObject[t].m_Dest = "HlpDir")
mDest = "Help Dir";
2. AfxMessageBox(mDest);
shotgun
frustrations just a way of knowing your alive...
|
|
|
|