diff options
Diffstat (limited to 'cui/source/options/personalization.cxx')
-rw-r--r-- | cui/source/options/personalization.cxx | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 53891244eeb5..906f23cf00e5 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -14,7 +14,26 @@ SvxPersonalizationTabPage::SvxPersonalizationTabPage( Window *pParent, const SfxItemSet &rSet ) : SfxTabPage( pParent, "PersonalizationTabPage", "cui/ui/personalization_tab.ui", rSet ) { + get( m_pNoBackground, "no_background" ); + get( m_pDefaultBackground, "default_background" ); + get( m_pOwnBackground, "own_background" ); + m_pNoBackground->SetClickHdl( LINK( this, SvxPersonalizationTabPage, EnableDisableSelectionButtons ) ); + m_pDefaultBackground->SetClickHdl( LINK( this, SvxPersonalizationTabPage, EnableDisableSelectionButtons ) ); + m_pOwnBackground->SetClickHdl( LINK( this, SvxPersonalizationTabPage, EnableDisableSelectionButtons ) ); + + get( m_pSelectBackground, "select_background" ); + m_pSelectBackground->SetClickHdl( LINK( this, SvxPersonalizationTabPage, SelectBackground ) ); + get( m_pNoPersona, "no_persona" ); + get( m_pDefaultPersona, "default_persona" ); + get( m_pOwnPersona, "own_persona" ); + m_pNoPersona->SetClickHdl( LINK( this, SvxPersonalizationTabPage, EnableDisableSelectionButtons ) ); + m_pDefaultPersona->SetClickHdl( LINK( this, SvxPersonalizationTabPage, EnableDisableSelectionButtons ) ); + m_pOwnPersona->SetClickHdl( LINK( this, SvxPersonalizationTabPage, EnableDisableSelectionButtons ) ); + + get( m_pSelectPersona, "select_persona" ); + LINK( this, SvxPersonalizationTabPage, SelectPersona ); + m_pSelectPersona->SetClickHdl( LINK( this, SvxPersonalizationTabPage, SelectPersona ) ); } SvxPersonalizationTabPage::~SvxPersonalizationTabPage() @@ -26,4 +45,46 @@ SfxTabPage* SvxPersonalizationTabPage::Create( Window *pParent, const SfxItemSet return new SvxPersonalizationTabPage( pParent, rSet ); } +IMPL_LINK( SvxPersonalizationTabPage, EnableDisableSelectionButtons, RadioButton*, pButton ) +{ + PushButton *pPushButton = NULL; + RadioButton *pRadioButton = NULL; + + if ( pButton == m_pNoBackground || pButton == m_pDefaultBackground || pButton == m_pOwnBackground ) + { + pPushButton = m_pSelectBackground; + pRadioButton = m_pOwnBackground; + } + else if ( pButton == m_pNoPersona || pButton == m_pDefaultPersona || pButton == m_pOwnPersona ) + { + pPushButton = m_pSelectPersona; + pRadioButton = m_pOwnPersona; + } + else + return 0; + + if ( pRadioButton->IsChecked() && !pPushButton->IsEnabled() ) + { + pPushButton->Enable(); + pPushButton->Invalidate(); + } + else if ( !pRadioButton->IsChecked() && pPushButton->IsEnabled() ) + { + pPushButton->Disable(); + pPushButton->Invalidate(); + } + + return 0; +} + +IMPL_LINK( SvxPersonalizationTabPage, SelectBackground, PushButton*, /*pButton*/ ) +{ + return 0; +} + +IMPL_LINK( SvxPersonalizationTabPage, SelectPersona, PushButton*, /*pButton*/ ) +{ + return 0; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |