summaryrefslogtreecommitdiff
path: root/sw/source/ui/table
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-09-04 16:49:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:44 +0100
commitbc347f9f247e141b7377a531a966da076dcd2351 (patch)
tree9baaa81a80f74b31b445a447bbe4908d41e5632c /sw/source/ui/table
parent0553a0b10267f824100fa5a9c2aa0d5749a46868 (diff)
Drop .src layout for inserttable and use Gokul's .ui
Change-Id: Ibc09a1d208720607944f24139eaf45e62699e69e
Diffstat (limited to 'sw/source/ui/table')
-rw-r--r--sw/source/ui/table/instable.cxx129
-rw-r--r--sw/source/ui/table/instable.hrc18
-rw-r--r--sw/source/ui/table/instable.src187
3 files changed, 56 insertions, 278 deletions
diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index d5fe12daf4e0..629a8cf6c1cd 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -56,19 +56,19 @@ void SwInsTableDlg::GetValues( String& rName, sal_uInt16& rRow, sal_uInt16& rCol
SwTableAutoFmt *& prTAFmt )
{
sal_uInt16 nInsMode = 0;
- rName = aNameEdit.GetText();
- rRow = (sal_uInt16)aRowEdit.GetValue();
- rCol = (sal_uInt16)aColEdit.GetValue();
+ rName = m_pNameEdit->GetText();
+ rRow = (sal_uInt16)m_pRowNF->GetValue();
+ rCol = (sal_uInt16)m_pColNF->GetValue();
- if (aBorderCB.IsChecked())
+ if (m_pBorderCB->IsChecked())
nInsMode |= tabopts::DEFAULT_BORDER;
- if (aHeaderCB.IsChecked())
+ if (m_pHeaderCB->IsChecked())
nInsMode |= tabopts::HEADLINE;
- if (aRepeatHeaderCB.IsEnabled() && aRepeatHeaderCB.IsChecked())
- rInsTblOpts.mnRowsToRepeat = sal_uInt16( aRepeatHeaderNF.GetValue() );
+ if (m_pRepeatHeaderCB->IsEnabled() && m_pRepeatHeaderCB->IsChecked())
+ rInsTblOpts.mnRowsToRepeat = sal_uInt16( m_pRepeatHeaderNF->GetValue() );
else
rInsTblOpts.mnRowsToRepeat = 0;
- if (!aDontSplitCB.IsChecked())
+ if (!m_pDontSplitCB->IsChecked())
nInsMode |= tabopts::SPLIT_LAYOUT;
if( pTAutoFmt )
{
@@ -83,46 +83,31 @@ void SwInsTableDlg::GetValues( String& rName, sal_uInt16& rRow, sal_uInt16& rCol
SwInsTableDlg::SwInsTableDlg( SwView& rView )
- : SfxModalDialog( rView.GetWindow(), SW_RES(DLG_INSERT_TABLE) ),
- aNameFT (this, SW_RES(FT_NAME)),
- aNameEdit (this, SW_RES(ED_NAME)),
-
- aFL (this, SW_RES(FL_TABLE)),
- aColLbl (this, SW_RES(FT_COL)),
- aColEdit (this, SW_RES(ED_COL)),
- aRowLbl (this, SW_RES(FT_ROW)),
- aRowEdit (this, SW_RES(ED_ROW)),
-
- aOptionsFL (this, SW_RES(FL_OPTIONS)),
- aHeaderCB (this, SW_RES(CB_HEADER)),
- aRepeatHeaderCB (this, SW_RES(CB_REPEAT_HEADER)),
- aRepeatHeaderFT (this, SW_RES(FT_REPEAT_HEADER)),
- aRepeatHeaderBeforeFT (this),
- aRepeatHeaderNF (this, SW_RES(NF_REPEAT_HEADER)),
- aRepeatHeaderAfterFT (this),
- aRepeatHeaderCombo (this, SW_RES(WIN_REPEAT_HEADER), aRepeatHeaderNF, aRepeatHeaderBeforeFT, aRepeatHeaderAfterFT),
-
- aDontSplitCB (this, SW_RES(CB_DONT_SPLIT)),
- aBorderCB (this, SW_RES(CB_BORDER)),
-
- aOkBtn (this, SW_RES(BT_OK)),
- aCancelBtn (this, SW_RES(BT_CANCEL)),
- aHelpBtn (this, SW_RES(BT_HELP)),
- aAutoFmtBtn (this, SW_RES(BT_AUTOFORMAT)),
-
- pShell(&rView.GetWrtShell()),
- pTAutoFmt( 0 ),
- nEnteredValRepeatHeaderNF( -1 )
+ : SfxModalDialog(rView.GetWindow(), "InsertTableDialog", "modules/swriter/ui/inserttable.ui")
+ , pShell(&rView.GetWrtShell())
+ , pTAutoFmt(0)
+ , nEnteredValRepeatHeaderNF(-1)
{
- FreeResource();
- aNameEdit.SetText(pShell->GetUniqueTblName());
- aNameEdit.SetModifyHdl(LINK(this, SwInsTableDlg, ModifyName));
- aColEdit.SetModifyHdl(LINK(this, SwInsTableDlg, ModifyRowCol));
- aRowEdit.SetModifyHdl(LINK(this, SwInsTableDlg, ModifyRowCol));
-
- aRowEdit.SetMax(ROW_COL_PROD/aColEdit.GetValue());
- aColEdit.SetMax(ROW_COL_PROD/aRowEdit.GetValue());
- aAutoFmtBtn.SetClickHdl(LINK(this, SwInsTableDlg, AutoFmtHdl));
+ get(m_pNameEdit, "nameedit");
+ get(m_pColNF, "colspin");
+ get(m_pRowNF, "rowspin");
+ get(m_pHeaderCB, "headercb");
+ get(m_pRepeatHeaderCB, "repeatcb");
+ get(m_pDontSplitCB, "dontsplitcb");
+ get(m_pBorderCB, "bordercb");
+ get(m_pAutoFmtBtn, "autoformat");
+ get(m_pOkBtn, "ok");
+ get(m_pRepeatGroup, "repeatgroup");
+ get(m_pRepeatHeaderNF, "repeatheaderspin");
+
+ m_pNameEdit->SetText(pShell->GetUniqueTblName());
+ m_pNameEdit->SetModifyHdl(LINK(this, SwInsTableDlg, ModifyName));
+ m_pColNF->SetModifyHdl(LINK(this, SwInsTableDlg, ModifyRowCol));
+ m_pRowNF->SetModifyHdl(LINK(this, SwInsTableDlg, ModifyRowCol));
+
+ m_pRowNF->SetMax(ROW_COL_PROD/m_pColNF->GetValue());
+ m_pColNF->SetMax(ROW_COL_PROD/m_pRowNF->GetValue());
+ m_pAutoFmtBtn->SetClickHdl(LINK(this, SwInsTableDlg, AutoFmtHdl));
sal_Bool bHTMLMode = 0 != (::GetHtmlMode(rView.GetDocShell())&HTMLMODE_ON);
const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
@@ -130,33 +115,31 @@ SwInsTableDlg::SwInsTableDlg( SwView& rView )
SwInsertTableOptions aInsOpts = pModOpt->GetInsTblFlags(bHTMLMode);
sal_uInt16 nInsTblFlags = aInsOpts.mnInsMode;
- aHeaderCB.Check( 0 != (nInsTblFlags & tabopts::HEADLINE) );
- aRepeatHeaderCB.Check(aInsOpts.mnRowsToRepeat > 0);
+ m_pHeaderCB->Check( 0 != (nInsTblFlags & tabopts::HEADLINE) );
+ m_pRepeatHeaderCB->Check(aInsOpts.mnRowsToRepeat > 0);
if(bHTMLMode)
{
- aDontSplitCB.Hide();
- aBorderCB.SetPosPixel(aDontSplitCB.GetPosPixel());
+ m_pDontSplitCB->Hide();
+ m_pBorderCB->SetPosPixel(m_pDontSplitCB->GetPosPixel());
}
else
{
- aDontSplitCB.Check( 0 == (nInsTblFlags & tabopts::SPLIT_LAYOUT) );
+ m_pDontSplitCB->Check( 0 == (nInsTblFlags & tabopts::SPLIT_LAYOUT) );
}
- aBorderCB.Check( 0 != (nInsTblFlags & tabopts::DEFAULT_BORDER) );
+ m_pBorderCB->Check( 0 != (nInsTblFlags & tabopts::DEFAULT_BORDER) );
- aRepeatHeaderNF.SetModifyHdl( LINK( this, SwInsTableDlg, ModifyRepeatHeaderNF_Hdl ) );
- aHeaderCB.SetClickHdl(LINK(this, SwInsTableDlg, CheckBoxHdl));
- aRepeatHeaderCB.SetClickHdl(LINK(this, SwInsTableDlg, ReapeatHeaderCheckBoxHdl));
+ m_pRepeatHeaderNF->SetModifyHdl( LINK( this, SwInsTableDlg, ModifyRepeatHeaderNF_Hdl ) );
+ m_pHeaderCB->SetClickHdl(LINK(this, SwInsTableDlg, CheckBoxHdl));
+ m_pRepeatHeaderCB->SetClickHdl(LINK(this, SwInsTableDlg, ReapeatHeaderCheckBoxHdl));
ReapeatHeaderCheckBoxHdl();
CheckBoxHdl();
- sal_Int64 nMax = aRowEdit.GetValue();
+ sal_Int64 nMax = m_pRowNF->GetValue();
if( nMax <= 1 )
nMax = 1;
else
--nMax;
- aRepeatHeaderNF.SetMax( nMax );
-
- aRepeatHeaderCombo.Arrange( aRepeatHeaderFT );
+ m_pRepeatHeaderNF->SetMax( nMax );
}
SwInsTableDlg::~SwInsTableDlg()
@@ -173,37 +156,37 @@ IMPL_LINK_INLINE_START( SwInsTableDlg, ModifyName, Edit *, pEdit )
pEdit->SetText(sTblName);
}
- aOkBtn.Enable(pShell->GetTblStyle( sTblName ) == 0);
+ m_pOkBtn->Enable(pShell->GetTblStyle( sTblName ) == 0);
return 0;
}
IMPL_LINK_INLINE_END( SwInsTableDlg, ModifyName, Edit *, pEdit )
IMPL_LINK( SwInsTableDlg, ModifyRowCol, NumericField *, pField )
{
- if(pField == &aColEdit)
+ if(pField == m_pColNF)
{
- sal_Int64 nCol = aColEdit.GetValue();
+ sal_Int64 nCol = m_pColNF->GetValue();
if(!nCol)
nCol = 1;
- aRowEdit.SetMax(ROW_COL_PROD/nCol);
+ m_pRowNF->SetMax(ROW_COL_PROD/nCol);
}
else
{
- sal_Int64 nRow = aRowEdit.GetValue();
+ sal_Int64 nRow = m_pRowNF->GetValue();
if(!nRow)
nRow = 1;
- aColEdit.SetMax(ROW_COL_PROD/nRow);
+ m_pColNF->SetMax(ROW_COL_PROD/nRow);
// adjust depending NF for repeated rows
sal_Int64 nMax = ( nRow == 1 )? 1 : nRow - 1 ;
- sal_Int64 nActVal = aRepeatHeaderNF.GetValue();
+ sal_Int64 nActVal = m_pRepeatHeaderNF->GetValue();
- aRepeatHeaderNF.SetMax( nMax );
+ m_pRepeatHeaderNF->SetMax( nMax );
if( nActVal > nMax )
- aRepeatHeaderNF.SetValue( nMax );
+ m_pRepeatHeaderNF->SetValue( nMax );
else if( nActVal < nEnteredValRepeatHeaderNF )
- aRepeatHeaderNF.SetValue( ( nEnteredValRepeatHeaderNF < nMax )? nEnteredValRepeatHeaderNF : nMax );
+ m_pRepeatHeaderNF->SetValue( ( nEnteredValRepeatHeaderNF < nMax )? nEnteredValRepeatHeaderNF : nMax );
}
return 0;
}
@@ -223,7 +206,7 @@ IMPL_LINK( SwInsTableDlg, AutoFmtHdl, PushButton*, pButton )
IMPL_LINK_NOARG(SwInsTableDlg, CheckBoxHdl)
{
- aRepeatHeaderCB.Enable(aHeaderCB.IsChecked());
+ m_pRepeatHeaderCB->Enable(m_pHeaderCB->IsChecked());
ReapeatHeaderCheckBoxHdl();
return 0;
@@ -231,14 +214,14 @@ IMPL_LINK_NOARG(SwInsTableDlg, CheckBoxHdl)
IMPL_LINK_NOARG(SwInsTableDlg, ReapeatHeaderCheckBoxHdl)
{
- aRepeatHeaderCombo.Enable(aHeaderCB.IsChecked() && aRepeatHeaderCB.IsChecked());
+ m_pRepeatGroup->Enable(m_pHeaderCB->IsChecked() && m_pRepeatHeaderCB->IsChecked());
return 0;
}
IMPL_LINK_NOARG(SwInsTableDlg, ModifyRepeatHeaderNF_Hdl)
{
- nEnteredValRepeatHeaderNF = aRepeatHeaderNF.GetValue();
+ nEnteredValRepeatHeaderNF = m_pRepeatHeaderNF->GetValue();
return 0;
}
diff --git a/sw/source/ui/table/instable.hrc b/sw/source/ui/table/instable.hrc
index 96305ca475f2..e0251b2de21f 100644
--- a/sw/source/ui/table/instable.hrc
+++ b/sw/source/ui/table/instable.hrc
@@ -16,25 +16,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#define FT_COL 1
-#define FT_ROW 2
-#define ED_COL 4
-#define ED_ROW 5
-#define FL_TABLE 10
-#define ED_NAME 11
-#define FT_NAME 12
-#define CB_HEADER 13
-#define CB_REPEAT_HEADER 14
-#define CB_DONT_SPLIT 15
-#define CB_BORDER 16
-#define FL_OPTIONS 17
#define FT_REPEAT_HEADER 18
#define NF_REPEAT_HEADER 19
-#define BT_OK 20
-#define BT_CANCEL 21
-#define BT_HELP 22
-#define BT_AUTOFORMAT 23
-
#define WIN_REPEAT_HEADER 25
-
diff --git a/sw/source/ui/table/instable.src b/sw/source/ui/table/instable.src
deleted file mode 100644
index 9531a7d55a74..000000000000
--- a/sw/source/ui/table/instable.src
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "table.hrc"
-#include "instable.hrc"
-#include "cmdid.h"
-#include "helpid.h"
-ModalDialog DLG_INSERT_TABLE
-{
- HelpID = CMD_FN_INSERT_TABLE ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 280 , 166 ) ;
- Text [ en-US ] = "Insert Table" ;
- Moveable = TRUE ;
- Edit ED_NAME
- {
- HelpID = "sw:Edit:DLG_INSERT_TABLE:ED_NAME";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 53 , 6 ) ;
- Size = MAP_APPFONT ( 158, 12 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_NAME
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 45, 8 ) ;
- Text [ en-US ] = "Name";
- };
- FixedText FT_COL
- {
- Pos = MAP_APPFONT ( 12 , 34 ) ;
- Size = MAP_APPFONT ( 39 , 8 ) ;
- Text [ en-US ] = "~Columns" ;
- Left = TRUE ;
- };
- NumericField ED_COL
- {
- HelpID = "sw:NumericField:DLG_INSERT_TABLE:ED_COL";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 53 , 32 ) ;
- Size = MAP_APPFONT ( 28 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 99 ;
- Value = 2 ;
- First = 1 ;
- Last = 99 ;
- };
- FixedText FT_ROW
- {
- Pos = MAP_APPFONT ( 12 , 50 ) ;
- Size = MAP_APPFONT ( 39 , 8 ) ;
- Text [ en-US ] = "~Rows" ;
- Left = TRUE ;
- };
- NumericField ED_ROW
- {
- HelpID = "sw:NumericField:DLG_INSERT_TABLE:ED_ROW";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 53 , 48 ) ;
- Size = MAP_APPFONT ( 28 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 99 ;
- Value = 2 ;
- First = 1 ;
- Last = 99 ;
- };
- FixedLine FL_TABLE
- {
- Pos = MAP_APPFONT ( 6 , 21 ) ;
- Size = MAP_APPFONT ( 212 , 8 ) ;
- Text [ en-US ] = "Size";
- };
- CheckBox CB_HEADER
- {
- HelpID = "sw:CheckBox:DLG_INSERT_TABLE:CB_HEADER";
- Pos = MAP_APPFONT ( 12 , 74 ) ;
- Size = MAP_APPFONT (113 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Heading";
- };
- CheckBox CB_REPEAT_HEADER
- {
- HelpID = "sw:CheckBox:DLG_INSERT_TABLE:CB_REPEAT_HEADER";
- Pos = MAP_APPFONT ( 21 , 88 ) ;
- Size = MAP_APPFONT ( 104 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Repeat heading";
- };
- FixedText FT_REPEAT_HEADER
- {
- Pos = MAP_APPFONT ( 30 , 105 ) ;
- Size = MAP_APPFONT ( 95 , 10 ) ;
- Text [ en-US ] = "The first %POSITION_OF_CONTROL rows" ;
- };
- NumericField NF_REPEAT_HEADER
- {
- HelpID = "sw:NumericField:DLG_INSERT_TABLE:NF_REPEAT_HEADER";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 130 , 104 ) ;
- Size = MAP_APPFONT ( 28 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 1000 ;
- First = 1 ;
- };
- Window WIN_REPEAT_HEADER
- {
- Pos = MAP_APPFONT ( 30 , 102 ) ;
- Size = MAP_APPFONT ( 2 , 1 ) ;
- };
- CheckBox CB_DONT_SPLIT
- {
- HelpID = "sw:CheckBox:DLG_INSERT_TABLE:CB_DONT_SPLIT";
- Pos = MAP_APPFONT ( 12 , 118 ) ;
- Size = MAP_APPFONT ( 113 , 10 ) ;
- Text [ en-US ] = "Don't split table";
- TabStop = TRUE ;
- };
- CheckBox CB_BORDER
- {
- HelpID = "sw:CheckBox:DLG_INSERT_TABLE:CB_BORDER";
- Pos = MAP_APPFONT ( 12 , 132 ) ;
- Size = MAP_APPFONT ( 113 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Border";
- };
- PushButton BT_AUTOFORMAT
- {
- HelpID = "sw:PushButton:DLG_INSERT_TABLE:BT_AUTOFORMAT";
- Pos = MAP_APPFONT ( 12 , 146 ) ;
- Size = MAP_APPFONT ( 86 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Auto~Format..." ;
- };
- FixedLine FL_OPTIONS
- {
- Pos = MAP_APPFONT ( 6 , 63 ) ;
- Size = MAP_APPFONT ( 212 , 8 ) ;
- Text [ en-US ] = "Options";
- };
- OKButton BT_OK
- {
- Pos = MAP_APPFONT ( 224 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BT_CANCEL
- {
- Pos = MAP_APPFONT ( 224 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BT_HELP
- {
- Pos = MAP_APPFONT ( 224 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};