Solved

Scaling CFormView

Posted on 1998-06-17
5
349 Views
Last Modified: 2013-11-20
I have written an order enty program that uses a CFormView dialog resource as the main screen.  The PC I used to develop the code was in 800 X 600 mode.  Now that other users are using the program, they are getting annoying scroll bars even when in 800 X 600 and without any other desktop interference (Office Bar, Start Bar, etc)
My ultimate goal is to resize the CFormView to fit at either 640 X 480, 800 X 600, and 1024X768.  How do programmers usually deal with different display settings?  Also, why are there scroll bars on every other system at 800 X 600 but not on mine?  I have tried using various combinations of SetScaleToFitSize() and GetParentFrame()->RecalcLayout() which eliminate the scroll bars but don't show the entire form. If its important the form contains a tree, listview, a RichEdit, and a bank of buttons at the top.  I can live without the status bar if necessary.  Thanks!
0
Comment
Question by:badges
5 Comments
 

Author Comment

by:badges
ID: 1318122
Edited text of question
0
 

Author Comment

by:badges
ID: 1318123
VC++ 5 Win95
0
 
LVL 2

Expert Comment

by:Belgarat
ID: 1318124
How should the controls on the form do after you resize it ? Should they change their sizes accordingly / move around ? Or do you want them to stick in upper left area of the resized dialog window ?

0
 
LVL 3

Accepted Solution

by:
shaig earned 100 total points
ID: 1318125
Use:
::GetSysInfo()    ( or GetSysMetrics, i don't remmember which )

you can also query the desktop window about it's size.
0
 

Expert Comment

by:alesatang
ID: 1318126
The Contradiction Between Flexibility and Rapid Development
-The condition of Dialog-based Windows and Size-Position Adaptation
Alesa Tang
Shanghai Bell SNA
98.6
Many programmer suffer pains when image to exploit the CFormView, CRecordView or CDialogBar to implement a Interface Rapidly and precisely. Because if the window*s size and position change, the dialog*s appearance will always be out of control. This kind difficulties are not only in VC, but also other tools like VB or Delphi.
Yes, its is easy to use dialog editor to locate the controls* position, size. But the dialog template has fixed physical location. The alternative is create the control dynamically as a child window in a view or controlbar. But these processes seem to be a little more laborious So a developer should make compromization when choose Rapid Develop or Flexibility.
Before make decision, the analysis should be taken carefully. There is two category of interface controls:
--Flexible Controls: CEdit, CTreeCtrl, CListCtrl,
--Not so flexible: Buttons, Radios, Checkboxes.
Which category is dominate in a interface? If the Flexible controls is major part, like the ClassView of the Visual Studio, a dynamic strategy should be selected. If you want outstanding effect, the labor is valuable. Other wise, the dialog template path might be better.
There is some factors shoul be take into consideration when create dynamic control:
1. The parent window*s OnSize should adjust the these child controls size and Position, like:
void COutputWnd::OnSize(UINT nType, int cx, int cy)
{
      CControlBar::OnSize(nType, cx, cy);
      if(cx>0)
      {
            RECT rc;
            GetClientRect(&rc);
            m_TabCtrl.MoveWindow(&rc);
            rc.left+=5;rc.right-=5;
            rc.top+=28;rc.bottom-=5;
            m_Terminal.MoveWindow(&rc);
            m_Terminal.RedrawWindow();
            m_AlarmHisList.MoveWindow(&rc);
      }
}

2. In dynamic controls case, if the 3D effect is wanted, you should draw some border lines manually.
Ref.
The Dockable PropertySheet in C++ topic group


0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
difference between String.subString() and String.subSequence() 6 200
building a service to accessed via telnet client, want colors ? 4 89
Change to event 1 115
Not needed 13 113
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question