What MFC class should I base free floating views on - mfc

I have a dialog based MFC application. Now I want to create a wiew (one or more) with a toolbar, scroll bars and a client window (based on CWnd).
What MFC class should I base this window on?
What is the best way to do it?
Thanks.

Using a scrolling client window is more natural in a Document-View application than a dialog based application -- you can have menu bars and toolbars connected to a dialog, but to a View as far as I know.
A SDI application allows support for multiple docking/floating toolbars and multiple views of the same document, so this would be my advice...

Start with a CFrameWnd. It's job is to give your window a titlebar/close button etc., and position control bars (such as a toolbar) and a menu (if you want one) and a view within itself. The view should be a CScrollView (for painted graphics) or a CFormView (for dialog-like controls).
You will find this to be a lot easier if your just start from scratch and let the app wizard generate an SDI or MDI app to start with.

Related

MFC floating CDialog control clipping issue

I am making an SDI MDF application that uses a frameview to provid the user with a set of controls (buttons, editboxes and such). The view also owns a set of CDialogs used to desplay aditional controls that can be can be shown or hidden via a tabcontrol and other means. Untill recently the dialogs have been staticly placed at creation to be in their proper location on the screen but I wanted to add a dialog that the user could move around but is still a child of the view. When I created a dialog with a caption and sysmenu that the user can move around the issue I am running into is that when the window is placed over another control owned by the view, (lets say a button) when the paint method is called on the button, it draws over the dialog. The dialog is still on top and the dialogs controls can still be interacted with but the button is drawn over them untill the dialog is repainted. I have tryed to change the clipchild and clipsiblings settings of the dialog and have been able to get the dialogs to properly clip eachother but can not seem to get the child dialog to properly clip the parent view controls. Does anyone have any ideas on what setting might fix this clipping issue.

How To Change Panel/view in the Windows Client Area in MFC

I want to design a student registration and exam recording app using C++ MFC with a kind of child window containing buttons edits and other common controls which is displayed on the app client area, and can be removed and replaced with another one by clicking a button. Thats the problem i face now( The GUI ). I came from JAVA background where this can be done by creating a JPanel as a container for the buttons, combo boxes and text fields controls. the panel is displayed on the client area and can be removed and replaced with another panel containing a new set of controls. I tried learning CView but it keeps talking about documents and views that displays untitled document as in word processing. Any pointer will be appreciated. Thanks.
After having searched and read a lot about my problem, i decided to go into win32 API where everything is possible depending on your awareness.The solution is as simple as creating a main window and creating any number of child windows who uses the main window as parent and all has a hiden window attribute. Then you can create controls on each child window. To switch between the child windows I did this: ShowWindow(childWindow1, SW_HIDE); ShowWindow(childWindow2, SW_SHOW);. thats it, only that the repaint process after restore does not repaint the child window's controls and its child window.

MFC tooltip for list control of dialog box

I have developed on application, which shows a dialog box with two list controls.
In this list control, I am showing images. Now I want is, when we move the mouse on images from the list control of dialog box, It will show tool tip for that.
How can I show tool tips for images in a list control in a dialog box?
The CToolTipCtrl control is the MFC wrapper class around the Win32 "tool tip". You can use this to display a small pop-up window to describe another control or provide additional information in your app.
If you're using a ListBox control, explore one of these sample projects to see how to display tooltips for individual items displayed within that ListBox control:
ListBox With ToolTip Support
List Box With ToolTips
And if you're using a ListView control (CListCtrl in MFC), then you should start by reading the documentation for the GetToolTips function and the corresponding SetToolTips function. You can also check out how this sample ListView control implements tooltips:
CListCtrl and Displaying a Tooltip

Insert an UI into another MFC Dialog

I have one MFC application (exe) that contains two panes in its main UI. This application loads another DLL that also contains one dialog. How can I programatically place a Dialog defined into the DLL, and put it into (within) the pane of the MFC application? The question is not how to programatically retrieve the dialog from the DLL but how to put this dialog 'on the top' (within, inside) of one UI pane that belongs to the application?
My goal is to customize the UI of the application with dialog(s) retrieved from a dll and give the user the feeling that these dialogs all belong to one application UI. Thanks for any hint.
I have some applications with this feature, often with a tab control to alternate between windows.
First I set a frame in the container window, invisible to the user. The frame is just a placeholder to where the dialog window will be.
Then I make an instance of the dialog window as a global variable in the container class, I create the dialog window as a modeless window (using Create(), not DoModal()), move the window to the same RECT of the frame control, and call ShowWindow() to show the window.
Am I understanding you correctly that you don't want the dialogs to appear as dialogs, but rather as content of another window, or as a pane?
In other words, you want to get rid of the dialog's title bar and embed the dialog's content into another window, is that right?
That is possible. You would need to create the dialog without the title bar (change the window style) and make sure that you create the dialog's window as a childwindow of the window where you want the content to go. I can explain this further but I first would like to know if I'm understanding you correctly.

MFC MDI CView and some kind of bar at bottom of CView

I have created a MDI project with CView's using VS2008Pro.
I want to have some sort of bar at the bottom of every CView where i
can put controls on, like buttons. I dont know how this bar is called
and how to create one for every CView.
I have a picture of it here to explain what i want.
http://www.4shared.com/dir/32975742/b4bac91c/CView_Bar.html
Could someone please tell me what kind of bar this would be and how to
create it for CViews?
Thanks.
I think, what you want is basically a Toolbar (to answer your question how it is called) in an MDIChildWindow (similar like the toolbar in the main frame window of your application which is created usually by the MFC application wizard automatically). The way to add a toolbar in a child frame window is very analogous to what the wizard has added to the main frame window. You can decide in code where the toolbar shall be located (top, bottom, left, ...)
You can find a brief "How to..." here: http://support.microsoft.com/kb/155141
Also try to google by "Toolbar in MDIChildWindow" or similar. You'll find many resources, I believe.