galbrws1.cxx (f6e50924) galbrws1.cxx (02c50d82)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 133 unchanged lines hidden (view full) ---

142 return( nDone ? nDone : ListBox::PreNotify( rNEvt ) );
143}
144
145// -------------------
146// - GalleryBrowser1 -
147// -------------------
148DBG_NAME(GalleryBrowser1)
149
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 133 unchanged lines hidden (view full) ---

142 return( nDone ? nDone : ListBox::PreNotify( rNEvt ) );
143}
144
145// -------------------
146// - GalleryBrowser1 -
147// -------------------
148DBG_NAME(GalleryBrowser1)
149
150GalleryBrowser1::GalleryBrowser1( GalleryBrowser* pParent, const ResId& rResId, Gallery* pGallery ) :
150GalleryBrowser1::GalleryBrowser1(
151 Window* pParent,
152 const ResId& rResId,
153 Gallery* pGallery,
154 const ::boost::function<sal_Bool(const KeyEvent&,Window*)>& rKeyInputHandler,
155 const ::boost::function<void(void)>& rThemeSlectionHandler)
156 :
151 Control ( pParent, rResId ),
152 maNewTheme ( this, WB_3DLOOK ),
153 mpThemes ( new GalleryThemeListBox( this, WB_TABSTOP | WB_3DLOOK | WB_BORDER | WB_HSCROLL | WB_VSCROLL | WB_AUTOHSCROLL | WB_SORT ) ),
154 mpGallery ( pGallery ),
155 mpExchangeData ( new ExchangeData ),
156 mpThemePropsDlgItemSet( NULL ),
157 aImgNormal ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_NORMAL ) ),
158 aImgDefault ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_DEFAULT ) ),
159 aImgReadOnly ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_READONLY ) ),
157 Control ( pParent, rResId ),
158 maNewTheme ( this, WB_3DLOOK ),
159 mpThemes ( new GalleryThemeListBox( this, WB_TABSTOP | WB_3DLOOK | WB_BORDER | WB_HSCROLL | WB_VSCROLL | WB_AUTOHSCROLL | WB_SORT ) ),
160 mpGallery ( pGallery ),
161 mpExchangeData ( new ExchangeData ),
162 mpThemePropsDlgItemSet( NULL ),
163 aImgNormal ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_NORMAL ) ),
164 aImgDefault ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_DEFAULT ) ),
165 aImgReadOnly ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_READONLY ) ),
160 aImgImported ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_IMPORTED ) )
166 aImgImported ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_IMPORTED ) ),
167 maKeyInputHandler(rKeyInputHandler),
168 maThemeSlectionHandler(rThemeSlectionHandler)
161{
162 DBG_CTOR(GalleryBrowser1,NULL);
163
164 StartListening( *mpGallery );
165
166 maNewTheme.SetHelpId( HID_GALLERY_NEWTHEME );
167 maNewTheme.SetText( String( GAL_RESID( RID_SVXSTR_GALLERY_CREATETHEME ) ) );
168 maNewTheme.SetClickHdl( LINK( this, GalleryBrowser1, ClickNewThemeHdl ) );

--- 417 unchanged lines hidden (view full) ---

586{
587 Application::PostUserEvent( LINK( this, GalleryBrowser1, ShowContextMenuHdl ), this );
588}
589
590// -----------------------------------------------------------------------------
591
592sal_Bool GalleryBrowser1::KeyInput( const KeyEvent& rKEvt, Window* pWindow )
593{
169{
170 DBG_CTOR(GalleryBrowser1,NULL);
171
172 StartListening( *mpGallery );
173
174 maNewTheme.SetHelpId( HID_GALLERY_NEWTHEME );
175 maNewTheme.SetText( String( GAL_RESID( RID_SVXSTR_GALLERY_CREATETHEME ) ) );
176 maNewTheme.SetClickHdl( LINK( this, GalleryBrowser1, ClickNewThemeHdl ) );

--- 417 unchanged lines hidden (view full) ---

594{
595 Application::PostUserEvent( LINK( this, GalleryBrowser1, ShowContextMenuHdl ), this );
596}
597
598// -----------------------------------------------------------------------------
599
600sal_Bool GalleryBrowser1::KeyInput( const KeyEvent& rKEvt, Window* pWindow )
601{
594 sal_Bool bRet = static_cast< GalleryBrowser* >( GetParent() )->KeyInput( rKEvt, pWindow );
602 sal_Bool bRet (sal_False);
603 if (maKeyInputHandler)
604 bRet = maKeyInputHandler(rKEvt, pWindow);
595
596 if( !bRet )
597 {
598 ::std::vector< sal_uInt16 > aExecVector;
599 ImplGetExecuteVector(aExecVector);
600 sal_uInt16 nExecuteId = 0;
601 sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1();
602

--- 91 unchanged lines hidden (view full) ---

694 ImplExecute( pMenu->GetCurItemId() );
695 return 0L;
696}
697
698// -----------------------------------------------------------------------------
699
700IMPL_LINK( GalleryBrowser1, SelectThemeHdl, void*, EMPTYARG )
701{
605
606 if( !bRet )
607 {
608 ::std::vector< sal_uInt16 > aExecVector;
609 ImplGetExecuteVector(aExecVector);
610 sal_uInt16 nExecuteId = 0;
611 sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1();
612

--- 91 unchanged lines hidden (view full) ---

704 ImplExecute( pMenu->GetCurItemId() );
705 return 0L;
706}
707
708// -----------------------------------------------------------------------------
709
710IMPL_LINK( GalleryBrowser1, SelectThemeHdl, void*, EMPTYARG )
711{
702 ( (GalleryBrowser*) GetParent() )->ThemeSelectionHasChanged();
712 if (maThemeSlectionHandler)
713 maThemeSlectionHandler();
703 return 0L;
704}
705
706// -----------------------------------------------------------------------------
707
708IMPL_LINK( GalleryBrowser1, ClickNewThemeHdl, void*, EMPTYARG )
709{
710 String aNewTheme( GAL_RESID( RID_SVXSTR_GALLERY_NEWTHEME ) );

--- 18 unchanged lines hidden ---
714 return 0L;
715}
716
717// -----------------------------------------------------------------------------
718
719IMPL_LINK( GalleryBrowser1, ClickNewThemeHdl, void*, EMPTYARG )
720{
721 String aNewTheme( GAL_RESID( RID_SVXSTR_GALLERY_NEWTHEME ) );

--- 18 unchanged lines hidden ---