Kaydet (Commit) 644d22e6 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert insert rule

Change-Id: Ic4191a6dd38ef619efc4e4dc5ed6fe418c0942f4
üst de661fd7
......@@ -156,7 +156,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/misc/glosbib.src \
sw/source/ui/misc/glossary.src \
sw/source/ui/misc/insfnote.src \
sw/source/ui/misc/insrule.src \
sw/source/ui/misc/num.src \
sw/source/ui/misc/numberingtypelistbox.src \
sw/source/ui/misc/outline.src \
......
......@@ -14,6 +14,7 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/charurlpage \
sw/uiconfig/swriter/ui/columnwidth \
sw/uiconfig/swriter/ui/converttexttable \
sw/uiconfig/swriter/ui/horizontalrule \
sw/uiconfig/swriter/ui/insertbreak \
sw/uiconfig/swriter/ui/inserttable \
sw/uiconfig/swriter/ui/linenumbering \
......
......@@ -69,7 +69,6 @@
#define HID_VS_BULLET "SW_HID_VS_BULLET"
#define HID_VS_NUMBMP "SW_HID_VS_NUMBMP"
#define HID_VS_RULER "SW_HID_VS_RULER"
#define HID_RULER_DIALOG "SW_HID_RULER_DIALOG"
#define HID_INSERT_ABSTRACT "SW_HID_INSERT_ABSTRACT"
#define HID_NAVI_TBX1 "SW_HID_NAVI_TBX1"
#define HID_NAVI_TBX2 "SW_HID_NAVI_TBX2"
......
......@@ -444,8 +444,7 @@ public:
virtual VclAbstractDialog* CreateTitlePageDlg ( Window * pParent ) = 0;
virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId,
SwView& rView, sal_Bool bCol = sal_False ) = 0; //add for SwInsRowColDlg, SwLineNumberingDlg
virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId,
Window * pParent ) = 0; //add for SwInsertGrfRulerDlg
virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg(Window * pParent) = 0; //add for SwInsertGrfRulerDlg
virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView) = 0; //add for SwInsTableDlg
virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId,
Window* pParent, SwWrtShell* pWrtSh ) = 0; //add for SwJavaEditDialog
......
......@@ -655,6 +655,11 @@ String STR_COL
Text [ en-US ] = "Column" ;
};
String STR_SIMPLE
{
Text [ en-US ] = "Plain" ;
};
ToolBox RID_MODULE_TOOLBOX
{
HelpID = HID_MODULE_TOOLBOX ;
......
......@@ -1243,22 +1243,11 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog( int nRe
return 0;
}
AbstractInsertGrfRulerDlg * SwAbstractDialogFactory_Impl::CreateInsertGrfRulerDlg( int nResId,
Window * pParent ) //add for SwInsertGrfRulerDlg
//add for SwInsertGrfRulerDlg
AbstractInsertGrfRulerDlg * SwAbstractDialogFactory_Impl::CreateInsertGrfRulerDlg(Window * pParent)
{
SwInsertGrfRulerDlg* pDlg=NULL;
switch ( nResId )
{
case DLG_INSERT_RULER :
pDlg = new SwInsertGrfRulerDlg( pParent );
break;
default:
break;
}
if ( pDlg )
return new AbstractInsertGrfRulerDlg_Impl( pDlg );
return 0;
SwInsertGrfRulerDlg* pDlg = new SwInsertGrfRulerDlg(pParent);
return new AbstractInsertGrfRulerDlg_Impl(pDlg);
}
AbstractInsTableDlg * SwAbstractDialogFactory_Impl::CreateInsTableDlg(SwView& rView) //add for SwInsTableDlg
......
......@@ -523,8 +523,7 @@ public:
virtual VclAbstractDialog * CreateTitlePageDlg ( Window * pParent );
virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId,
SwView& rView, sal_Bool bCol = sal_False ); //add for SwInsRowColDlg, SwLineNumberingDlg
virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId,
Window * pParent ); //add for SwInsertGrfRulerDlg
virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg(Window * pParent); //add for SwInsertGrfRulerDlg
virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView); //add for SwInsTableDlg
virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId,
Window* pParent, SwWrtShell* pWrtSh ); //add for SwJavaEditDialog
......
......@@ -114,8 +114,9 @@
#define STR_NUMERIC (RC_APP_BEGIN + 126)
#define STR_COL (RC_APP_BEGIN + 127)
#define STR_ROW (RC_APP_BEGIN + 128)
#define STR_SIMPLE (RC_APP_BEGIN + 129)
#define APP_ACT_END STR_ROW
#define APP_ACT_END STR_SIMPLE
#if APP_ACT_END > RC_APP_END
#error Resource-Id Ueberlauf in #file, #line
......
......@@ -28,18 +28,14 @@ class ValueSet;
class SwInsertGrfRulerDlg : public SfxModalDialog
{
FixedLine aSelectionFL;
OKButton aOkPB;
CancelButton aCancelPB;
HelpButton aHelpPB;
OKButton* m_pOkPB;
SwRulerValueSet* m_pExampleVS;
std::vector<String> aGrfNames;
String sSimple;
String sRulers;
sal_uInt16 nSelPos;
SwRulerValueSet* pExampleVS;
protected:
DECL_LINK(SelectHdl, ValueSet*);
DECL_LINK(DoubleClickHdl, void *);
......
......@@ -31,7 +31,6 @@
#define DLG_NUM_NAMES (RC_MISC_BEGIN + 18)
#define DLG_SORTING (RC_MISC_BEGIN + 19)
#define DLG_RENAME_GLOS (RC_MISC_BEGIN + 25)
#define DLG_INSERT_RULER (RC_MISC_BEGIN + 28)
#define DLG_REDLINE_ACCEPT (RC_MISC_BEGIN + 29)
#define DLG_TAB_OUTLINE (RC_MISC_BEGIN + 31)
......
......@@ -37,49 +37,44 @@
#include "docsh.hxx"
#include "insrule.hxx"
#include "swvset.hxx"
#include "insrule.hrc"
#include "app.hrc"
#include "misc.hrc"
#include "helpid.h"
SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) :
SfxModalDialog(pParent, SW_RES(DLG_INSERT_RULER)),
aSelectionFL(this, SW_RES(FL_SEL )),
aOkPB (this, SW_RES(PB_OK )),
aCancelPB (this, SW_RES(PB_CANCEL )),
aHelpPB (this, SW_RES(PB_HELP )),
sSimple (SW_RES(ST_SIMPLE)),
nSelPos(USHRT_MAX),
pExampleVS (new SwRulerValueSet(this, SW_RES(VS_EXAMPLE )))
SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent )
: SfxModalDialog(pParent, "HorizontalRuleDialog", "modules/swriter/ui/horizontalrule.ui")
, sSimple(SW_RESSTR(STR_SIMPLE))
, nSelPos(USHRT_MAX)
{
FreeResource();
pExampleVS->SetLineCount(6);
pExampleVS->SetColCount(1);
pExampleVS->SetSelectHdl(LINK(this, SwInsertGrfRulerDlg, SelectHdl));
pExampleVS->SetDoubleClickHdl(LINK(this, SwInsertGrfRulerDlg, DoubleClickHdl));
pExampleVS->GrabFocus();
get(m_pOkPB, "ok");
get(m_pExampleVS, "rulers");
m_pExampleVS->SetLineCount(6);
m_pExampleVS->SetColCount(1);
m_pExampleVS->SetSelectHdl(LINK(this, SwInsertGrfRulerDlg, SelectHdl));
m_pExampleVS->SetDoubleClickHdl(LINK(this, SwInsertGrfRulerDlg, DoubleClickHdl));
// determine graphic name
GalleryExplorer::BeginLocking(GALLERY_THEME_RULERS);
GalleryExplorer::FillObjList( GALLERY_THEME_RULERS, aGrfNames );
pExampleVS->SetHelpId(HID_VS_RULER);
m_pExampleVS->SetHelpId(HID_VS_RULER);
Color aColor(COL_WHITE);
pExampleVS->InsertItem( 1, 1);
pExampleVS->SetItemText( 1, sSimple);
m_pExampleVS->InsertItem( 1, 1);
m_pExampleVS->SetItemText( 1, sSimple);
for(sal_uInt16 i = 1; i <= aGrfNames.size(); i++)
{
pExampleVS->InsertItem( i + 1, i);
pExampleVS->SetItemText( i + 1, aGrfNames[i-1]);
m_pExampleVS->InsertItem( i + 1, i);
m_pExampleVS->SetItemText( i + 1, aGrfNames[i-1]);
}
pExampleVS->Show();
m_pExampleVS->SelectItem(1);
m_pExampleVS->GrabFocus();
}
SwInsertGrfRulerDlg::~SwInsertGrfRulerDlg()
{
GalleryExplorer::EndLocking(GALLERY_THEME_RULERS);
delete pExampleVS;
}
String SwInsertGrfRulerDlg::GetGraphicName()
......@@ -96,7 +91,7 @@ String SwInsertGrfRulerDlg::GetGraphicName()
IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS)
{
nSelPos = pVS->GetSelectItemId();
aOkPB.Enable();
m_pOkPB->Enable();
return 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 "misc.hrc"
#define FL_SEL 1
#define VS_EXAMPLE 2
#define PB_OK 3
#define PB_CANCEL 4
#define PB_HELP 5
#define ST_SIMPLE 6
/*
* 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 "insrule.hrc"
#include "helpid.h"
ModalDialog DLG_INSERT_RULER
{
HelpID = HID_RULER_DIALOG ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 242 , 124 ) ;
Moveable = TRUE ;
FixedLine FL_SEL
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 174 , 8 ) ;
Text [ en-US ] = "Selection" ;
};
Control VS_EXAMPLE
{
Pos = MAP_APPFONT ( 9 , 14 ) ;
Size = MAP_APPFONT ( 168 , 104 ) ;
Hide = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
Group = TRUE ;
};
OKButton PB_OK
{
Pos = MAP_APPFONT ( 186 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
Disable = TRUE ;
};
CancelButton PB_CANCEL
{
Pos = MAP_APPFONT ( 186 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton PB_HELP
{
Pos = MAP_APPFONT ( 186 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
String ST_SIMPLE
{
Text [ en-US ] = "Plain" ;
};
Text [ en-US ] = "Insert Horizontal Rule" ;
};
......@@ -660,8 +660,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg( DLG_INSERT_RULER,
pParent );
AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg(pParent);
OSL_ENSURE(pDlg, "Dialogdiet fail!");
// MessageBox fuer fehlende Grafiken
if(!pDlg->HasImages())
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="HorizontalRuleDialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Insert Horizontal Rule</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">2</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="use_action_appearance">False</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_action_appearance">False</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="button2">
<property name="label">gtk-cancel</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</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="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</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="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="swuilo:SwRulerValueSet" id="rulers">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_request">400</property>
<property name="height_request">250</property>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Selection&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</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">button2</action-widget>
<action-widget response="0">help</action-widget>
</action-widgets>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment