Solved

Scaling CFormView

Posted on 1998-06-17
5
353 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

726 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