I have a CViewIamge class that is derived from the CScrollView. Displaying images on a picture control on CDialog derived dialog. How can I add zoom in capability?. Currently using SetDIBitsToDevice in the OnDraw.
Related
I have a CTabCtrl and I am using WindowsBlinds to skin my computer GUI.
This is a MFC CDialog object.
Is there anything I can do in code so that the grey area renders transparent?
I tried setting the transparent resource property but it did not work.
I have a class derived from CPropertySheet. Please let me know how can I change the font of this propertysheet tab along with fonts in all pages. Currently they used system font only.
Also I would like the dialog box to come up at specific location on screen and remain there only. Please let me know how can I change location of propertysheet dialog when it is getting initialised.
Thanks
CPropertySheet inherits the SetFont method from CWnd. You could call this method from CPropertySheet::OnInitDialog. Do the same thing in the pages to set their font.
I currently have a class that inherits from QLabel this class implements the methods mouseMoveEvent and leaveEvent. When the mouse is over this widget a dialog box is displayed. However the dialog box only disappears if a mouse click occurs elsewhere. I want the dialog box to disappear when the mouse moves out of the reqion of this widget. I therefore thought about using the leaveEvent method which would call dialog.hide(). My question is how can I determine if the mouse cursor is in the region of a widget ?
Have a look at Qt - Determine absolute widget and cursor position. Two ways are explained there.. using coordinates and using QWidget::underMouse().
I have a dialog-based MFC C++ app. My dialog displays a number of "pages" (similar to a tab page or property dialog box).
I display each "page" by displaying a Child window over the top of the parent's client area. This works fine on Vista until I then open another window on top of the child.
Vista then seems to draw a thick white rectangular frame within my parent dialog box which paints over the top of my "page" child window(s). If I move another window over the top of this white rectangle, it will repaint the obscured area just fine.
Can somebody please tell me what is going on? Is Vista trying to clear my non-client (frame) area using incorrect coordinates perhaps?
My parent dialog is a skinned class derived from CDialog which handles the painting of my own window titlebar and frames. I've found that if I don't call CDialog::OnNcActivate() within my own OnNcActivate() method, the white rectangle doesn't appear. Of course if I do this then I can't use my child windows.. but OnNcActivate would appear to be related to the problem.
I've figured out the problem.. I shouldn't be calling CDialog::OnNcActivate() - I should have just been returning TRUE instead. All working fine now.
Is there something like a panel that I can use in a MFC application. This is to overlay the default window in MFC (a dialog application). Then to paint the panel black and paint some random stuff on top of it. Something like a view port.
is there a better option than this to achieve the same effect ?
Sure. It's called a window! Create a class that derives from CWnd and overrides OnPaint().
In your dialog's OnInitInstance(), instantiate a CMyWnd object and call it's Create() member. Of course, make sure the lifetime of your CMyWnd object is the same as the dialog's object lifetime window. iow, make it a member of you CMyDialog class.
Not very complicated but obviously an area where MFC shows why it doesn't fall in the RAD tools category.
Another solution would be to derive from CDialog. This way you can use the resource editor to edit the panel visually and you don't need to paint anything yourselve. Also the Panel class is rather thin and just needs to propagate the Create() and Show() calls to support subpanels and multiple panels within a single form.