I am continuing to try and adopt our existing application to Prof UIS. We have a number of dialog bars derived from CDialogBar. As I understand it, I should create a CExtControlBar, then the controls should be in a CExtResizableDialog. I’ve been working in an experimental application to prevent trashing the main ap too much.
So far I’ve been able to get the dialog bar to display, but sizing is proving to be a problem. I need to be able to control the size of the bar programatically and I don’t want the user to be able to resize it. I derived my own CExtControlBar class below
class CNewControlBar : public CExtControlBar
{
public:
inline CNewControlBar::CNewControlBar() { m_bFixedMode = true;};
virtual void _RowResizingStart() const {};
virtual void _RowRecalcingStart() const {};
};
This displays the bar as a fixed size, but the height is not correct. I also found that I was supposed to make these calls to set the initial size:
m_dlgbarDlgBar.SetInitDesiredSizeVertical(CSize( 1, 1 ));
m_dlgbarDlgBar.SetInitDesiredSizeHorizontal(CSize( 1, 1 ));
However, they don’t seem to work. It doesn’t seem to matter what I put into the CSize call, the bar always draws the same size. I thought the size of the dialog child might have something to do with the initial size, but even when I made the dialog with a height several times its original size, it still drew the same size. The CExtControlBar is about 2X the height of the row of controls on the dialog bar and nothing seems to change it.
I tried calling GetWindowRect for the child dialog, then call MoveWindow for the CExtControlBar derived bar, but that did nothing. When I called GetWindowRect for the control bar, the dimensions returned had top==bottom, and left==right.
One of the dialog bars needs to be programatically resized depending on events. I’m not sure how to go about resizing the bars.
Thanks in advance,
Bill