Kaydet (Commit) 70d2a595 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SwDropCapsPage

Change-Id: Ic3438ff0862f74273fe0aec443aaeacee331abdd
Reviewed-on: https://gerrit.libreoffice.org/55843
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst f94292e8
...@@ -386,9 +386,6 @@ ...@@ -386,9 +386,6 @@
<glade-widget-class title="Caption Preview" name="swuilo-SwCaptionPreview" <glade-widget-class title="Caption Preview" name="swuilo-SwCaptionPreview"
generic-name="Caption Preview Window" parent="GtkDrawingArea" generic-name="Caption Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Drop Caps Preview" name="swuilo-SwDropCapsPict"
generic-name="Drop Caps Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Extension List" name="deploymentgui-ExtensionBox" <glade-widget-class title="Extension List" name="deploymentgui-ExtensionBox"
generic-name="Extensions List" parent="GtkDrawingArea" generic-name="Extensions List" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
......
...@@ -35,13 +35,11 @@ ...@@ -35,13 +35,11 @@
#include <sfx2/dialoghelper.hxx> #include <sfx2/dialoghelper.hxx>
#include <sfx2/htmlmode.hxx> #include <sfx2/htmlmode.hxx>
#include <sfx2/objsh.hxx> #include <sfx2/objsh.hxx>
#include <editeng/svxfont.hxx> #include <svtools/unitconv.hxx>
#include <vcl/print.hxx> #include <vcl/print.hxx>
#include <vcl/builderfactory.hxx> #include <vcl/builderfactory.hxx>
#include <sfx2/printer.hxx>
#include <com/sun/star/i18n/ScriptType.hpp> #include <com/sun/star/i18n/ScriptType.hpp>
#include <editeng/scripttypeitem.hxx> #include <editeng/scripttypeitem.hxx>
#include <com/sun/star/i18n/BreakIterator.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <charatr.hxx> #include <charatr.hxx>
...@@ -60,94 +58,22 @@ const sal_uInt16 SwDropCapsPage::aPageRg[] = { ...@@ -60,94 +58,22 @@ const sal_uInt16 SwDropCapsPage::aPageRg[] = {
0 0
}; };
class SwDropCapsPict : public Control
{
VclPtr<SwDropCapsPage> mpPage;
OUString maText;
OUString maScriptText;
Color maBackColor;
Color maTextLineColor;
sal_uInt8 mnLines;
long mnTotLineH;
long mnLineH;
long mnTextH;
sal_uInt16 mnDistance;
VclPtr<Printer> mpPrinter;
bool mbDelPrinter;
/// The ScriptInfo structure holds information on where we change from one
/// script to another.
struct ScriptInfo
{
sal_uLong textWidth; ///< Physical width of this segment.
sal_uInt16 scriptType; ///< Script type (e.g. Latin, Asian, Complex)
sal_Int32 changePos; ///< Character position where the script changes.
ScriptInfo(sal_uInt16 scrptType, sal_Int32 position)
: textWidth(0), scriptType(scrptType), changePos(position) {}
};
std::vector<ScriptInfo> maScriptChanges;
SvxFont maFont;
SvxFont maCJKFont;
SvxFont maCTLFont;
Size maTextSize;
Reference< css::i18n::XBreakIterator > xBreak;
virtual void Paint(vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle &rRect) override;
void CheckScript();
Size CalcTextSize();
inline void InitPrinter();
void InitPrinter_();
static void GetFontSettings( const SwDropCapsPage& _rPage, vcl::Font& _rFont, sal_uInt16 _nWhich );
void GetFirstScriptSegment(sal_Int32 &start, sal_Int32 &end, sal_uInt16 &scriptType);
bool GetNextScriptSegment(size_t &nIdx, sal_Int32 &start, sal_Int32 &end, sal_uInt16 &scriptType);
public:
SwDropCapsPict(vcl::Window *pParent, WinBits nBits)
: Control(pParent, nBits)
, mpPage(nullptr)
, mnLines(0)
, mnTotLineH(0)
, mnLineH(0)
, mnTextH(0)
, mnDistance(0)
, mpPrinter(nullptr)
, mbDelPrinter(false)
{}
void SetDropCapsPage(SwDropCapsPage* pPage) { mpPage = pPage; }
virtual ~SwDropCapsPict() override;
virtual void dispose() override;
void UpdatePaintSettings(); // also invalidates control!
virtual void Resize() override;
virtual Size GetOptimalSize() const override;
void SetText( const OUString& rT ) override;
void SetLines( sal_uInt8 nL );
void SetDistance( sal_uInt16 nD );
void SetValues( const OUString& rText, sal_uInt8 nLines, sal_uInt16 nDistance );
void DrawPrev(vcl::RenderContext& rRenderContext, const Point& rPt);
};
VCL_BUILDER_FACTORY_ARGS(SwDropCapsPict, WB_BORDER)
void SwDropCapsPict::SetText( const OUString& rT ) void SwDropCapsPict::SetText( const OUString& rT )
{ {
maText = rT; maText = rT;
UpdatePaintSettings(); UpdatePaintSettings();
} }
Size SwDropCapsPict::GetOptimalSize() const void SwDropCapsPict::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{ {
return getParagraphPreviewOptimalSize(*this); Size aPrefSize(getParagraphPreviewOptimalSize(pDrawingArea->get_ref_device()));
pDrawingArea->set_size_request(aPrefSize.Width(), aPrefSize.Height());
CustomWidgetController::SetDrawingArea(pDrawingArea);
} }
void SwDropCapsPict::Resize() void SwDropCapsPict::Resize()
{ {
Control::Resize(); CustomWidgetController::Resize();
UpdatePaintSettings(); UpdatePaintSettings();
} }
...@@ -187,28 +113,23 @@ OUString GetDefaultString(sal_Int32 nChars) ...@@ -187,28 +113,23 @@ OUString GetDefaultString(sal_Int32 nChars)
return aStr; return aStr;
} }
static void calcFontHeightAnyAscent( vcl::RenderContext* _pWin, vcl::Font const & _rFont, long& _nHeight, long& _nAscent ) static void calcFontHeightAnyAscent(vcl::RenderContext& rWin, vcl::Font const & _rFont, long& _nHeight, long& _nAscent)
{ {
if ( !_nHeight ) if ( !_nHeight )
{ {
_pWin->SetFont( _rFont ); rWin.Push(PushFlags::FONT);
FontMetric aMetric( _pWin->GetFontMetric() ); rWin.SetFont(_rFont);
FontMetric aMetric(rWin.GetFontMetric());
_nHeight = aMetric.GetLineHeight(); _nHeight = aMetric.GetLineHeight();
_nAscent = aMetric.GetAscent(); _nAscent = aMetric.GetAscent();
rWin.Pop();
} }
} }
SwDropCapsPict::~SwDropCapsPict() SwDropCapsPict::~SwDropCapsPict()
{ {
disposeOnce(); if (mbDelPrinter)
}
void SwDropCapsPict::dispose()
{
if( mbDelPrinter )
mpPrinter.disposeAndClear(); mpPrinter.disposeAndClear();
mpPage.clear();
Control::dispose();
} }
/// Get the details of the first script change. /// Get the details of the first script change.
...@@ -263,7 +184,7 @@ void SwDropCapsPict::GetFontSettings( const SwDropCapsPage& _rPage, vcl::Font& _ ...@@ -263,7 +184,7 @@ void SwDropCapsPict::GetFontSettings( const SwDropCapsPage& _rPage, vcl::Font& _
void SwDropCapsPict::UpdatePaintSettings() void SwDropCapsPict::UpdatePaintSettings()
{ {
maBackColor = GetSettings().GetStyleSettings().GetWindowColor(); maBackColor = Application::GetSettings().GetStyleSettings().GetWindowColor();
maTextLineColor = COL_LIGHTGRAY; maTextLineColor = COL_LIGHTGRAY;
// gray lines // gray lines
...@@ -273,7 +194,7 @@ void SwDropCapsPict::UpdatePaintSettings() ...@@ -273,7 +194,7 @@ void SwDropCapsPict::UpdatePaintSettings()
vcl::Font aFont; vcl::Font aFont;
if (mpPage) if (mpPage)
{ {
if (!mpPage->m_pTemplateBox->GetSelectedEntryPos()) if (!mpPage->m_xTemplateBox->get_active())
{ {
// query the Font at paragraph's beginning // query the Font at paragraph's beginning
mpPage->rSh.Push(); mpPage->rSh.Push();
...@@ -298,7 +219,7 @@ void SwDropCapsPict::UpdatePaintSettings() ...@@ -298,7 +219,7 @@ void SwDropCapsPict::UpdatePaintSettings()
{ {
// query Font at character template // query Font at character template
SwCharFormat *pFormat = mpPage->rSh.GetCharStyle( SwCharFormat *pFormat = mpPage->rSh.GetCharStyle(
mpPage->m_pTemplateBox->GetSelectedEntry(), mpPage->m_xTemplateBox->get_active_text(),
SwWrtShell::GETSTYLE_CREATEANY ); SwWrtShell::GETSTYLE_CREATEANY );
OSL_ENSURE(pFormat, "character style doesn't exist!"); OSL_ENSURE(pFormat, "character style doesn't exist!");
const SvxFontItem &rFormatFont = pFormat->GetFont(); const SvxFontItem &rFormatFont = pFormat->GetFont();
...@@ -323,16 +244,14 @@ void SwDropCapsPict::UpdatePaintSettings() ...@@ -323,16 +244,14 @@ void SwDropCapsPict::UpdatePaintSettings()
maCJKFont.SetColor( SwViewOption::GetFontColor() ); maCJKFont.SetColor( SwViewOption::GetFontColor() );
maCTLFont.SetColor( SwViewOption::GetFontColor() ); maCTLFont.SetColor( SwViewOption::GetFontColor() );
aFont.SetFillColor(GetSettings().GetStyleSettings().GetWindowColor()); aFont.SetFillColor(Application::GetSettings().GetStyleSettings().GetWindowColor());
maCJKFont.SetFillColor(GetSettings().GetStyleSettings().GetWindowColor()); maCJKFont.SetFillColor(Application::GetSettings().GetStyleSettings().GetWindowColor());
maCTLFont.SetFillColor(GetSettings().GetStyleSettings().GetWindowColor()); maCTLFont.SetFillColor(Application::GetSettings().GetStyleSettings().GetWindowColor());
maCJKFont.SetFontSize(Size(0, maCJKFont.GetFontSize().Height())); maCJKFont.SetFontSize(Size(0, maCJKFont.GetFontSize().Height()));
maCTLFont.SetFontSize(Size(0, maCTLFont.GetFontSize().Height())); maCTLFont.SetFontSize(Size(0, maCTLFont.GetFontSize().Height()));
SetFont(aFont);
aFont.SetFontSize(Size(0, aFont.GetFontSize().Height())); aFont.SetFontSize(Size(0, aFont.GetFontSize().Height()));
SetFont(aFont);
maFont = aFont; maFont = aFont;
CheckScript(); CheckScript();
...@@ -373,7 +292,7 @@ void SwDropCapsPict::Paint(vcl::RenderContext& rRenderContext, const tools::Rect ...@@ -373,7 +292,7 @@ void SwDropCapsPict::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
// Text background with gap (240 twips ~ 1 line height) // Text background with gap (240 twips ~ 1 line height)
const long nDistW = (((static_cast<long>(mnDistance) * 100) / 240) * mnTotLineH) / 100; const long nDistW = (((static_cast<long>(mnDistance) * 100) / 240) * mnTotLineH) / 100;
rRenderContext.SetFillColor(maBackColor); rRenderContext.SetFillColor(maBackColor);
if (mpPage && mpPage->m_pDropCapsBox->IsChecked()) if (mpPage && mpPage->m_xDropCapsBox->get_active())
{ {
const Size aTextSize(maTextSize.Width() + nDistW, maTextSize.Height()); const Size aTextSize(maTextSize.Width() + nDistW, maTextSize.Height());
rRenderContext.DrawRect(tools::Rectangle(Point(BORDER, nY0), aTextSize)); rRenderContext.DrawRect(tools::Rectangle(Point(BORDER, nY0), aTextSize));
...@@ -484,13 +403,13 @@ Size SwDropCapsPict::CalcTextSize() ...@@ -484,13 +403,13 @@ Size SwDropCapsPict::CalcTextSize()
switch(nScript) switch(nScript)
{ {
case css::i18n::ScriptType::ASIAN: case css::i18n::ScriptType::ASIAN:
calcFontHeightAnyAscent(this, maCJKFont, nCJKHeight, nCJKAscent); calcFontHeightAnyAscent(GetDrawingArea()->get_ref_device(), maCJKFont, nCJKHeight, nCJKAscent);
break; break;
case css::i18n::ScriptType::COMPLEX: case css::i18n::ScriptType::COMPLEX:
calcFontHeightAnyAscent(this, maCTLFont, nCTLHeight, nCTLAscent); calcFontHeightAnyAscent(GetDrawingArea()->get_ref_device(), maCTLFont, nCTLHeight, nCTLAscent);
break; break;
default: default:
calcFontHeightAnyAscent(this, maFont, nHeight, nAscent); calcFontHeightAnyAscent(GetDrawingArea()->get_ref_device(), maFont, nHeight, nAscent);
} }
if (!GetNextScriptSegment(nIdx, nStart, nEnd, nScript)) if (!GetNextScriptSegment(nIdx, nStart, nEnd, nScript))
...@@ -537,27 +456,26 @@ SwDropCapsDlg::SwDropCapsDlg(vcl::Window *pParent, const SfxItemSet &rSet ) ...@@ -537,27 +456,26 @@ SwDropCapsDlg::SwDropCapsDlg(vcl::Window *pParent, const SfxItemSet &rSet )
SetTabPage(pNewPage); SetTabPage(pNewPage);
} }
SwDropCapsPage::SwDropCapsPage(vcl::Window *pParent, const SfxItemSet &rSet) SwDropCapsPage::SwDropCapsPage(TabPageParent pParent, const SfxItemSet &rSet)
: SfxTabPage(pParent, "DropCapPage","modules/swriter/ui/dropcapspage.ui", &rSet) : SfxTabPage(pParent, "modules/swriter/ui/dropcapspage.ui", "DropCapPage", &rSet)
, bModified(false) , bModified(false)
, bFormat(true) , bFormat(true)
, rSh(::GetActiveView()->GetWrtShell()) , rSh(::GetActiveView()->GetWrtShell())
{ , m_xDropCapsBox(m_xBuilder->weld_check_button("checkCB_SWITCH"))
get(m_pDropCapsBox,"checkCB_SWITCH"); , m_xWholeWordCB(m_xBuilder->weld_check_button("checkCB_WORD"))
get(m_pWholeWordCB,"checkCB_WORD"); , m_xSwitchText(m_xBuilder->weld_label("labelFT_DROPCAPS"))
get(m_pDropCapsField,"spinFLD_DROPCAPS"); , m_xDropCapsField(m_xBuilder->weld_spin_button("spinFLD_DROPCAPS"))
get(m_pLinesField,"spinFLD_LINES"); , m_xLinesText(m_xBuilder->weld_label("labelTXT_LINES"))
get(m_pDistanceField,"spinFLD_DISTANCE"); , m_xLinesField(m_xBuilder->weld_spin_button("spinFLD_LINES"))
get(m_pSwitchText,"labelFT_DROPCAPS"); , m_xDistanceText(m_xBuilder->weld_label("labelTXT_DISTANCE"))
get(m_pLinesText,"labelTXT_LINES"); , m_xDistanceField(m_xBuilder->weld_metric_spin_button("spinFLD_DISTANCE", FUNIT_CM))
get(m_pDistanceText,"labelTXT_DISTANCE"); , m_xTextText(m_xBuilder->weld_label("labelTXT_TEXT"))
get(m_pTemplateText,"labelTXT_TEMPLATE"); , m_xTextEdit(m_xBuilder->weld_entry("entryEDT_TEXT"))
get(m_pTextText,"labelTXT_TEXT"); , m_xTemplateText(m_xBuilder->weld_label("labelTXT_TEMPLATE"))
get(m_pTextEdit,"entryEDT_TEXT"); , m_xTemplateBox(m_xBuilder->weld_combo_box_text("comboBOX_TEMPLATE"))
get(m_pTemplateBox,"comboBOX_TEMPLATE"); , m_xPict(new weld::CustomWeld(*m_xBuilder, "drawingareaWN_EXAMPLE", m_aPict))
get(m_pPict,"drawingareaWN_EXAMPLE"); {
m_aPict.SetDropCapsPage(this);
m_pPict->SetDropCapsPage(this);
SetExchangeSupport(); SetExchangeSupport();
...@@ -565,48 +483,26 @@ SwDropCapsPage::SwDropCapsPage(vcl::Window *pParent, const SfxItemSet &rSet) ...@@ -565,48 +483,26 @@ SwDropCapsPage::SwDropCapsPage(vcl::Window *pParent, const SfxItemSet &rSet)
bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0; bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0;
// In the template dialog the text is not influenceable // In the template dialog the text is not influenceable
m_pTextText->Enable( !bFormat ); m_xTextText->set_sensitive(!bFormat);
m_pTextEdit->Enable( !bFormat ); m_xTextEdit->set_sensitive(!bFormat);
// Metrics // Metrics
SetMetric( *m_pDistanceField, GetDfltMetric(bHtmlMode) ); SetFieldUnit(*m_xDistanceField, GetDfltMetric(bHtmlMode));
m_pPict->SetBorderStyle( WindowBorderStyle::MONO );
// Install handler // Install handler
Link<Edit&,void> aLk = LINK(this, SwDropCapsPage, ModifyHdl); Link<weld::SpinButton&,void> aValueChangedLk = LINK(this, SwDropCapsPage, ValueChangedHdl);
m_pDropCapsField->SetModifyHdl( aLk ); m_xDropCapsField->connect_value_changed(aValueChangedLk);
m_pLinesField->SetModifyHdl( aLk ); m_xLinesField->connect_value_changed(aValueChangedLk);
m_pDistanceField->SetModifyHdl( aLk ); Link<weld::MetricSpinButton&,void> aMetricValueChangedLk = LINK(this, SwDropCapsPage, MetricValueChangedHdl);
m_pTextEdit->SetModifyHdl( aLk ); m_xDistanceField->connect_value_changed(aMetricValueChangedLk);
m_pDropCapsBox->SetClickHdl (LINK(this, SwDropCapsPage, ClickHdl )); m_xTextEdit->connect_changed(LINK(this, SwDropCapsPage, ModifyHdl));
m_pTemplateBox->SetSelectHdl(LINK(this, SwDropCapsPage, SelectHdl)); m_xDropCapsBox->connect_toggled(LINK(this, SwDropCapsPage, ClickHdl));
m_pWholeWordCB->SetClickHdl (LINK(this, SwDropCapsPage, WholeWordHdl )); m_xTemplateBox->connect_changed(LINK(this, SwDropCapsPage, SelectHdl));
m_xWholeWordCB->connect_toggled(LINK(this, SwDropCapsPage, WholeWordHdl));
setPreviewsToSamePlace(pParent, this);
} }
SwDropCapsPage::~SwDropCapsPage() SwDropCapsPage::~SwDropCapsPage()
{ {
disposeOnce();
}
void SwDropCapsPage::dispose()
{
m_pDropCapsBox.clear();
m_pWholeWordCB.clear();
m_pSwitchText.clear();
m_pDropCapsField.clear();
m_pLinesText.clear();
m_pLinesField.clear();
m_pDistanceText.clear();
m_pDistanceField.clear();
m_pTextText.clear();
m_pTextEdit.clear();
m_pTemplateText.clear();
m_pTemplateBox.clear();
m_pPict.clear();
SfxTabPage::dispose();
} }
DeactivateRC SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet) DeactivateRC SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet)
...@@ -620,7 +516,7 @@ DeactivateRC SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet) ...@@ -620,7 +516,7 @@ DeactivateRC SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet)
VclPtr<SfxTabPage> SwDropCapsPage::Create(TabPageParent pParent, VclPtr<SfxTabPage> SwDropCapsPage::Create(TabPageParent pParent,
const SfxItemSet *rSet) const SfxItemSet *rSet)
{ {
return VclPtr<SwDropCapsPage>::Create(pParent.pParent, *rSet); return VclPtr<SwDropCapsPage>::Create(pParent, *rSet);
} }
bool SwDropCapsPage::FillItemSet(SfxItemSet *rSet) bool SwDropCapsPage::FillItemSet(SfxItemSet *rSet)
...@@ -636,95 +532,95 @@ void SwDropCapsPage::Reset(const SfxItemSet *rSet) ...@@ -636,95 +532,95 @@ void SwDropCapsPage::Reset(const SfxItemSet *rSet)
SwFormatDrop aFormatDrop( rSet->Get(RES_PARATR_DROP) ); SwFormatDrop aFormatDrop( rSet->Get(RES_PARATR_DROP) );
if (aFormatDrop.GetLines() > 1) if (aFormatDrop.GetLines() > 1)
{ {
m_pDropCapsField->SetValue(aFormatDrop.GetChars()); m_xDropCapsField->set_value(aFormatDrop.GetChars());
m_pLinesField->SetValue(aFormatDrop.GetLines()); m_xLinesField->set_value(aFormatDrop.GetLines());
m_pDistanceField->SetValue(m_pDistanceField->Normalize(aFormatDrop.GetDistance()), FUNIT_TWIP); m_xDistanceField->set_value(m_xDistanceField->normalize(aFormatDrop.GetDistance()), FUNIT_TWIP);
m_pWholeWordCB->Check(aFormatDrop.GetWholeWord()); m_xWholeWordCB->set_active(aFormatDrop.GetWholeWord());
} }
else else
{ {
m_pDropCapsField->SetValue(1); m_xDropCapsField->set_value(1);
m_pLinesField->SetValue(3); m_xLinesField->set_value(3);
m_pDistanceField->SetValue(0); m_xDistanceField->set_value(0, FUNIT_TWIP);
} }
::FillCharStyleListBox(*m_pTemplateBox, rSh.GetView().GetDocShell(), true); ::FillCharStyleListBox(*m_xTemplateBox, rSh.GetView().GetDocShell(), true);
m_pTemplateBox->InsertEntry(SwResId(SW_STR_NONE), 0); m_xTemplateBox->insert_text(0, SwResId(SW_STR_NONE));
// Reset format // Reset format
m_pTemplateBox->SelectEntryPos(0); m_xTemplateBox->set_active(0);
if (aFormatDrop.GetCharFormat()) if (aFormatDrop.GetCharFormat())
m_pTemplateBox->SelectEntry(aFormatDrop.GetCharFormat()->GetName()); m_xTemplateBox->set_active_text(aFormatDrop.GetCharFormat()->GetName());
// Enable controls // Enable controls
m_pDropCapsBox->Check(aFormatDrop.GetLines() > 1); m_xDropCapsBox->set_active(aFormatDrop.GetLines() > 1);
const sal_Int32 nVal = static_cast<sal_Int32>(m_pDropCapsField->GetValue()); const sal_Int32 nVal = m_xDropCapsField->get_value();
if (bFormat) if (bFormat)
m_pTextEdit->SetText(GetDefaultString(nVal)); m_xTextEdit->set_text(GetDefaultString(nVal));
else else
{ {
m_pTextEdit->SetText(rSh.GetDropText(nVal)); m_xTextEdit->set_text(rSh.GetDropText(nVal));
m_pTextEdit->Enable(); m_xTextEdit->set_sensitive(true);
m_pTextText->Enable(); m_xTextText->set_sensitive(true);
} }
// Preview // Preview
m_pPict->SetValues(m_pTextEdit->GetText(), m_aPict.SetValues(m_xTextEdit->get_text(),
sal_uInt8(m_pLinesField->GetValue()), sal_uInt8(m_xLinesField->get_value()),
sal_uInt16(m_pDistanceField->Denormalize(m_pDistanceField->GetValue(FUNIT_TWIP)))); sal_uInt16(m_xDistanceField->denormalize(m_xDistanceField->get_value(FUNIT_TWIP))));
ClickHdl(m_pDropCapsBox); ClickHdl(*m_xDropCapsBox);
bModified = false; bModified = false;
} }
IMPL_LINK_NOARG(SwDropCapsPage, ClickHdl, Button*, void) IMPL_LINK_NOARG(SwDropCapsPage, ClickHdl, weld::ToggleButton&, void)
{ {
bool bChecked = m_pDropCapsBox->IsChecked(); bool bChecked = m_xDropCapsBox->get_active();
m_pWholeWordCB->Enable( bChecked && !bHtmlMode ); m_xWholeWordCB->set_sensitive(bChecked && !bHtmlMode);
m_pSwitchText->Enable( bChecked && !m_pWholeWordCB->IsChecked() ); m_xSwitchText->set_sensitive(bChecked && !m_xWholeWordCB->get_active());
m_pDropCapsField->Enable( bChecked && !m_pWholeWordCB->IsChecked() ); m_xDropCapsField->set_sensitive(bChecked && !m_xWholeWordCB->get_active());
m_pLinesText->Enable( bChecked ); m_xLinesText->set_sensitive( bChecked );
m_pLinesField->Enable( bChecked ); m_xLinesField->set_sensitive( bChecked );
m_pDistanceText->Enable( bChecked ); m_xDistanceText->set_sensitive( bChecked );
m_pDistanceField->Enable( bChecked ); m_xDistanceField->set_sensitive( bChecked );
m_pTemplateText->Enable( bChecked ); m_xTemplateText->set_sensitive( bChecked );
m_pTemplateBox->Enable( bChecked ); m_xTemplateBox->set_sensitive( bChecked );
m_pTextEdit->Enable( bChecked && !bFormat ); m_xTextEdit->set_sensitive( bChecked && !bFormat );
m_pTextText->Enable( bChecked && !bFormat ); m_xTextText->set_sensitive( bChecked && !bFormat );
if ( bChecked ) if ( bChecked )
{ {
ModifyHdl(*m_pDropCapsField); ValueChangedHdl(*m_xDropCapsField);
m_pDropCapsField->GrabFocus(); m_xDropCapsField->grab_focus();
} }
else else
m_pPict->SetText(""); m_aPict.SetText("");
bModified = true; bModified = true;
} }
IMPL_LINK_NOARG(SwDropCapsPage, WholeWordHdl, Button*, void) IMPL_LINK_NOARG(SwDropCapsPage, WholeWordHdl, weld::ToggleButton&, void)
{ {
m_pDropCapsField->Enable( !m_pWholeWordCB->IsChecked() ); m_xDropCapsField->set_sensitive(!m_xWholeWordCB->get_active());
m_pSwitchText->Enable(!m_pWholeWordCB->IsChecked()); m_xSwitchText->set_sensitive(!m_xWholeWordCB->get_active());
ModifyHdl(*m_pDropCapsField); ValueChangedHdl(*m_xDropCapsField);
bModified = true; bModified = true;
} }
IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit&, rEdit, void ) void SwDropCapsPage::ModifyEntry(weld::Entry& rEdit)
{ {
OUString sPreview; OUString sPreview;
// set text if applicable // set text if applicable
if (&rEdit == m_pDropCapsField) if (&rEdit == m_xDropCapsField.get())
{ {
const sal_Int32 nVal = !m_pWholeWordCB->IsChecked() const sal_Int32 nVal = !m_xWholeWordCB->get_active()
? static_cast<sal_Int32>(m_pDropCapsField->GetValue()) ? static_cast<sal_Int32>(m_xDropCapsField->get_value())
: 0; : 0;
bool bSetText = false; bool bSetText = false;
...@@ -736,7 +632,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit&, rEdit, void ) ...@@ -736,7 +632,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit&, rEdit, void )
sPreview = rSh.GetDropText(nVal); sPreview = rSh.GetDropText(nVal);
} }
OUString sEdit(m_pTextEdit->GetText()); OUString sEdit(m_xTextEdit->get_text());
if (!sEdit.isEmpty() && !sPreview.startsWith(sEdit)) if (!sEdit.isEmpty() && !sPreview.startsWith(sEdit))
{ {
...@@ -745,29 +641,44 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit&, rEdit, void ) ...@@ -745,29 +641,44 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit&, rEdit, void )
} }
if (bSetText) if (bSetText)
m_pTextEdit->SetText(sPreview); m_xTextEdit->set_text(sPreview);
} }
else if (&rEdit == m_pTextEdit) // set quantity if applicable else if (&rEdit == m_xTextEdit.get()) // set quantity if applicable
{ {
const sal_Int32 nTmp = m_pTextEdit->GetText().getLength(); const sal_Int32 nTmp = m_xTextEdit->get_text().getLength();
m_pDropCapsField->SetValue(std::max<sal_Int32>(1, nTmp)); m_xDropCapsField->set_value(std::max<sal_Int32>(1, nTmp));
sPreview = m_pTextEdit->GetText(); sPreview = m_xTextEdit->get_text();
} }
// adjust image // adjust image
if (&rEdit == m_pDropCapsField || &rEdit == m_pTextEdit) if (&rEdit == m_xDropCapsField.get() || &rEdit == m_xTextEdit.get())
m_pPict->SetText (sPreview); m_aPict.SetText(sPreview);
else if (&rEdit == m_pLinesField) else if (&rEdit == m_xLinesField.get())
m_pPict->SetLines(static_cast<sal_uInt8>(m_pLinesField->GetValue())); m_aPict.SetLines(static_cast<sal_uInt8>(m_xLinesField->get_value()));
else else
m_pPict->SetDistance(static_cast<sal_uInt16>(m_pDistanceField->Denormalize(m_pDistanceField->GetValue(FUNIT_TWIP)))); m_aPict.SetDistance(static_cast<sal_uInt16>(m_xDistanceField->denormalize(m_xDistanceField->get_value(FUNIT_TWIP))));
bModified = true; bModified = true;
} }
IMPL_LINK_NOARG(SwDropCapsPage, SelectHdl, ListBox&, void) IMPL_LINK(SwDropCapsPage, ModifyHdl, weld::Entry&, rEdit, void)
{
ModifyEntry(rEdit);
}
IMPL_LINK(SwDropCapsPage, ValueChangedHdl, weld::SpinButton&, rEdit, void)
{
ModifyEntry(rEdit);
}
IMPL_LINK(SwDropCapsPage, MetricValueChangedHdl, weld::MetricSpinButton&, rEdit, void)
{
ModifyEntry(rEdit.get_widget());
}
IMPL_LINK_NOARG(SwDropCapsPage, SelectHdl, weld::ComboBoxText&, void)
{ {
m_pPict->UpdatePaintSettings(); m_aPict.UpdatePaintSettings();
bModified = true; bModified = true;
} }
...@@ -777,18 +688,18 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet ) ...@@ -777,18 +688,18 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet )
{ {
SwFormatDrop aFormat; SwFormatDrop aFormat;
bool bOn = m_pDropCapsBox->IsChecked(); bool bOn = m_xDropCapsBox->get_active();
if(bOn) if (bOn)
{ {
// quantity, lines, gap // quantity, lines, gap
aFormat.GetChars() = static_cast<sal_uInt8>(m_pDropCapsField->GetValue()); aFormat.GetChars() = static_cast<sal_uInt8>(m_xDropCapsField->get_value());
aFormat.GetLines() = static_cast<sal_uInt8>(m_pLinesField->GetValue()); aFormat.GetLines() = static_cast<sal_uInt8>(m_xLinesField->get_value());
aFormat.GetDistance() = static_cast<sal_uInt16>(m_pDistanceField->Denormalize(m_pDistanceField->GetValue(FUNIT_TWIP))); aFormat.GetDistance() = static_cast<sal_uInt16>(m_xDistanceField->denormalize(m_xDistanceField->get_value(FUNIT_TWIP)));
aFormat.GetWholeWord() = m_pWholeWordCB->IsChecked(); aFormat.GetWholeWord() = m_xWholeWordCB->get_active();
// template // template
if (m_pTemplateBox->GetSelectedEntryPos()) if (m_xTemplateBox->get_active())
aFormat.SetCharFormat(rSh.GetCharStyle(m_pTemplateBox->GetSelectedEntry())); aFormat.SetCharFormat(rSh.GetCharStyle(m_xTemplateBox->get_active_text()));
} }
else else
{ {
...@@ -804,13 +715,13 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet ) ...@@ -804,13 +715,13 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet )
// hard text formatting // hard text formatting
// Bug 24974: in designer/template catalog this doesn't make sense!! // Bug 24974: in designer/template catalog this doesn't make sense!!
if (!bFormat && m_pDropCapsBox->IsChecked()) if (!bFormat && m_xDropCapsBox->get_active())
{ {
OUString sText(m_pTextEdit->GetText()); OUString sText(m_xTextEdit->get_text());
if (!m_pWholeWordCB->IsChecked()) if (!m_xWholeWordCB->get_active())
{ {
sText = sText.copy(0, std::min<sal_Int32>(sText.getLength(), m_pDropCapsField->GetValue())); sText = sText.copy(0, std::min<sal_Int32>(sText.getLength(), m_xDropCapsField->get_value()));
} }
SfxStringItem aStr(FN_PARAM_1, sText); SfxStringItem aStr(FN_PARAM_1, sText);
......
...@@ -19,18 +19,20 @@ ...@@ -19,18 +19,20 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_DRPCPS_HXX #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_DRPCPS_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_DRPCPS_HXX #define INCLUDED_SW_SOURCE_UIBASE_INC_DRPCPS_HXX
#include <editeng/svxfont.hxx>
#include <sfx2/basedlgs.hxx> #include <sfx2/basedlgs.hxx>
#include <sfx2/tabdlg.hxx> #include <sfx2/tabdlg.hxx>
#include <sfx2/printer.hxx>
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <vcl/fixed.hxx> #include <vcl/fixed.hxx>
#include <vcl/field.hxx> #include <vcl/field.hxx>
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
#include <vcl/lstbox.hxx> #include <vcl/lstbox.hxx>
#include <vcl/customweld.hxx>
#include <com/sun/star/i18n/BreakIterator.hpp>
class SwWrtShell; class SwWrtShell;
...@@ -40,25 +42,83 @@ public: ...@@ -40,25 +42,83 @@ public:
SwDropCapsDlg(vcl::Window *pParent, const SfxItemSet &rSet ); SwDropCapsDlg(vcl::Window *pParent, const SfxItemSet &rSet );
}; };
class SwDropCapsPict; class SwDropCapsPage;
class SwDropCapsPict : public weld::CustomWidgetController
{
VclPtr<SwDropCapsPage> mpPage;
OUString maText;
OUString maScriptText;
Color maBackColor;
Color maTextLineColor;
sal_uInt8 mnLines;
long mnTotLineH;
long mnLineH;
long mnTextH;
sal_uInt16 mnDistance;
VclPtr<Printer> mpPrinter;
bool mbDelPrinter;
/// The ScriptInfo structure holds information on where we change from one
/// script to another.
struct ScriptInfo
{
sal_uLong textWidth; ///< Physical width of this segment.
sal_uInt16 scriptType; ///< Script type (e.g. Latin, Asian, Complex)
sal_Int32 changePos; ///< Character position where the script changes.
ScriptInfo(sal_uInt16 scrptType, sal_Int32 position)
: textWidth(0), scriptType(scrptType), changePos(position) {}
};
std::vector<ScriptInfo> maScriptChanges;
SvxFont maFont;
SvxFont maCJKFont;
SvxFont maCTLFont;
Size maTextSize;
css::uno::Reference< css::i18n::XBreakIterator > xBreak;
virtual void Paint(vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle &rRect) override;
void CheckScript();
Size CalcTextSize();
inline void InitPrinter();
void InitPrinter_();
static void GetFontSettings( const SwDropCapsPage& _rPage, vcl::Font& _rFont, sal_uInt16 _nWhich );
void GetFirstScriptSegment(sal_Int32 &start, sal_Int32 &end, sal_uInt16 &scriptType);
bool GetNextScriptSegment(size_t &nIdx, sal_Int32 &start, sal_Int32 &end, sal_uInt16 &scriptType);
public:
SwDropCapsPict()
: mpPage(nullptr)
, mnLines(0)
, mnTotLineH(0)
, mnLineH(0)
, mnTextH(0)
, mnDistance(0)
, mpPrinter(nullptr)
, mbDelPrinter(false)
{}
void SetDropCapsPage(SwDropCapsPage* pPage) { mpPage = pPage; }
virtual ~SwDropCapsPict() override;
void UpdatePaintSettings(); // also invalidates control!
virtual void Resize() override;
virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
void SetText( const OUString& rT );
void SetLines( sal_uInt8 nL );
void SetDistance( sal_uInt16 nD );
void SetValues( const OUString& rText, sal_uInt8 nLines, sal_uInt16 nDistance );
void DrawPrev(vcl::RenderContext& rRenderContext, const Point& rPt);
};
class SwDropCapsPage : public SfxTabPage class SwDropCapsPage : public SfxTabPage
{ {
friend class SwDropCapsPict; friend class SwDropCapsPict;
VclPtr<CheckBox> m_pDropCapsBox; SwDropCapsPict m_aPict;
VclPtr<CheckBox> m_pWholeWordCB;
VclPtr<FixedText> m_pSwitchText;
VclPtr<NumericField> m_pDropCapsField;
VclPtr<FixedText> m_pLinesText;
VclPtr<NumericField> m_pLinesField;
VclPtr<FixedText> m_pDistanceText;
VclPtr<MetricField> m_pDistanceField;
VclPtr<FixedText> m_pTextText;
VclPtr<Edit> m_pTextEdit;
VclPtr<FixedText> m_pTemplateText;
VclPtr<ListBox> m_pTemplateBox;
VclPtr<SwDropCapsPict> m_pPict;
bool bModified; bool bModified;
bool bFormat; bool bFormat;
...@@ -66,13 +126,31 @@ friend class SwDropCapsPict; ...@@ -66,13 +126,31 @@ friend class SwDropCapsPict;
SwWrtShell &rSh; SwWrtShell &rSh;
std::unique_ptr<weld::CheckButton> m_xDropCapsBox;
std::unique_ptr<weld::CheckButton> m_xWholeWordCB;
std::unique_ptr<weld::Label> m_xSwitchText;
std::unique_ptr<weld::SpinButton> m_xDropCapsField;
std::unique_ptr<weld::Label> m_xLinesText;
std::unique_ptr<weld::SpinButton> m_xLinesField;
std::unique_ptr<weld::Label> m_xDistanceText;
std::unique_ptr<weld::MetricSpinButton> m_xDistanceField;
std::unique_ptr<weld::Label> m_xTextText;
std::unique_ptr<weld::Entry> m_xTextEdit;
std::unique_ptr<weld::Label> m_xTemplateText;
std::unique_ptr<weld::ComboBoxText> m_xTemplateBox;
std::unique_ptr<weld::CustomWeld> m_xPict;
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override;
void FillSet( SfxItemSet &rSet ); void FillSet( SfxItemSet &rSet );
DECL_LINK( ClickHdl, Button*, void ); void ModifyEntry(weld::Entry& rEdit);
DECL_LINK( ModifyHdl, Edit&, void );
DECL_LINK( SelectHdl, ListBox&, void ); DECL_LINK(ClickHdl, weld::ToggleButton&, void);
DECL_LINK( WholeWordHdl, Button*, void ); DECL_LINK(MetricValueChangedHdl, weld::MetricSpinButton&, void);
DECL_LINK(ValueChangedHdl, weld::SpinButton&, void);
DECL_LINK(ModifyHdl, weld::Entry&, void);
DECL_LINK(SelectHdl, weld::ComboBoxText&, void);
DECL_LINK(WholeWordHdl, weld::ToggleButton&, void);
using SfxTabPage::ActivatePage; using SfxTabPage::ActivatePage;
using SfxTabPage::DeactivatePage; using SfxTabPage::DeactivatePage;
...@@ -80,9 +158,8 @@ friend class SwDropCapsPict; ...@@ -80,9 +158,8 @@ friend class SwDropCapsPict;
static const sal_uInt16 aPageRg[]; static const sal_uInt16 aPageRg[];
public: public:
SwDropCapsPage(vcl::Window *pParent, const SfxItemSet &rSet); SwDropCapsPage(TabPageParent pParent, const SfxItemSet &rSet);
virtual ~SwDropCapsPage() override; virtual ~SwDropCapsPage() override;
virtual void dispose() override;
static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet); static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
static const sal_uInt16* GetRanges() { return aPageRg; } static const sal_uInt16* GetRanges() { return aPageRg; }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 --> <!-- Generated with glade 3.22.1 -->
<interface domain="sw"> <interface domain="sw">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkAdjustment" id="adjustmentFLD_DISTANCE"> <object class="GtkAdjustment" id="adjustmentFLD_DISTANCE">
<property name="upper">2</property> <property name="upper">2</property>
<property name="step_increment">0.10000000000000001</property> <property name="step_increment">0.10000000000000001</property>
...@@ -87,10 +86,10 @@ ...@@ -87,10 +86,10 @@
<object class="GtkLabel" id="labelFT_DROPCAPS"> <object class="GtkLabel" id="labelFT_DROPCAPS">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes" context="dropcapspage|labelFT_DROPCAPS">Number of _characters:</property> <property name="label" translatable="yes" context="dropcapspage|labelFT_DROPCAPS">Number of _characters:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">spinFLD_DROPCAPS</property> <property name="mnemonic_widget">spinFLD_DROPCAPS</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -101,10 +100,10 @@ ...@@ -101,10 +100,10 @@
<object class="GtkLabel" id="labelTXT_LINES"> <object class="GtkLabel" id="labelTXT_LINES">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes" context="dropcapspage|labelTXT_LINES">_Lines:</property> <property name="label" translatable="yes" context="dropcapspage|labelTXT_LINES">_Lines:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">spinFLD_LINES</property> <property name="mnemonic_widget">spinFLD_LINES</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -115,10 +114,10 @@ ...@@ -115,10 +114,10 @@
<object class="GtkLabel" id="labelTXT_DISTANCE"> <object class="GtkLabel" id="labelTXT_DISTANCE">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes" context="dropcapspage|labelTXT_DISTANCE">_Space to text:</property> <property name="label" translatable="yes" context="dropcapspage|labelTXT_DISTANCE">_Space to text:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">spinFLD_DISTANCE:0cm</property> <property name="mnemonic_widget">spinFLD_DISTANCE</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -130,6 +129,7 @@ ...@@ -130,6 +129,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustmentFLD_DROPCAPS</property> <property name="adjustment">adjustmentFLD_DROPCAPS</property>
</object> </object>
<packing> <packing>
...@@ -142,6 +142,7 @@ ...@@ -142,6 +142,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustmentFLD_LINES</property> <property name="adjustment">adjustmentFLD_LINES</property>
</object> </object>
<packing> <packing>
...@@ -150,10 +151,11 @@ ...@@ -150,10 +151,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkSpinButton" id="spinFLD_DISTANCE:0cm"> <object class="GtkSpinButton" id="spinFLD_DISTANCE">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustmentFLD_DISTANCE</property> <property name="adjustment">adjustmentFLD_DISTANCE</property>
<property name="digits">2</property> <property name="digits">2</property>
</object> </object>
...@@ -204,10 +206,10 @@ ...@@ -204,10 +206,10 @@
<object class="GtkLabel" id="labelTXT_TEXT"> <object class="GtkLabel" id="labelTXT_TEXT">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes" context="dropcapspage|labelTXT_TEXT">_Text:</property> <property name="label" translatable="yes" context="dropcapspage|labelTXT_TEXT">_Text:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">entryEDT_TEXT</property> <property name="mnemonic_widget">entryEDT_TEXT</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -218,10 +220,10 @@ ...@@ -218,10 +220,10 @@
<object class="GtkLabel" id="labelTXT_TEMPLATE"> <object class="GtkLabel" id="labelTXT_TEMPLATE">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes" context="dropcapspage|labelTXT_TEMPLATE">Character st_yle:</property> <property name="label" translatable="yes" context="dropcapspage|labelTXT_TEMPLATE">Character st_yle:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">comboBOX_TEMPLATE</property> <property name="mnemonic_widget">comboBOX_TEMPLATE</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -233,6 +235,7 @@ ...@@ -233,6 +235,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="max_length">9</property> <property name="max_length">9</property>
<property name="activates_default">True</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
...@@ -240,7 +243,7 @@ ...@@ -240,7 +243,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkComboBox" id="comboBOX_TEMPLATE"> <object class="GtkComboBoxText" id="comboBOX_TEMPLATE">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
</object> </object>
...@@ -283,7 +286,20 @@ ...@@ -283,7 +286,20 @@
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="top_padding">24</property> <property name="top_padding">24</property>
<child> <child>
<object class="swuilo-SwDropCapsPict" id="drawingareaWN_EXAMPLE"> <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">center</property>
<property name="valign">start</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkDrawingArea" id="drawingareaWN_EXAMPLE">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="halign">center</property> <property name="halign">center</property>
...@@ -291,6 +307,10 @@ ...@@ -291,6 +307,10 @@
</object> </object>
</child> </child>
</object> </object>
</child>
</object>
</child>
</object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
...@@ -312,7 +332,7 @@ ...@@ -312,7 +332,7 @@
<widgets> <widgets>
<widget name="spinFLD_DROPCAPS"/> <widget name="spinFLD_DROPCAPS"/>
<widget name="spinFLD_LINES"/> <widget name="spinFLD_LINES"/>
<widget name="spinFLD_DISTANCE:0cm"/> <widget name="spinFLD_DISTANCE"/>
</widgets> </widgets>
</object> </object>
</interface> </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