INTEGRATION: CWS layoutdialogs (1.2.6); FILE MERGED
2008/07/30 12:36:22 jcn 1.2.6.2: RESYNC: (1.2-1.3); FILE MERGED 2008/03/20 11:56:32 jcn 1.2.6.1: Update from http://lilypond.org/~janneke/vc/toolkit.git/.git 2008-03-20 Jan Nieuwenhuizen <janneke@gnu.org> * source/awt/vclxwindow.cxx: Fix compile warning. 2008-03-20 Jan Nieuwenhuizen <janneke@gnu.org> * util/makefile.mk: Revert obsolete VERSION addition. 2008-03-20 Jan Nieuwenhuizen <janneke@gnu.org> * source/controls/dialogcontrol.cxx, source/controls/unocontrol.cxx, source/helper/tkresmgr.cxx, util/defs/wntmsci11: Revert weird initial patch. 2008-03-20 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO: Doc update. 2008-03-20 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, source/awt/vclxbutton.cxx, source/vclcompat/wbutton.cxx, workben/layout/recover.xml: Implement MoreButton. TODO: images. 2008-03-19 Jan Nieuwenhuizen <janneke@gnu.org> * source/vclcompat/wbutton.cxx: Remove redraw cruft, rename redrawAlready to redraw. 2008-03-19 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, source/vclcompat/wbutton.cxx: Step towards cleaner redraw. 2008-03-19 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, source/awt/vclxbutton.cxx, source/awt/vclxbutton.hxx, source/layout/helper.cxx, source/vclcompat/wbutton.cxx, workben/layout/recover.cxx, workben/layout/recover.hxx: Extract AdvancedButton implementation from recover.cxx into new widget. 2008-03-19 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/recover.cxx, workben/layout/recover.hxx, workben/layout/recover.xml: Update recover dialog, make advanced/simple switching work. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/zoom.cxx: In test mode, enable everything. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/localize.sdf: Manually add new translatable strings and translations for de, nl. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/zoom.xml: Update zoom to have hbox of Zoom factor and View layout alongside each other. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/zoom.cxx, workben/layout/zoom.hxx, workben/layout/zoom.xml: Merge upstream's zoom. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * source/vclcompat/wbutton.cxx, source/vclcompat/wrapper.hxx: Nitpick, debugging aid. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout.hxx, source/vclcompat/wrapper.cxx: Implement FixedLine.IsEnabled(). 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * util/makefile.mk: Build lib name fix. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, source/vclcompat/wcontainer.cxx, workben/layout/recover.cxx, workben/layout/recover.hxx, workben/layout/recover.xml: Complete VBox/HBox wrappers. Not use them in recover, spacing still wrong. 2008-03-13 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, workben/layout/recover.cxx, workben/layout/recover.hxx, workben/layout/recover.xml: More recovery dialog mockuping. 2008-03-13 Jan Nieuwenhuizen <janneke@gnu.org> * source/layout/box-base.cxx: Implement visibility of elements/containers better. 2008-03-13 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, source/layout/helper.cxx, source/layout/import.cxx, source/layout/proplist.cxx, source/vclcompat/wbutton.cxx, source/vclcompat/wfield.cxx, source/vclcompat/wrapper.cxx, source/vclcompat/wrapper.hxx: Implement FixedImage. Needed for recovery dialog. 2008-02-28 Jan Nieuwenhuizen <janneke@gnu.org> * source/layout/box-base.hxx, workben/layout/editor.cxx: Give ChildData virtual distructor. 2008-02-28 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, source/layout/helper.cxx, source/vclcompat/makefile.mk, source/vclcompat/wrapper.cxx, util/makefile.mk, workben/layout/makefile.mk, workben/layout/recover.cxx, workben/layout/recover.hxx, workben/layout/recover.xml, workben/layout/test.cxx: Stab at new recover dialog. 2008-02-28 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/editor.cxx: Do not clear fresh container. Disable debug printing. 2008-02-27 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, workben/layout/localize.sdf: Fix localize.sdf for wordcount. 2008-02-27 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-pre.hxx, source/layout/dialogbuttonhbox.cxx: Fix ID for displaying dialogs. 2008-02-27 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, workben/layout/localize.sdf, workben/layout/wordcount.xml, workben/layout/zoom.xml: Add strings for all languages. 2008-02-27 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, source/awt/vclxsplitter.cxx, source/awt/vclxsplitter.hxx, source/awt/vclxtabcontrol.cxx, source/awt/vclxtabcontrol.hxx, source/layout/box-base.cxx, source/layout/box-base.hxx, source/layout/box.cxx, source/layout/box.hxx, source/layout/container.cxx, source/layout/dialogbuttonhbox.cxx, source/layout/dialogbuttonhbox.hxx, source/layout/factory.cxx, source/layout/flow.cxx, source/layout/helper.cxx, source/layout/import.hxx, source/layout/makefile.mk, source/layout/proplist.cxx, source/layout/root.cxx, source/layout/table.cxx, source/layout/table.hxx, source/layout/timer.cxx, source/vclcompat/wcontainer.cxx, source/vclcompat/wfield.cxx, source/vclcompat/wrapper.cxx: Clean-up code duplication from layout: new Box_Base class implements addChild, removeChild, getChildren, getChildProperties for Box, Table, VCLXSplitter, VCLXTabControl. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, source/layout/root.cxx: Document more fixmes. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, source/layout/proplist.cxx: Remove m237 workaround. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * source/layout/helper.cxx: More comment cleanups. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * source/awt/vclxtabcontrol.cxx, source/layout/box.cxx, source/layout/container.cxx, source/vclcompat/wrapper.cxx: Commented-out code cleanups. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, inc/layout/layoutcore.hxx, source/awt/forward.hxx, source/awt/vclxbutton.cxx, source/awt/vclxbutton.hxx, source/awt/vclxdialog.cxx, source/awt/vclxdialog.hxx, source/awt/vclxfixedline.cxx, source/awt/vclxfixedline.hxx, source/awt/vclxscroller.cxx, source/awt/vclxscroller.hxx, source/awt/vclxsplitter.cxx, source/awt/vclxsplitter.hxx, source/awt/vclxtabcontrol.cxx, source/awt/vclxtabcontrol.hxx, source/layout/bin.cxx, source/layout/bin.hxx, source/layout/box.cxx, source/layout/box.hxx, source/layout/container.cxx, source/layout/container.hxx, source/layout/dialogbuttonhbox.cxx, source/layout/dialogbuttonhbox.hxx, source/layout/factory.cxx, source/layout/factory.hxx, source/layout/flow.cxx, source/layout/flow.hxx, source/layout/helper.cxx, source/layout/helper.hxx, source/layout/import.cxx, source/layout/import.hxx, source/layout/makefile.mk, source/layout/precompiled_xmlscript.hxx, source/layout/proplist.cxx, source/layout/proplist.hxx, source/layout/root.cxx, source/layout/root.hxx, source/layout/table.cxx, source/layout/table.hxx, source/layout/timer.cxx, source/layout/timer.hxx, source/layout/translate.cxx, source/layout/translate.hxx, source/vclcompat/makefile.mk, source/vclcompat/wbutton.cxx, source/vclcompat/wcontainer.cxx, source/vclcompat/wfield.cxx, source/vclcompat/wrapper.cxx, source/vclcompat/wrapper.hxx, workben/layout/editor.cxx, workben/layout/editor.hxx, workben/layout/makefile.mk, workben/layout/simple-paragraph.cxx, workben/layout/simple-paragraph.hxx, workben/layout/test.cxx, workben/layout/uno.hxx, workben/layout/zoom_def.hxx: Add licence headers. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/meekfile.mk: Junk meekfile.mk 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO: Update TODO. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * inc/toolkit/awt/vclxwindows.hxx, source/awt/vclxwindow.cxx, source/awt/vclxwindows.cxx: Move VCLXScrollBar's getMinimumSize() from VCLXWindow's switch to method. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * inc/toolkit/awt/vclxwindows.hxx, source/awt/vclxwindow.cxx, source/awt/vclxwindows.cxx: Move VCLXMessageBox's getMinimumSize() from VCLXWindow's switch to method. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, inc/toolkit/awt/vclxtopwindow.hxx, source/awt/vclxdialog.cxx, source/awt/vclxdialog.hxx, source/awt/vclxtopwindow.cxx: Remove code duplication from VCLXDialog. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * source/awt/vclxdialog.cxx, source/vclcompat/wbutton.cxx, source/vclcompat/wcontainer.cxx, source/vclcompat/wrapper.hxx: Comment cleanup. 2008-02-21 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, source/layout/helper.hxx, workben/layout/editor.cxx, workben/layout/wordcountdialog.cxx: Fix remaining SUN warnings. 2008-02-21 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout.hxx, source/awt/vclxfixedline.hxx, source/layout/byteseq.cxx, source/layout/helper.hxx, source/layout/import.cxx, source/layout/makefile.mk, source/layout/proplist.cxx, source/layout/translate.hxx, source/vclcompat/wbutton.cxx, source/vclcompat/wcontainer.cxx, source/vclcompat/wfield.cxx, source/vclcompat/wrapper.cxx, source/vclcompat/wrapper.hxx, workben/layout/editor.cxx: Fix some sunstudio12 warnings. 2008-02-20 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, source/awt/makefile.mk, source/awt/vclxbutton.cxx, source/awt/vclxbutton.hxx, source/awt/vclxproxy.cxx, source/awt/vclxproxy.hxx, source/layout/helper.cxx: Junk VCLXProxy. 2008-02-20 Jan Nieuwenhuizen <janneke@gnu.org> * inc/toolkit/awt/vclxwindows.hxx, inc/toolkit/helper/listenermultiplexer.hxx, source/awt/vclxbutton.cxx, source/awt/vclxbutton.hxx, source/awt/vclxtabcontrol.cxx, source/awt/vclxtabcontrol.hxx, source/layout/helper.cxx: Hello world on AWTVCLXCancelButton() label and images. 2008-02-20 Jan Nieuwenhuizen <janneke@gnu.org> * .gitignore, source/awt/forward.hxx, source/awt/makefile.mk, source/awt/vclxdialog.cxx, source/awt/vclxdialog.hxx, source/awt/vclxfixedline.cxx, source/awt/vclxfixedline.hxx, source/awt/vclxscroller.cxx, source/awt/vclxscroller.hxx, source/awt/vclxsplitter.cxx, source/awt/vclxsplitter.hxx, source/awt/vclxtabcontrol.cxx, source/awt/vclxtabcontrol.hxx, source/layout/makefile.mk, workben/layout/localize-de.sdf, workben/layout/localize-nl.sdf: Cleanup of includes, namespace in headers in awt.
This commit is contained in:
parent
544799bc63
commit
145f5a29a8
1 changed files with 203 additions and 61 deletions
|
@ -7,7 +7,7 @@
|
|||
* OpenOffice.org - a multi-platform office productivity suite
|
||||
*
|
||||
* $RCSfile: zoom.cxx,v $
|
||||
* $Revision: 1.3 $
|
||||
* $Revision: 1.4 $
|
||||
*
|
||||
* This file is part of OpenOffice.org.
|
||||
*
|
||||
|
@ -72,8 +72,42 @@ struct SvxZoomItem
|
|||
fprintf( stderr, "Zoom factor: %d\n", int( n ) );
|
||||
}
|
||||
};
|
||||
#define SfxPoolItem LAYOUT_SfxPoolItem
|
||||
class LAYOUT_SfxPoolItem
|
||||
{
|
||||
};
|
||||
struct SvxViewLayoutItem : public LAYOUT_SfxPoolItem
|
||||
{
|
||||
bool IsBookMode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
USHORT GetValue()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetValue( int n )
|
||||
{
|
||||
fprintf( stderr, "Zoom factor: %d\n", int( n ) );
|
||||
}
|
||||
void SetBookMode( bool )
|
||||
{
|
||||
}
|
||||
#if 0 // needed for real SfxPoolItem
|
||||
int operator==( const SfxPoolItem& ) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
SfxPoolItem* Clone( SfxItemPool* ) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
#else /* !TEST_LAYOUT */
|
||||
#include <svx/zoomitem.hxx>
|
||||
#include <svx/viewlayoutitem.hxx>
|
||||
#include <svx/dialmgr.hxx>
|
||||
#endif /* !TEST_LAYOUT */
|
||||
#include "zoom_def.hxx"
|
||||
|
@ -95,16 +129,8 @@ static USHORT pRanges[] =
|
|||
|
||||
USHORT SvxZoomDialog::GetFactor() const
|
||||
{
|
||||
if ( a200Btn.IsChecked() )
|
||||
return 200;
|
||||
if ( a150Btn.IsChecked() )
|
||||
return 150;
|
||||
if ( a100Btn.IsChecked() )
|
||||
return 100;
|
||||
if ( a75Btn.IsChecked() )
|
||||
return 75;
|
||||
if ( a50Btn.IsChecked() )
|
||||
return 50;
|
||||
if ( aUserBtn.IsChecked() )
|
||||
return (USHORT)aUserEdit.GetValue();
|
||||
else
|
||||
|
@ -122,31 +148,11 @@ void SvxZoomDialog::SetFactor( USHORT nNewFactor, USHORT nBtnId )
|
|||
|
||||
if ( !nBtnId )
|
||||
{
|
||||
if ( nNewFactor == 200 )
|
||||
{
|
||||
a200Btn.Check();
|
||||
a200Btn.GrabFocus();
|
||||
}
|
||||
else if ( nNewFactor == 150 )
|
||||
{
|
||||
a150Btn.Check();
|
||||
a150Btn.GrabFocus();
|
||||
}
|
||||
else if ( nNewFactor == 100 )
|
||||
if ( nNewFactor == 100 )
|
||||
{
|
||||
a100Btn.Check();
|
||||
a100Btn.GrabFocus();
|
||||
}
|
||||
else if ( nNewFactor == 75 )
|
||||
{
|
||||
a75Btn.Check();
|
||||
a75Btn.GrabFocus();
|
||||
}
|
||||
else if ( nNewFactor == 50 )
|
||||
{
|
||||
a50Btn.Check();
|
||||
a50Btn.GrabFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
aUserBtn.Check();
|
||||
|
@ -252,16 +258,21 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
|
|||
SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_ZOOM ) ),
|
||||
|
||||
aZoomFl ( this, SVX_RES( FL_ZOOM ) ),
|
||||
aOptimalBtn ( this, SVX_RES( BTN_OPTIMAL ) ),
|
||||
aWholePageBtn ( this, SVX_RES( BTN_WHOLE_PAGE ) ),
|
||||
aPageWidthBtn ( this, SVX_RES( BTN_PAGE_WIDTH ) ),
|
||||
aOptimalBtn ( this, SVX_RES( BTN_OPTIMAL ) ),
|
||||
a200Btn ( this, SVX_RES( BTN_200 ) ),
|
||||
a150Btn ( this, SVX_RES( BTN_150 ) ),
|
||||
a100Btn ( this, SVX_RES( BTN_100 ) ),
|
||||
a75Btn ( this, SVX_RES( BTN_75 ) ),
|
||||
a50Btn ( this, SVX_RES( BTN_50 ) ),
|
||||
aUserBtn ( this, SVX_RES( BTN_USER ) ),
|
||||
aUserEdit ( this, SVX_RES( ED_USER ) ),
|
||||
|
||||
aViewLayoutFl ( this, SVX_RES( FL_VIEWLAYOUT ) ),
|
||||
aAutomaticBtn ( this, SVX_RES( BTN_AUTOMATIC ) ),
|
||||
aSingleBtn ( this, SVX_RES( BTN_SINGLE ) ),
|
||||
aColumnsBtn ( this, SVX_RES( BTN_COLUMNS ) ),
|
||||
aColumnsEdit ( this, SVX_RES( ED_COLUMNS ) ),
|
||||
aBookModeChk ( this, SVX_RES( CHK_BOOK ) ),
|
||||
|
||||
aBottomFl ( this, SVX_RES( FL_BOTTOM ) ),
|
||||
aOKBtn ( this, SVX_RES( BTN_ZOOM_OK ) ),
|
||||
aCancelBtn ( this, SVX_RES( BTN_ZOOM_CANCEL ) ),
|
||||
aHelpBtn ( this, SVX_RES( BTN_ZOOM_HELP ) ),
|
||||
|
@ -274,15 +285,23 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
|
|||
|
||||
{
|
||||
Link aLink = LINK( this, SvxZoomDialog, UserHdl );
|
||||
a200Btn.SetClickHdl( aLink );
|
||||
a150Btn.SetClickHdl( aLink );
|
||||
a100Btn.SetClickHdl( aLink );
|
||||
a75Btn.SetClickHdl( aLink );
|
||||
a50Btn.SetClickHdl( aLink );
|
||||
aOptimalBtn.SetClickHdl( aLink );
|
||||
aPageWidthBtn.SetClickHdl( aLink );
|
||||
aWholePageBtn.SetClickHdl( aLink );
|
||||
aUserBtn.SetClickHdl( aLink );
|
||||
|
||||
Link aViewLayoutLink = LINK( this, SvxZoomDialog, ViewLayoutUserHdl );
|
||||
aAutomaticBtn.SetClickHdl( aViewLayoutLink );
|
||||
aSingleBtn.SetClickHdl( aViewLayoutLink );
|
||||
aColumnsBtn.SetClickHdl( aViewLayoutLink );
|
||||
|
||||
Link aViewLayoutSpinLink = LINK( this, SvxZoomDialog, ViewLayoutSpinHdl );
|
||||
aColumnsEdit.SetModifyHdl( aViewLayoutSpinLink );
|
||||
|
||||
Link aViewLayoutCheckLink = LINK( this, SvxZoomDialog, ViewLayoutCheckHdl );
|
||||
aBookModeChk.SetClickHdl( aViewLayoutCheckLink );
|
||||
|
||||
aOKBtn.SetClickHdl( LINK( this, SvxZoomDialog, OKHdl ) );
|
||||
aUserEdit.SetModifyHdl( LINK( this, SvxZoomDialog, SpinHdl ) );
|
||||
|
||||
|
@ -323,9 +342,9 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
|
|||
if ( rItem.ISA(SvxZoomItem) )
|
||||
{
|
||||
const SvxZoomItem& rZoomItem = (const SvxZoomItem&)rItem;
|
||||
USHORT nZoom = rZoomItem.GetValue();
|
||||
SvxZoomType eType = rZoomItem.GetType();
|
||||
USHORT nValSet = rZoomItem.GetValueSet();
|
||||
const USHORT nZoom = rZoomItem.GetValue();
|
||||
const SvxZoomType eType = rZoomItem.GetType();
|
||||
const USHORT nValSet = rZoomItem.GetValueSet();
|
||||
USHORT nBtnId = 0;
|
||||
|
||||
switch ( eType )
|
||||
|
@ -345,17 +364,8 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
|
|||
break;
|
||||
}
|
||||
|
||||
// ggf. Buttons disablen
|
||||
if ( !(SVX_ZOOM_ENABLE_50 & nValSet) )
|
||||
a50Btn.Disable();
|
||||
if ( !(SVX_ZOOM_ENABLE_75 & nValSet) )
|
||||
a75Btn.Disable();
|
||||
if ( !(SVX_ZOOM_ENABLE_100 & nValSet) )
|
||||
a100Btn.Disable();
|
||||
if ( !(SVX_ZOOM_ENABLE_150 & nValSet) )
|
||||
a150Btn.Disable();
|
||||
if ( !(SVX_ZOOM_ENABLE_200 & nValSet) )
|
||||
a200Btn.Disable();
|
||||
if ( !(SVX_ZOOM_ENABLE_OPTIMAL & nValSet) )
|
||||
aOptimalBtn.Disable();
|
||||
if ( !(SVX_ZOOM_ENABLE_PAGEWIDTH & nValSet) )
|
||||
|
@ -366,9 +376,56 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
|
|||
}
|
||||
else
|
||||
{
|
||||
USHORT nZoom = ( (const SfxUInt16Item&)rItem ).GetValue();
|
||||
const USHORT nZoom = ( (const SfxUInt16Item&)rItem ).GetValue();
|
||||
SetFactor( nZoom );
|
||||
}
|
||||
|
||||
const SfxPoolItem* pViewLayoutItem = 0;
|
||||
if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_VIEWLAYOUT, FALSE, &pViewLayoutItem ) )
|
||||
{
|
||||
const USHORT nColumns = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->GetValue();
|
||||
const bool bBookMode = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->IsBookMode();
|
||||
|
||||
if ( 0 == nColumns )
|
||||
{
|
||||
aAutomaticBtn.Check();
|
||||
aColumnsEdit.SetValue( 2 );
|
||||
aColumnsEdit.Disable();
|
||||
aBookModeChk.Disable();
|
||||
}
|
||||
else if ( 1 == nColumns)
|
||||
{
|
||||
aSingleBtn.Check();
|
||||
aColumnsEdit.SetValue( 2 );
|
||||
aColumnsEdit.Disable();
|
||||
aBookModeChk.Disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
aColumnsBtn.Check();
|
||||
if ( !bBookMode )
|
||||
{
|
||||
aColumnsEdit.SetValue( nColumns );
|
||||
if ( 0 != nColumns % 2 )
|
||||
aBookModeChk.Disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
aColumnsEdit.SetValue( nColumns );
|
||||
aBookModeChk.Check();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// hide view layout related controls:
|
||||
aViewLayoutFl.Disable();
|
||||
aAutomaticBtn.Disable();
|
||||
aSingleBtn.Disable();
|
||||
aColumnsBtn.Disable();
|
||||
aColumnsEdit.Disable();
|
||||
aBookModeChk.Disable();
|
||||
}
|
||||
#endif /* !TEST_LAYOUT */
|
||||
|
||||
FreeResource();
|
||||
|
@ -420,17 +477,82 @@ IMPL_LINK( SvxZoomDialog, SpinHdl, MetricField *, EMPTYARG )
|
|||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
IMPL_LINK( SvxZoomDialog, ViewLayoutUserHdl, RadioButton *, pBtn )
|
||||
{
|
||||
bModified |= TRUE;
|
||||
|
||||
if ( pBtn == &aAutomaticBtn )
|
||||
{
|
||||
aColumnsEdit.Disable();
|
||||
aBookModeChk.Disable();
|
||||
}
|
||||
else if ( pBtn == &aSingleBtn )
|
||||
{
|
||||
aColumnsEdit.Disable();
|
||||
aBookModeChk.Disable();
|
||||
}
|
||||
else if ( pBtn == &aColumnsBtn )
|
||||
{
|
||||
aColumnsEdit.Enable();
|
||||
aColumnsEdit.GrabFocus();
|
||||
if ( 0 == aColumnsEdit.GetValue() % 2 )
|
||||
aBookModeChk.Enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_ERROR( "Wrong Button" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
IMPL_LINK( SvxZoomDialog, ViewLayoutSpinHdl, MetricField *, pEdt )
|
||||
{
|
||||
if ( pEdt == &aColumnsEdit && !aColumnsBtn.IsChecked() )
|
||||
return 0;
|
||||
|
||||
if ( 0 == aColumnsEdit.GetValue() % 2 )
|
||||
aBookModeChk.Enable();
|
||||
else
|
||||
{
|
||||
aBookModeChk.Check( sal_False );
|
||||
aBookModeChk.Disable();
|
||||
}
|
||||
|
||||
bModified |= TRUE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
IMPL_LINK( SvxZoomDialog, ViewLayoutCheckHdl, CheckBox *, pChk )
|
||||
{
|
||||
if ( pChk == &aBookModeChk && !aColumnsBtn.IsChecked() )
|
||||
return 0;
|
||||
|
||||
bModified |= TRUE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn )
|
||||
{
|
||||
if ( bModified || &aOKBtn != pBtn )
|
||||
{
|
||||
#if TEST_LAYOUT
|
||||
SvxZoomItem aItem;
|
||||
SvxZoomItem aZoomItem;
|
||||
SvxViewLayoutItem aViewLayoutItem;
|
||||
#else /* !TEST_LAYOUT */
|
||||
SvxZoomItem aItem( SVX_ZOOM_PERCENT, 0,
|
||||
rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) );
|
||||
|
||||
SvxZoomItem aZoomItem( SVX_ZOOM_PERCENT, 0, rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) );
|
||||
SvxViewLayoutItem aViewLayoutItem( 0, false, rSet.GetPool()->GetWhich( SID_ATTR_VIEWLAYOUT ) );
|
||||
#endif /* !TEST_LAYOUT */
|
||||
|
||||
if ( &aOKBtn == pBtn )
|
||||
{
|
||||
USHORT nFactor = GetFactor();
|
||||
|
@ -438,14 +560,30 @@ IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn )
|
|||
if ( SPECIAL_FACTOR == nFactor )
|
||||
{
|
||||
if ( aOptimalBtn.IsChecked() )
|
||||
aItem.SetType( SVX_ZOOM_OPTIMAL );
|
||||
aZoomItem.SetType( SVX_ZOOM_OPTIMAL );
|
||||
else if ( aPageWidthBtn.IsChecked() )
|
||||
aItem.SetType( SVX_ZOOM_PAGEWIDTH );
|
||||
aZoomItem.SetType( SVX_ZOOM_PAGEWIDTH );
|
||||
else if ( aWholePageBtn.IsChecked() )
|
||||
aItem.SetType( SVX_ZOOM_WHOLEPAGE );
|
||||
aZoomItem.SetType( SVX_ZOOM_WHOLEPAGE );
|
||||
}
|
||||
else
|
||||
aItem.SetValue( nFactor );
|
||||
aZoomItem.SetValue( nFactor );
|
||||
|
||||
if ( aAutomaticBtn.IsChecked() )
|
||||
{
|
||||
aViewLayoutItem.SetValue( 0 );
|
||||
aViewLayoutItem.SetBookMode( false );
|
||||
}
|
||||
if ( aSingleBtn.IsChecked() )
|
||||
{
|
||||
aViewLayoutItem.SetValue( 1 );
|
||||
aViewLayoutItem.SetBookMode( false );
|
||||
}
|
||||
else if ( aColumnsBtn.IsChecked() )
|
||||
{
|
||||
aViewLayoutItem.SetValue( static_cast<USHORT>(aColumnsEdit.GetValue()) );
|
||||
aViewLayoutItem.SetBookMode( aBookModeChk.IsChecked() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -454,7 +592,11 @@ IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn )
|
|||
}
|
||||
#if !TEST_LAYOUT
|
||||
pOutSet = new SfxItemSet( rSet );
|
||||
pOutSet->Put( aItem );
|
||||
pOutSet->Put( aZoomItem );
|
||||
|
||||
// don't set attribute in case the whole viewlayout stuff is disabled:
|
||||
if ( aViewLayoutFl.IsEnabled() )
|
||||
pOutSet->Put( aViewLayoutItem );
|
||||
|
||||
// Wert aus dem UserEdit "uber den Dialog hinaus merken
|
||||
SfxObjectShell* pSh = SfxObjectShell::Current();
|
||||
|
|
Loading…
Reference in a new issue