
Introduction
Control Positioner (Control Poser) - This is a small class for control repositioning. It can create an INI file, which logs all aspects of your controls (child windows). e.g.:
- Enable
- Visibility
- Default value (checked or text title)
- Size and screen position
So when you want to change them, you just update this INI file instead of recompiling your code. Sometimes it helps to create a highly flexible user interface, especially useful when the customer doesn't know what they want or your requirement manager has a really changing personality :-)
How to use it:
- Include header CtrlPositioner.h in your Dialog/Main window code.
- In
OnInitDialog
add:
CCtrlPositioner poser;
poser.SetDlg(this);
poser.AddCtrl(IDC_STATIC);
poser.AddCtrl(IDC_CHECK1);
poser.AddCtrl(IDC_EDIT1);
poser.AddCtrl(IDC_BUTTON1);
poser.ReadPosData();
poser.PositionControls();
Notes:
- INI file is called CtrlPos.ini, this can be changed easily in CtrlPositioner.cpp.
- This class should also work with other parent windows besides
CDialog
, although I never tested it :-(
- Currently parent window's title is used as section name in INI file, it's not good as there could be more windows with the same caption on it. I would like to improve this if you can give me any suggestions?
I have over 13 Years IT industry experience as Principle/Senior Programmer. I am experienced in .NET/J2EE system design and detailed implementation. I master UML modelling and OO design methodology with a strong C#/C++/Java coding background. I have been in working/managing a distributed project using Agile/Waterfall approach. My business knowledge includes Telecommunication, Financial Investment/Trading, and Banking.