summaryrefslogtreecommitdiff
path: root/sw/source/ui/dbui/dbui.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-10-01 06:46:01 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-10-01 06:46:01 +0000
commit8a54fd8ca931eb28737470d0ee1fe6876ae8b153 (patch)
tree092af860b59d22e6457c68d7483753865adfc4b9 /sw/source/ui/dbui/dbui.cxx
parent9b6660956c25e4a4945847c3d3e221ed43002a3c (diff)
CWS-TOOLING: integrate CWS os117
Diffstat (limited to 'sw/source/ui/dbui/dbui.cxx')
-rw-r--r--sw/source/ui/dbui/dbui.cxx55
1 files changed, 50 insertions, 5 deletions
diff --git a/sw/source/ui/dbui/dbui.cxx b/sw/source/ui/dbui/dbui.cxx
index 89ff032ebe8f..5590a46c1674 100644
--- a/sw/source/ui/dbui/dbui.cxx
+++ b/sw/source/ui/dbui/dbui.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbui.cxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.136.1 $
*
* This file is part of OpenOffice.org.
*
@@ -45,21 +45,66 @@
Beschreibung:
---------------------------------------------------------------------*/
-PrintMonitor::PrintMonitor( Window *pParent, BOOL bEMail )
+PrintMonitor::PrintMonitor( Window *pParent, PrintMonitorType eType )
: ModelessDialog( pParent, SW_RES(DLG_PRINTMONITOR) ),
aDocName (this, SW_RES( FT_DOCNAME )),
- aPrinting (this, SW_RES( bEMail ? FT_SENDING : FT_PRINTING )),
+ aPrinting (this, SW_RES(
+ eType == MONITOR_TYPE_MAIL ?
+ FT_SENDING : eType == MONITOR_TYPE_SAVE ? FT_SAVING : FT_PRINTING )),
aPrinter (this, SW_RES( FT_PRINTER )),
aPrintInfo (this, SW_RES( FT_PRINTINFO )),
aCancel (this, SW_RES( PB_CANCELPRNMON ))
{
- if (bEMail)
+ switch (eType)
{
- SetText(SW_RES(STR_EMAILMON));
+ case MONITOR_TYPE_SAVE: SetText(SW_RES(STR_SAVEMON)); break;
+ case MONITOR_TYPE_MAIL: SetText(SW_RES(STR_EMAILMON)); break;
+ case MONITOR_TYPE_PRINT: break;
}
FreeResource();
}
+/*---------------------------------------------------------------------
+
+---------------------------------------------------------------------*/
+void lcl_ResizeControl( Window* pWin, long nDiff )
+{
+ Size aSize( pWin->GetSizePixel() );
+ aSize.Width() += nDiff;
+ pWin->SetSizePixel( aSize );
+}
+void lcl_RePosControl( Window* pWin, long nDiff )
+{
+ Point aPos( pWin->GetPosPixel() );
+ aPos.X() += nDiff;
+ pWin->SetPosPixel( aPos );
+}
+
+void PrintMonitor::ResizeControls()
+{
+ Size aDlgSize( GetSizePixel() );
+ Size aPrinterSize( aPrinter.GetSizePixel() );
+ long nPrinterTextWidth = aPrinter.GetTextWidth( aPrinter.GetText() );
+ if( nPrinterTextWidth > aPrinterSize.Width() )
+ {
+ //increase control and dialog width if printer text is too long
+ //do not increase dialog width more than three times
+ long nDiff = nPrinterTextWidth - aPrinterSize.Width();
+ if( nDiff > 2 * aDlgSize.Width() )
+ {
+ aPrinter.SetStyle( WB_RIGHT | aPrinter.GetStyle() );
+ nDiff = 2 * aDlgSize.Width();
+ }
+ aDlgSize.Width() += nDiff;
+ SetSizePixel(aDlgSize);
+ lcl_ResizeControl( &aPrinter, nDiff );
+ nDiff /= 2;
+ lcl_RePosControl( &aDocName, nDiff );
+ lcl_RePosControl( &aPrinting, nDiff );
+ lcl_RePosControl( &aPrintInfo, nDiff );
+ lcl_RePosControl( &aCancel, nDiff );
+ }
+}
/*---------------------------------------------------------------------
Progress Indicator for Creation of personalized Mail Merge documents:
---------------------------------------------------------------------*/