Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

jaknupp

@jaknupp
About
Posts
4
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Refresh/redraw controls in CFormView
    J jaknupp

    I have a CFormView with 2 CStatic bitmaps used for backgrounds. One has an ActiveX graph control above it and the other has another bitmap. Z order is set so background bitmaps are on the bottom. Clip children and clip siblings are set. When first displayed everything looks good. After minimize/restore or covered by another window the background bitmaps display above the other controls. To test I added a button and have the handler in CFormView that does m_graph.Invalidate() and m_foregroundbitmap.Invalidate(). When pushed the graph and forground bitmap display correctly. I also tried having the button handler just do Invalidate() (for the form view) which also displays correctly. Putting Invalidate() in any other handler (i.e. OnSize, OnActivate) doesn't work. It seems that the graph and foreground bitmap update but then the background bitmaps update and draw over the others. Setting Invalidate() in OnParentNotify() from the graph control does work but unless the mouse is over the control there's no notify messages so no update. I've also tried SetWindowPos(&CWnd::wndTopMost... which didn't seem to change anything. Are there any ideas on what I might be missing or maybe another way to have controls over an image? (I need the background image because it gives a quick view to what changed in the control.) Thanks, John

    C / C++ / MFC com graphics data-structures question announcement

  • Replace dialog in FormView
    J jaknupp

    I actually did find something useful. Adding this line to the CFormView constructor lets you use any dialog for the form view: CMFCView::CMFCView() : CFormView(CMFCsdi2View::IDD) { m_lpszTemplateName = MAKEINTRESOURCE(View_IDD_TO_USE); } So at run time I can set View_IDD_TO_USE to the resource for IDD_DIALOG1 or IDD_DIALOG2. The form view then gets created with whichever of the resources I choose. I create the event handlers in the view, i.e. OnOK(). The controls in each dialog need to be the same including names so that when the view creates the handlers they can be mapped, i.e. there must be a control named ID_OK on each dialog so the view can correctly map ID_OK to OnOK(). That means no duplicated code, only two dialogs which doesn't add to much overhead. This works great for what I'm doing. Thanks to Scott McPhillips for the direction.

    C / C++ / MFC

  • Replace dialog in FormView
    J jaknupp

    I was thinking about doing resizing but I have another app that allows resizing and it was a bit tedious to change control sizes, rearrange based on the new window size and update font sizes. I was hoping to layout 2 dialogs in the resource editor and then just switch between the two. Is there an easier way to resize controls instead of calc window size, scale controls then move to new relative positions?

    C / C++ / MFC

  • Replace dialog in FormView
    J jaknupp

    I have a SDI app using FormView that's not resizable but will have a large and small size. I would like to create small and large dialogs and then have the view display the correct dialog depending on user choice. I don't want to use multiple views because I don't want to recode handlers, etc. My plan is to i.e. have button ID_OK1 in small dialog and button ID_OK2 in large dialog both to to OnOK() so my code only has to be written once. Any ideas would be appreciated. Thanks, John

    C / C++ / MFC
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups