CFormView, ResizeParentToFit - Programmer

This is a discussion on CFormView, ResizeParentToFit - Programmer ; Background: ------------- Using MFC - this should be VC++6.0 and later SDI with CFormView. Overriding CMainFrame::RecalcLayout to get better fit around form, then calling: GetParentFrame()->RecalcLayout(); ResizeParentToFit(FALSE); Problem: -------------- Right-most panes in StatusBar are clipped. This appears to be dependant on ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: CFormView, ResizeParentToFit

  1. CFormView, ResizeParentToFit

    Background:
    -------------
    Using MFC - this should be VC++6.0 and later
    SDI with CFormView.
    Overriding CMainFrame::RecalcLayout to get better fit around form,
    then calling:
    GetParentFrame()->RecalcLayout();
    ResizeParentToFit(FALSE);

    Problem:
    --------------
    Right-most panes in StatusBar are clipped. This appears to be dependant on
    size of form used by CFormView.


    Question:
    --------------
    How to fix so that all StatusBar panes are visible? Do I need to resize the
    StatusBar after the View is resized? Or is there an easier solution?


    Perhaps something like the following:
    -----------
    void CMyAppView::OnInitialUpdate()

    {

    CFormView::OnInitialUpdate();

    GetParentFrame()->RecalcLayout();

    ResizeParentToFit(FALSE);

    static_cast(GetParentFrame())->ResizeStatusBar();

    ....



    void CMainFrame::ResizeStatusBar()

    {

    ...

    m_wndStatusBar.SetWindowPos( ...);




    --
    ---------------------------------------------------------------------
    DataGet & PocketLog www.dataget.com
    Data Collectors www.baxcode.com
    --------------------------------------------------------------------





  2. Re: CFormView, ResizeParentToFit

    Hallo Baxter!

    > Background:
    > -------------
    > Using MFC - this should be VC++6.0 and later
    > SDI with CFormView.
    > Overriding CMainFrame::RecalcLayout to get better fit around form,
    > then calling:
    > GetParentFrame()->RecalcLayout();
    > ResizeParentToFit(FALSE);
    >
    > Problem:
    > --------------
    > Right-most panes in StatusBar are clipped. This appears to be dependant on
    > size of form used by CFormView.
    >
    >
    > Question:
    > --------------
    > How to fix so that all StatusBar panes are visible? Do I need to resize the
    > StatusBar after the View is resized? Or is there an easier solution?


    No there is no such function because the status bar uses always only the
    left over space and never controls the size of the parent.

    --
    Martin Richter [MVP] WWJD
    "In C we had to code our own bugs. In C++ we can inherit them."
    FAQ : http://www.mpdvc.de
    Samples: http://www.codeguru.com http://www.codeproject.com

  3. Re: CFormView, ResizeParentToFit

    "Martin Richter [MVP]" wrote in message
    news:dhtov2.704.1@news.grutzeck.de...
    > Hallo Baxter!
    >
    > > Background:
    > > -------------
    > > Using MFC - this should be VC++6.0 and later
    > > SDI with CFormView.
    > > Overriding CMainFrame::RecalcLayout to get better fit around form,
    > > then calling:
    > > GetParentFrame()->RecalcLayout();
    > > ResizeParentToFit(FALSE);
    > >
    > > Problem:
    > > --------------
    > > Right-most panes in StatusBar are clipped. This appears to be dependant

    on
    > > size of form used by CFormView.
    > >
    > >
    > > Question:
    > > --------------
    > > How to fix so that all StatusBar panes are visible? Do I need to resize

    the
    > > StatusBar after the View is resized? Or is there an easier solution?

    >
    > No there is no such function because the status bar uses always only the
    > left over space and never controls the size of the parent.



    Why is the StatusBar being clipped? Perhaps it's in the order that the
    parent (CFormView) is being resized?

    (note: I am using code from www.codeproject.com for the resizing.)


    --
    ---------------------------------------------------------------------
    DataGet & PocketLog www.dataget.com
    Data Collectors www.baxcode.com
    --------------------------------------------------------------------






  4. Re: CFormView, ResizeParentToFit

    Hallo Baxter!

    > Why is the StatusBar being clipped?


    This is by design. There is no minimum size for the status bar.

    --
    Martin Richter [MVP] WWJD
    "In C we had to code our own bugs. In C++ we can inherit them."
    FAQ : http://www.mpdvc.de
    Samples: http://www.codeguru.com http://www.codeproject.com

  5. Re: CFormView, ResizeParentToFit

    Makes it a bit difficult to use those panes on the rt-hand side of the
    StatusBar.

    --
    ---------------------------------------------------------------------
    DataGet & PocketLog www.dataget.com
    Data Collectors www.baxcode.com
    --------------------------------------------------------------------



    "Martin Richter [MVP]" wrote in message
    news:di0n3n.6hg.1@news.grutzeck.de...
    > Hallo Baxter!
    >
    > > Why is the StatusBar being clipped?

    >
    > This is by design. There is no minimum size for the status bar.




+ Reply to Thread