diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-25 12:27:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-25 12:36:39 +0100 |
commit | 5ab7d719795d5c74af856df98d23117ab62ffd78 (patch) | |
tree | dd3d4ba90bb2e4ac906d0bab79fa2bb273a5af7a | |
parent | 71356b046bfc17ab54c5a784522035538edda6c8 (diff) |
convert page preview zoom dialog to .ui
Change-Id: I4c4511787247bdcabd88af1c3b0894361336b71f
-rw-r--r-- | sw/AllLangResTarget_sw.mk | 1 | ||||
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/source/ui/uiview/pview.cxx | 40 | ||||
-rw-r--r-- | sw/source/ui/uiview/pview.hrc | 51 | ||||
-rw-r--r-- | sw/source/ui/uiview/pview.src | 103 | ||||
-rw-r--r-- | sw/source/ui/uiview/view.hrc | 1 | ||||
-rw-r--r-- | sw/source/ui/uiview/view.src | 4 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/previewzoomdialog.ui | 171 |
9 files changed, 189 insertions, 184 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index f52adae82fba..921d60811256 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -143,7 +143,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/table/chartins.src \ sw/source/ui/table/table.src \ sw/source/ui/table/tabledlg.src \ - sw/source/ui/uiview/pview.src \ sw/source/ui/uiview/view.src \ sw/source/ui/utlui/attrdesc.src \ sw/source/ui/utlui/gloslst.src \ diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index a0145233d078..0343d215e0b7 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -91,6 +91,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/outlinenumbering \ sw/uiconfig/swriter/ui/outlinenumberingpage \ sw/uiconfig/swriter/ui/outlinepositionpage \ + sw/uiconfig/swriter/ui/previewzoomdialog \ sw/uiconfig/swriter/ui/printoptionspage \ sw/uiconfig/swriter/ui/printeroptions \ sw/uiconfig/swriter/ui/rowheight \ diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index 5b114f85daf2..f5095ba562df 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -83,7 +83,6 @@ #define HID_NAVI_TBX15 "SW_HID_NAVI_TBX15" #define HID_NAVI_VS "SW_HID_NAVI_VS" #define HID_NUM_FORMAT_BTN "SW_HID_NUM_FORMAT_BTN" -#define HID_PPREV_ZOOM "SW_HID_PPREV_ZOOM" #define HID_NAVI_TBX16 "SW_HID_NAVI_TBX16" #define HID_LTEMPL_TEXT "SW_HID_LTEMPL_TEXT" #define HID_LTEMPL_FRAME "SW_HID_LTEMPL_FRAME" diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 8ce5a3220d5d..c7c5e41586b0 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -66,7 +66,7 @@ #include <cmdid.h> #include <globals.hrc> #include <popup.hrc> -#include <pview.hrc> +#include <view.hrc> #define SwPagePreView #include <sfx2/msg.hxx> @@ -137,47 +137,33 @@ static void lcl_InvalidateZoomSlots(SfxBindings& rBindings) // erstmal der Zoom-Dialog class SwPreViewZoomDlg : public SvxStandardDialog { - FixedText aRowLbl; - NumericField aRowEdit; - FixedText aColLbl; - NumericField aColEdit; + NumericField* m_pRowEdit; + NumericField* m_pColEdit; - OKButton aOkBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; - - virtual void Apply(); + virtual void Apply(); public: SwPreViewZoomDlg( SwPagePreViewWin& rParent ); - ~SwPreViewZoomDlg(); }; -SwPreViewZoomDlg::SwPreViewZoomDlg( SwPagePreViewWin& rParent ) : - SvxStandardDialog( &rParent, SW_RES(DLG_PAGEPREVIEW_ZOOM) ), - aRowLbl(this,SW_RES(FT_ROW)), - aRowEdit(this,SW_RES(ED_ROW)), - aColLbl(this,SW_RES(FT_COL)), - aColEdit(this,SW_RES(ED_COL)), - aOkBtn(this,SW_RES(BT_OK)), - aCancelBtn(this,SW_RES(BT_CANCEL)), - aHelpBtn(this,SW_RES(BT_HELP)) +SwPreViewZoomDlg::SwPreViewZoomDlg( SwPagePreViewWin& rParent ) + : SvxStandardDialog(&rParent, "PreviewZoomDialog", "modules/swriter/ui/previewzoomdialog.ui") { - FreeResource(); + get(m_pRowEdit, "rows"); + get(m_pColEdit, "cols"); - aRowEdit.SetValue( rParent.GetRow() ); - aColEdit.SetValue( rParent.GetCol() ); + m_pRowEdit->SetValue( rParent.GetRow() ); + m_pColEdit->SetValue( rParent.GetCol() ); } -SwPreViewZoomDlg::~SwPreViewZoomDlg() {} void SwPreViewZoomDlg::Apply() { ((SwPagePreViewWin*)GetParent())->CalcWish( - sal_uInt8(aRowEdit.GetValue()), - sal_uInt8(aColEdit.GetValue()) ); + sal_uInt8(m_pRowEdit->GetValue()), + sal_uInt8(m_pColEdit->GetValue()) ); } -// alles fuers SwPagePreViewWin +// all for SwPagePreViewWin SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView ) : Window( pParent, WinBits( WB_CLIPCHILDREN) ), mpViewShell( 0 ), diff --git a/sw/source/ui/uiview/pview.hrc b/sw/source/ui/uiview/pview.hrc deleted file mode 100644 index 53553dc5b017..000000000000 --- a/sw/source/ui/uiview/pview.hrc +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 "view.hrc" - -#define FT_COL 1 -#define FT_ROW 2 -#define ED_COL 4 -#define ED_ROW 5 - -#define BT_OK 20 -#define BT_CANCEL 21 -#define BT_HELP 22 - -// Grenzwerte fuers Zooming (werden auch im piew.cxx benutzt!) -#define PVIEW_MIN_ROW 1 -#define PVIEW_MAX_ROW 10 -#define PVIEW_MIN_COL 1 -#define PVIEW_MAX_COL 20 - -//Dialog Druckoptionen -#define FT_ROWS 2 -#define NF_ROWS 3 -#define FL_DISTANCE 7 -#define FL_ORIENTATION 8 - -#define WIN_PREVIEW 11 - -#define FT_LMARGIN 12 -#define FT_RMARGIN 14 -#define PB_STANDARD 24 - -#define RB_LANDSCAPE 24 -#define RB_PORTRAIT 25 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/pview.src b/sw/source/ui/uiview/pview.src deleted file mode 100644 index a1d0b7545fe3..000000000000 --- a/sw/source/ui/uiview/pview.src +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 <svx/svxids.hrc> -#include "pview.hrc" -#include "helpid.h" -#include "cmdid.h" -ModalDialog DLG_PAGEPREVIEW_ZOOM -{ - HelpID = HID_PPREV_ZOOM ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 141 , 69 ) ; - Text [ en-US ] = "Multiple Pages" ; - Moveable = TRUE ; - FixedText FT_COL - { - Pos = MAP_APPFONT ( 12 , 34 ) ; - Size = MAP_APPFONT ( 27 , 10 ) ; - Text [ en-US ] = "~Columns" ; - Left = TRUE ; - }; - FixedText FT_ROW - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 27 , 10 ) ; - Text [ en-US ] = "~Rows" ; - Left = TRUE ; - }; - NumericField ED_COL - { - HelpID = "sw:NumericField:DLG_PAGEPREVIEW_ZOOM:ED_COL"; - Border = TRUE ; - Size = MAP_APPFONT ( 28 , 12 ) ; - Pos = MAP_APPFONT ( 48 , 34 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = PVIEW_MIN_COL ; - Maximum = PVIEW_MAX_COL ; - Value = 1 ; - First = PVIEW_MIN_COL ; - Last = PVIEW_MAX_COL ; - }; - NumericField ED_ROW - { - HelpID = "sw:NumericField:DLG_PAGEPREVIEW_ZOOM:ED_ROW"; - Border = TRUE ; - Pos = MAP_APPFONT ( 48 , 13 ) ; - Size = MAP_APPFONT ( 28 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = PVIEW_MIN_ROW ; - Maximum = PVIEW_MAX_ROW ; - Value = 1 ; - First = PVIEW_MIN_ROW ; - Last = PVIEW_MAX_ROW ; - }; - OKButton BT_OK - { - Pos = MAP_APPFONT ( 88 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BT_CANCEL - { - Pos = MAP_APPFONT ( 88 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BT_HELP - { - Pos = MAP_APPFONT ( 88 , 49 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; -}; -String RID_PVIEW_TOOLBOX -{ - Text [ en-US ] = "Page Preview" ; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/view.hrc b/sw/source/ui/uiview/view.hrc index 256e3945253c..a38e4385ec10 100644 --- a/sw/source/ui/uiview/view.hrc +++ b/sw/source/ui/uiview/view.hrc @@ -66,7 +66,6 @@ // DLG ------------------------------------------------------------------- #define DLG_SPECIAL_FORCED (RC_VIEW_BEGIN) -#define DLG_PAGEPREVIEW_ZOOM (RC_VIEW_BEGIN + 1) // Ueberlaufpruefung ----------------------------------------------------- diff --git a/sw/source/ui/uiview/view.src b/sw/source/ui/uiview/view.src index 726d06675542..7798860e8582 100644 --- a/sw/source/ui/uiview/view.src +++ b/sw/source/ui/uiview/view.src @@ -182,6 +182,10 @@ String MN_SRCVIEW_POPUPMENU { Text [ en-US ] = "HTML source" ; }; +String RID_PVIEW_TOOLBOX +{ + Text [ en-US ] = "Page Preview" ; +}; Menu MN_SRCVIEW_POPUPMENU { diff --git a/sw/uiconfig/swriter/ui/previewzoomdialog.ui b/sw/uiconfig/swriter/ui/previewzoomdialog.ui new file mode 100644 index 000000000000..8c06a510dc32 --- /dev/null +++ b/sw/uiconfig/swriter/ui/previewzoomdialog.ui @@ -0,0 +1,171 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkAdjustment" id="adjustment1"> + <property name="lower">1</property> + <property name="upper">10</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustment2"> + <property name="lower">1</property> + <property name="upper">20</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkDialog" id="PreviewZoomDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Multiple Pages</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Rows</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">rows</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Columns</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">cols</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="rows"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">●</property> + <property name="adjustment">adjustment1</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="cols"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + <property name="adjustment">adjustment2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> +</interface> |