Problem: 1661514

Title: (ACS - CDialog_AC) bugs

Received: Jun 9 1997 11:34AM


I've been adventurous lately and have dabbled a bit with the Apple Class Suite classes. Specifically the Dialog wrapper class AC_CDialog. I've found a few bugs that I'd like to share with you.

1) AC_CDialog::SetControlTitle() does not set the title of the corresponding AGA control.

2) AC_Dialog::HideDialogItem() and ShowDialogItem() don't work properly. Since the dialog manager hides the items by moving them, the actual user item that you plug into the DITL gets moved, but the AGA control doesn't know it so it draws itself in the old (unhidden) location. I changed this code so that it moves the bounds of the corresponding AGA control as well.

3) AC_Dialog::MoveControl() behaves in a manner that is inconsistent with the Dialog Manager call, MoveControl(), that it is wrapping. MoveControl() moves the control to the absolute location determined by the h and v values passed in. AC_Dialog::MoveControl() moves the control by a relative amount based on the h and v values passed in. It also calls MoveControl() for the real control without determining if the control was hidden (which it normally is because you do this when setting up the dialog) effectively un-hiding the original control.


Fix: Note the name change of the class to CDialog_AC.

1) SetControlTitle now calls through to CControl_AC::SetTitle

2) HideDialogItem and ShowDialogItem call SetCustomObjectVisibility, which sets an fVisible flag for a custom info field. HandleUserItem checks this flag by calling IsCustomObjectVisible.

3) MoveControl now sets the bounds of the CControl in absolute coordinates and checks if the control is visible before calling MoveControl.