Ok, here we go. This patch allows each page of the sheet to be a different size, as specified in the dialog template. The sheet is resized to "fit around" the page, as opposed to the normal behavior that all pages end up the same size as the biggest page. The "Next"/"Back"/etc buttons and the lower separator will be moved to the appropriate positions. It does not allow user-resizing, though the foundations of such functionality have now been laid.
A word of caution however. I urge us to use particular restraint with this powerful new functionality. There is no reason for every page to have a different size, or indeed for any of the other pages to vary from their MS-recommended sizes. The Chooser page is a special-case for which no other solution seemed to present itself. Two known minor issues: - The lower separator actually ends up going to the left edge of the sheet. This is because the controls are only moved, not resized. It's not very noticable, but should be fixed before a release. - The first time the "splash" page is displayed, it has an enabled "Back" button, which it shouldn't, it should be disabled. It does nothing if you press it, but again, something that should be fixed before release. Oh, and sorry, no Cyppy yet. ;-) Diff, Changelog, and new file attached. Wow, that's a load off. I feel better already! ;-) -- Gary R. Van Sickle Brewer. Patriot.
bigchooser.diff
Description: Binary data
2003-02-02 Gary R. Van Sickle <[EMAIL PROTECTED]>
* AntiVirus.cc (AntiVirusPage::OnActivate): Change from void to long
return value. Refuse activation if no antivirus program is present.
(AntiVirusPage::OnNext): Return 0 instead of IDD_SOURCE.
* AntiVirus.h (AntiVirusPage::OnActivate): Change declaration from void
to long return value.
* desktop.cc (DesktopSetupPage::OnInit): Call the base class OnInit().
(DesktopSetupPage::OnBack): Remove obsolete call to NEXT().
(DesktopSetupPage::OnFinish): Remove obsolete call to NEXT().
* localdir.cc (LocalDirPage::OnActivate): Change from void to long
return value. Return 0 (accept activation).
* localdir.h (LocalDirPage::OnActivate): Change declaration from void
to long return value.
* LogFile.cc (LogFile::exit): Add logic to only display a dialog box at
exit if something went wrong.
* msg.cc (note_nobox): New function.
* msg.h (note_nobox): New function declaration.
* postinstall.cc (do_postinstall): Don't set next_dialog, because
there's no next_dialog to set anymore.
* proppage.cc (Copyright): Update copyright dates.
(PropertyPage::DoOnceForSheet): Remove file-scope variable.
(PropertyPage::Create): Remove extra space at beginning of name. Add
code to get the size of the page from the dialog template. Use more-
correct MAKEINTRESOURCE() instead of cast to LPCSTR.
(PropertyPage::FirstDialogProcReflector): Modify comment.
(PropertyPage::DialogProc): Add comment. Move SetDlgItemFont() call to
OnInit().
Remove "DoOnceForSheet" logic, no longer needed now that we got
modeless simulation of modal sheets working. Handle OnActivate()
return code.
(PropertyPage::OnInit): New member function.
* proppage.h (Copyright): Update copyright dates.
(PropertyPage::DoOnceForSheet): Remove member variable.
(PropertyPage::OriginalRECT): New member variable.
(PropertyPage::GetPageRECT): New method.
(PropertyPage::OnInit): Move implementation to proppage.cc.
(PropertyPage::OnActivate): Change return type from void to long.
Return 0.
* propsheet.cc (Copyright): Update copyright dates. Include new header
"rectpp.h". Add #defines for ID_* property sheet control IDs.
(button_ids): New array.
(PropSheet::PropSheet): Remove NumPropPages initialization. Add
initialization of MarginsValid.
(PropSheet::CreatePages): Use PropertyPages.size() instead of
NumPropPages.
(PropSheetProc): Set ~WS_VISIBLE style bit.
(PropSheet::Create): Significantly restructure to simulate a modal
sheet when in reality it's modeless. This charade is necessary to get
resizing to work.
(PropSheet::SetHWNDFromPage): Obsolete, remove.
(PropSheet::AddPage): Change to use new PropertyPages std::vector<>.
(PropSheet::SaveOriginalButtonPositions): New method.
(PropSheet::RepositionButtons): New method.
(PropSheet::RecalcPageSizesAsync): New method.
(PropSheet::Resize): New method.
(PropSheet::MessageLoop): New method.
* propsheet.h (Copyright): Update copyright dates. Include <vector>.
(PropSheet::PropertyPages): Change from array to vector<>.
(PropSheet::OriginalClientRect): New data member.
(PropSheet::OriginalTabControlRect): Ditto.
(PropSheet::OriginalButtonPositions): Ditto.
(PropSheet::MarginsValid): Ditto.
(PropSheet::PageSideMargin): Ditto.
(PropSheet::PageTopMargin): Ditto.
(PropSheet::PageBottomMargin): Ditto.
(PropSheet::OldWndProc): Ditto.
(PropSheet::SaveOriginalButtonPositions): New method declaration.
(PropSheet::SetHWNDFromPage): Remove.
(PropSheet::MessageLoop): New method declaration.
(PropSheet::RecalcPageSizesAsync): Ditto.
(PropSheet::Resize): Ditto.
(PropSheet::RepositionButtons): Ditto.
* res.rc (IDD_DESKTOP): Move controls. Add Cygwin icon. Changed ID of
"Finished" text to be IDC_STATIC_WELCOME_TITLE, same as the welcome
text on the first page, to simplify font-changing code.
(IDD_CHOOSE): Resize page (yay!). Move controls. Resize the static
control that the tree control code hooks.
* root.h: Add newline to end of file.
* site.cc (SitePage::OnActivate): Change return type from void to long.
Return 0.
* site.h (SitePage::OnActivate): Change return type from void to long.
* source.cc (SourcePage::OnActivate): Change return type from void to
long. Return 0.
* source.h (SourcePage::OnActivate): Change return type from void to
long.
* splash.cc (Copyright): Update copyright dates.
(SplashPage::OnInit): Remove call to SetDlgItemFont(). Now handled in
base class. Add call to base class's OnInit().
* splash.h (Copyright): Update copyright dates.
* threebar.cc (ThreeBarProgressPage::OnActivate): Change return type
from void to long. Return 0.
* threebar.h (ThreeBarProgressPage::OnActivate): Change return type
from void to long.
* window.cc: include "rectpp.h".
(Window::MoveWindow): New overload.
* window.h (RECTPP): New forward declaration.
(Window::MoveWindow): New overload declaration.
* rectpp.h: New file.
rectpp.h
Description: Binary data
