As what often happens, I found my problem after posting. In the words of Emily Latella, "never mind" (I think that was Emily, wasn't it?)
genush
Posts
-
GetHeaderCtrl returns null -
GetHeaderCtrl returns nullI have a multidoc app based on CFormView. I have a dialog using CListCtrlEx. Everything works fine. I moved the CListCtrlEx object from the dialog to the view (CFormView). Now it doesn't work. The call to GetHeaderCtrl() for the CListCtrlEx object now returns NULL whereas it didn't when that object was in the dialog. Anyone know why that should be and how I can get the call to GetHeaderCtrl() to return the CHeaderCtrl() when it's in the view instead of the dialog? Thanks in advance.
-
CMDIChildWnd changing size unexpectedlyThank you for the response. I tried that by overriding OnSize in both the child frame I want to keep maximized and the others I want to cascade. But the ones I want to cascade still come up maximized. I'll keep fiddling around with it.
-
CMDIChildWnd changing size unexpectedlyI have a multidoctemplate app, call it MyApp. For the default doc-view-frame of MyAppDoc-MyAppView-CChildFrame, I override the frame ActivateFrame to show the frame maximized. I added another doc-view-frame set, NewDoc-NewView-NewFrame, NewFrame derived from CMDIChildWnd. I override NewFrame ActivateFrame to show it normal. When I create and show a NewDoc object, it displays correctly but now my MapAppView is no longer maximized but cascaded with the NewView object. Why would anything I do with NewView affect anything I had done with MyAppView? I want MyAppView to continue to be maximized but NewView to be normal since I may create a lot of NewView objects and I want them cascaded when they are first shown. Thanks in advance.
-
how to properly display buttons over an imageI did something similar. After the drawing procedure, I have each button redraw itself, and this appears to be working. Thanks to all for your time and help! :)
-
how to properly display buttons over an imageI'm sorry, I don't understand. Do you mean call SetFocus() for the buttons?
-
how to properly display buttons over an imageOops, I was a little hasty. I also show static text below the button. I call OnCtlColor(*) and set the hbr (HBRUSH) returned to a hollow brush. The text is then displayed over the image. After setting WS_CLIPCHILDREN, the text background is no longer transparent but light gray.
-
how to properly display buttons over an imageThat worked! Thanks!!
-
how to properly display buttons over an imageI call the functions to draw in the OnDraw(CDC* pDC) function of the CFormView The buttons are put on the form with the resource editor, then I assigned names with class wizard. The image is displayed correctly so it looks like the image is overwriting the buttons. Interestingly, when the cursor is moved to the title bar, the OnDraw gets called, and the buttons disappear. I put in code to detect when the cursor is in the title bar and call Invalidate() in the form to cause OnDraw to be called again, then the buttons are displayed.
-
how to properly display buttons over an imageI have a CFormView where I want to display an image and show some buttons over the image. I get the device context for the view, create a compatible bitmap, use the LPPICTURE Render(*) function to display the image file into the DC, then use BitBlt(*) of CDC to display the image. The buttons are placed onto the form. This kind of works, although if I display another window over the form, or move the cursor into the title bar or the system status bar, all the buttons disappear. I would like to place the buttons dynamically, and tried to use SetWindowPos(*) for one of the buttons. But when I called SetWindowPos(*) for that button, everything (image and other buttons) disappeared. Is there a proper way to display buttons over an image so they don't disappear, and also to do so dynamically?
-
can one use vectors of subclasses in a parameter list?Thanks for the responses everyone. I'll go with the template function.
-
can one use vectors of subclasses in a parameter list?I am trying to pass in a vector of some subclass to a function defined with the base class in the parameter list, like void mod(vector < baseclass > &bcs). If I have a vector of subclass objects, as vector < subclass > sc, and call mod(sc), I get the error "A reference that is not to 'const' cannot be bound to a non-lvalue". Doing this without vectors is no problem; i.e, void mod(baseclass &bc), subclass sc; call mod(sc). I can get around this by defining 2 sum(*) functions, one with a baseclass parameter and one with a subclass parameter, but there goes the use of inheritance. The vector will by modified by mod(*), so I don't want to pass as const. Is there a way I can use 1 function on both the base and sub classes? Thanks.
-
removing the maximize boxHmmm, I tried that in the CMainFrame::PreCreateWindow(CREATESTRUCT& cs) by setting: cs.style &= ~WS_MAXIMIZEBOX before the call to CMDIFrameWnd::PreCreateWindow(cs) which disabled the maximize box but did not remove the button from the title bar. Am I doing that wrong?
-
removing the maximize boxIs there a way to remove the maximize box from the view title bar in a multidoc app? I used DeleteMenu(*) or ModifyStyle(*) to disable the maximize button but these do not remove the button from the title bar. Thanks in advance.