Re: More CChildFrame questions

Tech-Archive recommends: Speed Up your PC by fixing your registry



See below...
On Fri, 22 Jun 2007 16:59:12 +0100, "GT" <ContactGT_remove_@xxxxxxxxxxx> wrote:

One of these charts is a resource loading chart view. This view can
'reside'
in a childframe or can be in a docking pane, or can be turned off. There
is
only ever one instance of the view, but it needs to calculate loads of
points on the chart before it can be drawn. There are other settings on
this
chart, such as the scrollbar positions and the zoom factor. At present I
store all this data in the one class - my view class. I now realise that
this data should be moved to the document (for all to see, thereby
breaking
encapsulation and making the code very untidy and messy and hard to
maintain!!).
*****
Really? How?

Note that your notion of persistence beyond the view "breaks
encapsulation" because it
MANDATES that the view data live beyond the life of the view. You can
maintain the purity
of your code and spend a long time recomputing all the values, or you can
create means of
preserving cached data, but you have ALREADY said your data lifetime and
your view
lifetimes are different, so what "encapsulation" have you broken?

I clearly don't have a complete grasp on the view/frame relationship. My
original problem is that everyone insists that the view has to be destroyed
and another one created in its place when I need a new frame- why? Why do we
have to destroy the view just because we are removing the frame currently
holding that view? Let use an example to explain why this simply doesn't
make sense:
****
A CView is a wrapper class on a window. The window is a child window of the frame window.
When the frame window is destroyed, just like in any other window, the children are
destroyed. When a window is destroyed, the CWnd-derived class associated with it is
destroyed. You seem to think these things have an independent life, but they do not. The
window represented by a CView class is a child of a window represented by a CFrameWnd
class, at the operating system level. By insisting that you think these are somehow
independent entities, you are violating the basic design of MFC and you are violating the
basic structure of the operating system.

That's it.
joe
****

My design:
I have a photo on my PC. I have zoomed in on an area of that photo and
printed it out. It is hanging in a frame on my wall. I would like a nicer
frame for my picture, so I take this picture out of the frame and leave it
hidden in a drawer for a few months until a new frame arrives. I can then
put my picture into the new frame and back on the wall for all to see. No
need to reprint the image, just place the existing image into the new frame.

Your design:
I MUST throw the picture away with the old frame and when my new frame
arrives I have to go to great lengths and open the original photo on the PC,
re-create the zoomed area of the picture, then clip this and setup the
printing parameters again and print, then trim the paper. All these
production details and parameters are jotted down on a post-it note, or
notepad somewhere. Basically, you are saying I have to recreate my picture
and only then can I put this new picture into the new frame and hang that.

Now who has the bad design?

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: picture viewer in Leopard
    ... opens in an overlay window, with a while frame, which adjusts to the ... size of the picture, while the background web-window gets greyed out. ...
    (comp.sys.mac.misc)
  • picture viewer in Leopard
    ... Whenever I want to view a picture in FF or Safari or such, ... opens in an overlay window, with a while frame, which adjusts to the ...
    (comp.sys.mac.misc)
  • Re: WinCreateStdWindow, Client and Frame question
    ... frame and a client window simultaneously. ... A destroy call to the parent will also destroy all children and below. ...
    (comp.os.os2.programmer.misc)
  • Re: How to capture a still picture from a video
    ... You can import your video into MovieMaker and play it from the collection ... Seek to the frame you want then click the right most icon below the ... preview window (it has a picture of a camera). ...
    (microsoft.public.windowsxp.moviemaker)
  • Re: 2 pics in layers
    ... > Is it possible that user picks a picture (it opens in same or a new window) ... > and then picks a frame (which is added to the border of the picture ... if you don't want to rely on clientside stuff ...
    (comp.lang.php)