Здравствуйте, <Аноним>, Вы писали:

А>Как изменить сабж у PropertySheet?


class CCfgSheet: public CPropertySheetImpl<CCfgSheet>
{

    public:
        typedef CPropertySheetImpl<CCfgSheet> sheetBase; // 3
        CCfgSheet();
        ~CCfgSheet();

        BEGIN_MSG_MAP( CCfgSheet )
        CHAIN_MSG_MAP( sheetBase )
        MESSAGE_HANDLER( WM_SHOWWINDOW, OnShowWindow )
        END_MSG_MAP()

        // Since WTL's CPropertySheet does not receive a WM_INITDIALOG message,
        // this needs to be called to handle the remaining initialization tasks
        LRESULT OnShowWindow( UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled );

    protected:
        ...
};

// Since WTL's CPropertySheet does not receive a WM_INITDIALOG message,
// this needs to be called to handle the remaining initialization tasks
LRESULT CCfgSheet::OnShowWindow( UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled )
{
    SetIcons();
    SetRussianBtn();
    CString title;
    title.LoadString( IDS_CFG_TITLE );
    SetWindowText( title );

    return 0;
}

void CCfgSheet::SetRussianBtn()
{
    // русские надписи на кнопках
    // проверки - чтоб работало для набора и для визарда
    HWND hBtn = NULL;

    if ( ::IsWindow( hBtn = GetDlgItem( IDOK ) ) )
        ::SetWindowText( hBtn, "Применить" );

    if ( ::IsWindow( hBtn = GetDlgItem( IDCANCEL ) ) )
        ::SetWindowText( hBtn, "Отменить" );

    if ( ::IsWindow( hBtn = GetDlgItem( IDHELP ) ) )
        ::SetWindowText( hBtn, "Справка" );

    if ( ::IsWindow( hBtn = GetDlgItem( ID_WIZBACK ) ) )
        ::SetWindowText( hBtn, "< Назад" );

    if ( ::IsWindow( hBtn = GetDlgItem( ID_WIZNEXT ) ) )
        ::SetWindowText( hBtn, "Дальше >" );

    if ( ::IsWindow( hBtn = GetDlgItem( ID_WIZFINISH ) ) )
        ::SetWindowText( hBtn, "Завершить" );
}
... << RSDN@Home 1.1.4 beta 7 rev. 458>>
Автор: Odi$$ey    Оценить