weld conditional formatting
Change-Id: Ia9c99a17d5a95d67a412cfde959192c99caa70be Reviewed-on: https://gerrit.libreoffice.org/71956 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -713,11 +713,11 @@ void ErrorBarResources::isRangeFieldContentValid(weld::Entry& rEdit)
|
||||
|
||||
if( bIsValid || !rEdit.get_sensitive())
|
||||
{
|
||||
rEdit.set_error(false);
|
||||
rEdit.set_message_type(weld::EntryMessageType::Normal);
|
||||
}
|
||||
else
|
||||
{
|
||||
rEdit.set_error(true);
|
||||
rEdit.set_message_type(weld::EntryMessageType::Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ bool DataSourceTabPage::isRangeFieldContentValid(weld::Entry& rEdit )
|
||||
OUString aRange(rEdit.get_text());
|
||||
bool bIsValid = aRange.isEmpty() ||
|
||||
m_rDialogModel.getRangeSelectionHelper()->verifyCellRange(aRange);
|
||||
rEdit.set_error(!bIsValid);
|
||||
rEdit.set_message_type(bIsValid ? weld::EntryMessageType::Normal : weld::EntryMessageType::Error);
|
||||
return bIsValid;
|
||||
}
|
||||
|
||||
|
||||
@@ -279,16 +279,14 @@ bool RangeChooserTabPage::isValid()
|
||||
|
||||
if( bIsValid )
|
||||
{
|
||||
m_xED_Range->set_error(false);
|
||||
m_xED_Range->set_error(false);
|
||||
m_xED_Range->set_message_type(weld::EntryMessageType::Normal);
|
||||
if( m_pTabPageNotifiable )
|
||||
m_pTabPageNotifiable->setValidPage( this );
|
||||
m_aLastValidRangeString = aRange;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_xED_Range->set_error(true);
|
||||
m_xED_Range->set_error(true);
|
||||
m_xED_Range->set_message_type(weld::EntryMessageType::Error);
|
||||
if( m_pTabPageNotifiable )
|
||||
m_pTabPageNotifiable->setInvalidPage( this );
|
||||
}
|
||||
|
||||
@@ -277,14 +277,6 @@
|
||||
generic-name="LanguageBox" parent="VclComboBoxText"
|
||||
icon-name="widget-gtk-combobox"/>
|
||||
|
||||
<glade-widget-class title="Reference Button" name="foruilo-RefButton"
|
||||
generic-name="Reference Button" parent="GtkButton"
|
||||
icon-name="widget-gtk-button"/>
|
||||
|
||||
<glade-widget-class title="Reference Edit" name="foruilo-RefEdit"
|
||||
generic-name="Reference Edit" parent="GtkEntry"
|
||||
icon-name="widget-gtk-textentry"/>
|
||||
|
||||
<glade-widget-class title="URL Entry" name="cuilo-SvxHyperURLBox"
|
||||
generic-name="URL Entry" parent="GtkEntry"
|
||||
icon-name="widget-gtk-textentry"/>
|
||||
@@ -358,10 +350,6 @@
|
||||
generic-name="ClientBox" parent="GtkDrawingArea"
|
||||
icon-name="widget-gtk-drawingarea"/>
|
||||
|
||||
<glade-widget-class title="ScCondFormatList" name="sclo-ScCondFormatList"
|
||||
generic-name="CondFormatList" parent="GtkDrawingArea"
|
||||
icon-name="widget-gtk-drawingarea"/>
|
||||
|
||||
<glade-widget-class title="IndexFieldsControl" name="dbulo-DbaIndexFieldsControl"
|
||||
generic-name="IndexFieldsControl" parent="GtkTreeView"
|
||||
icon-name="widget-gtk-treeview"/>
|
||||
|
||||
@@ -401,7 +401,7 @@ void WeldRefEdit::SetRefString( const OUString& rStr )
|
||||
|
||||
void WeldRefEdit::SetRefValid(bool bValid)
|
||||
{
|
||||
xEntry->set_error(!bValid);
|
||||
xEntry->set_message_type(bValid ? weld::EntryMessageType::Normal : weld::EntryMessageType::Error);
|
||||
}
|
||||
|
||||
void WeldRefEdit::SetText(const OUString& rStr)
|
||||
|
||||
+17
-4
@@ -232,6 +232,9 @@ public:
|
||||
|
||||
virtual VclPtr<VirtualDevice> create_virtual_device() const = 0;
|
||||
|
||||
//make this widget look like a page in a notebook
|
||||
virtual void set_stack_background() = 0;
|
||||
|
||||
virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() = 0;
|
||||
|
||||
virtual ~Widget() {}
|
||||
@@ -448,6 +451,13 @@ struct VCL_DLLPUBLIC ComboBoxEntry
|
||||
}
|
||||
};
|
||||
|
||||
enum class EntryMessageType
|
||||
{
|
||||
Normal,
|
||||
Warning,
|
||||
Error,
|
||||
};
|
||||
|
||||
class VCL_DLLPUBLIC ComboBox : virtual public Container
|
||||
{
|
||||
private:
|
||||
@@ -520,7 +530,7 @@ public:
|
||||
|
||||
//entry related
|
||||
virtual bool has_entry() const = 0;
|
||||
virtual void set_entry_error(bool bError) = 0;
|
||||
virtual void set_entry_message_type(EntryMessageType eType) = 0;
|
||||
virtual void set_entry_text(const OUString& rStr) = 0;
|
||||
virtual void set_entry_width_chars(int nChars) = 0;
|
||||
virtual void set_entry_max_length(int nChars) = 0;
|
||||
@@ -1036,7 +1046,7 @@ public:
|
||||
virtual int get_position() const = 0;
|
||||
virtual void set_editable(bool bEditable) = 0;
|
||||
virtual bool get_editable() const = 0;
|
||||
virtual void set_error(bool bShowError) = 0;
|
||||
virtual void set_message_type(EntryMessageType eType) = 0;
|
||||
|
||||
// font size is in points, not pixels, e.g. see Window::[G]etPointFont
|
||||
virtual void set_font(const vcl::Font& rFont) = 0;
|
||||
@@ -1250,7 +1260,10 @@ public:
|
||||
|
||||
//entry related
|
||||
virtual bool has_entry() const override { return true; }
|
||||
virtual void set_entry_error(bool bError) override { m_xEntry->set_error(bError); }
|
||||
virtual void set_entry_message_type(EntryMessageType eType) override
|
||||
{
|
||||
m_xEntry->set_message_type(eType);
|
||||
}
|
||||
virtual void set_entry_text(const OUString& rStr) override { m_xEntry->set_text(rStr); }
|
||||
virtual void set_entry_width_chars(int nChars) override { m_xEntry->set_width_chars(nChars); }
|
||||
virtual void set_entry_max_length(int nChars) override { m_xEntry->set_max_length(nChars); }
|
||||
@@ -1502,7 +1515,7 @@ public:
|
||||
virtual void set_label(const OUString& rText) = 0;
|
||||
virtual OUString get_label() const = 0;
|
||||
virtual void set_mnemonic_widget(Widget* pTarget) = 0;
|
||||
virtual void set_error(bool bShowError) = 0;
|
||||
virtual void set_message_type(EntryMessageType eType) = 0;
|
||||
// font size is in points, not pixels, e.g. see Window::[G]etPointFont
|
||||
virtual void set_font(const vcl::Font& rFont) = 0;
|
||||
};
|
||||
|
||||
@@ -381,6 +381,7 @@ public:
|
||||
static const ScIconSetMap g_IconSetMap[];
|
||||
static const char* getIconSetName( ScIconSetType eType );
|
||||
static sal_Int32 getIconSetElements( ScIconSetType eType );
|
||||
static OUString getIconName(ScIconSetType eType, sal_Int32 nIndex);
|
||||
static BitmapEx& getBitmap(sc::IconSetBitmapMap& rBitmapMap, ScIconSetType eType, sal_Int32 nIndex);
|
||||
|
||||
typedef ScIconSetFormatData::Entries_t::iterator iterator;
|
||||
|
||||
@@ -1383,8 +1383,7 @@ sal_Int32 ScIconSetFormat::getIconSetElements( ScIconSetType eType )
|
||||
return 0;
|
||||
}
|
||||
|
||||
BitmapEx& ScIconSetFormat::getBitmap(sc::IconSetBitmapMap & rIconSetBitmapMap,
|
||||
ScIconSetType const eType, sal_Int32 const nIndex)
|
||||
OUString ScIconSetFormat::getIconName(ScIconSetType const eType, sal_Int32 const nIndex)
|
||||
{
|
||||
OUString sBitmap;
|
||||
|
||||
@@ -1399,6 +1398,14 @@ BitmapEx& ScIconSetFormat::getBitmap(sc::IconSetBitmapMap & rIconSetBitmapMap,
|
||||
|
||||
assert(!sBitmap.isEmpty());
|
||||
|
||||
return sBitmap;
|
||||
}
|
||||
|
||||
BitmapEx& ScIconSetFormat::getBitmap(sc::IconSetBitmapMap & rIconSetBitmapMap,
|
||||
ScIconSetType const eType, sal_Int32 const nIndex)
|
||||
{
|
||||
OUString sBitmap(ScIconSetFormat::getIconName(eType, nIndex));
|
||||
|
||||
std::map<OUString, BitmapEx>::iterator itr = rIconSetBitmapMap.find(sBitmap);
|
||||
if (itr != rIconSetBitmapMap.end())
|
||||
return itr->second;
|
||||
|
||||
@@ -25,42 +25,35 @@
|
||||
#include <condformatdlgentry.hxx>
|
||||
#include <condformatdlgitem.hxx>
|
||||
|
||||
ScCondFormatList::ScCondFormatList(vcl::Window* pParent, WinBits nStyle)
|
||||
: Control(pParent, nStyle | WB_DIALOGCONTROL)
|
||||
, mbHasScrollBar(false)
|
||||
ScCondFormatList::ScCondFormatList(ScCondFormatDlg* pDialogParent,
|
||||
std::unique_ptr<weld::ScrolledWindow> xWindow,
|
||||
std::unique_ptr<weld::Container> xGrid)
|
||||
: mxScrollWindow(std::move(xWindow))
|
||||
, mxGrid(std::move(xGrid))
|
||||
, mbFrozen(false)
|
||||
, mbNewEntry(false)
|
||||
, mpScrollBar(VclPtr<ScrollBar>::Create(this, WB_VERT ))
|
||||
, mpDoc(nullptr)
|
||||
, mpDialogParent(nullptr)
|
||||
, mpDialogParent(pDialogParent)
|
||||
{
|
||||
mpScrollBar->SetScrollHdl( LINK( this, ScCondFormatList, ScrollHdl ) );
|
||||
mpScrollBar->EnableDrag();
|
||||
SetControlBackground( GetSettings().GetStyleSettings().GetWindowColor() );
|
||||
SetBackground(GetControlBackground());
|
||||
mxScrollWindow->set_size_request(mxScrollWindow->get_approximate_digit_width() * 85,
|
||||
mxScrollWindow->get_text_height() * 23);
|
||||
mxGrid->set_stack_background();
|
||||
}
|
||||
|
||||
weld::Window* ScCondFormatList::GetFrameWeld()
|
||||
{
|
||||
return mpDialogParent->getDialog();
|
||||
}
|
||||
|
||||
ScCondFormatList::~ScCondFormatList()
|
||||
{
|
||||
disposeOnce();
|
||||
}
|
||||
|
||||
void ScCondFormatList::dispose()
|
||||
{
|
||||
Freeze();
|
||||
mpDialogParent.clear();
|
||||
mpScrollBar.disposeAndClear();
|
||||
for (auto& rxEntry : maEntries)
|
||||
rxEntry.disposeAndClear();
|
||||
maEntries.clear();
|
||||
Control::dispose();
|
||||
}
|
||||
|
||||
void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
|
||||
void ScCondFormatList::init(ScDocument* pDoc,
|
||||
const ScConditionalFormat* pFormat, const ScRangeList& rRanges,
|
||||
const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType)
|
||||
{
|
||||
mpDialogParent = pDialogParent;
|
||||
mpDoc = pDoc;
|
||||
maPos = rPos;
|
||||
maRanges = rRanges;
|
||||
@@ -80,9 +73,9 @@ void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
|
||||
{
|
||||
const ScCondFormatEntry* pConditionEntry = static_cast<const ScCondFormatEntry*>( pEntry );
|
||||
if(pConditionEntry->GetOperation() != ScConditionMode::Direct)
|
||||
maEntries.push_back(VclPtr<ScConditionFrmtEntry>::Create( this, mpDoc, pDialogParent, maPos, pConditionEntry ) );
|
||||
maEntries.emplace_back(new ScConditionFrmtEntry( this, mpDoc, mpDialogParent, maPos, pConditionEntry ) );
|
||||
else
|
||||
maEntries.push_back(VclPtr<ScFormulaFrmtEntry>::Create( this, mpDoc, pDialogParent, maPos, pConditionEntry ) );
|
||||
maEntries.emplace_back(new ScFormulaFrmtEntry( this, mpDoc, mpDialogParent, maPos, pConditionEntry ) );
|
||||
|
||||
}
|
||||
break;
|
||||
@@ -90,19 +83,19 @@ void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
|
||||
{
|
||||
const ScColorScaleFormat* pColorScale = static_cast<const ScColorScaleFormat*>( pEntry );
|
||||
if( pColorScale->size() == 2 )
|
||||
maEntries.push_back(VclPtr<ScColorScale2FrmtEntry>::Create( this, mpDoc, maPos, pColorScale ) );
|
||||
maEntries.emplace_back(new ScColorScale2FrmtEntry( this, mpDoc, maPos, pColorScale ) );
|
||||
else
|
||||
maEntries.push_back(VclPtr<ScColorScale3FrmtEntry>::Create( this, mpDoc, maPos, pColorScale ) );
|
||||
maEntries.emplace_back(new ScColorScale3FrmtEntry( this, mpDoc, maPos, pColorScale ) );
|
||||
}
|
||||
break;
|
||||
case ScFormatEntry::Type::Databar:
|
||||
maEntries.push_back(VclPtr<ScDataBarFrmtEntry>::Create( this, mpDoc, maPos, static_cast<const ScDataBarFormat*>( pEntry ) ) );
|
||||
maEntries.emplace_back(new ScDataBarFrmtEntry( this, mpDoc, maPos, static_cast<const ScDataBarFormat*>( pEntry ) ) );
|
||||
break;
|
||||
case ScFormatEntry::Type::Iconset:
|
||||
maEntries.push_back(VclPtr<ScIconSetFrmtEntry>::Create( this, mpDoc, maPos, static_cast<const ScIconSetFormat*>( pEntry ) ) );
|
||||
maEntries.emplace_back(new ScIconSetFrmtEntry( this, mpDoc, maPos, static_cast<const ScIconSetFormat*>( pEntry ) ) );
|
||||
break;
|
||||
case ScFormatEntry::Type::Date:
|
||||
maEntries.push_back(VclPtr<ScDateFrmtEntry>::Create( this, mpDoc, static_cast<const ScCondDateFormatEntry*>( pEntry ) ) );
|
||||
maEntries.emplace_back(new ScDateFrmtEntry( this, mpDoc, static_cast<const ScCondDateFormatEntry*>( pEntry ) ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -114,19 +107,19 @@ void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
|
||||
switch(eType)
|
||||
{
|
||||
case condformat::dialog::CONDITION:
|
||||
maEntries.push_back(VclPtr<ScConditionFrmtEntry>::Create( this, mpDoc, pDialogParent, maPos ));
|
||||
maEntries.emplace_back(new ScConditionFrmtEntry( this, mpDoc, mpDialogParent, maPos ));
|
||||
break;
|
||||
case condformat::dialog::COLORSCALE:
|
||||
maEntries.push_back(VclPtr<ScColorScale3FrmtEntry>::Create( this, mpDoc, maPos ));
|
||||
maEntries.emplace_back(new ScColorScale3FrmtEntry( this, mpDoc, maPos ));
|
||||
break;
|
||||
case condformat::dialog::DATABAR:
|
||||
maEntries.push_back(VclPtr<ScDataBarFrmtEntry>::Create( this, mpDoc, maPos ));
|
||||
maEntries.emplace_back(new ScDataBarFrmtEntry( this, mpDoc, maPos ));
|
||||
break;
|
||||
case condformat::dialog::ICONSET:
|
||||
maEntries.push_back(VclPtr<ScIconSetFrmtEntry>::Create( this, mpDoc, maPos ));
|
||||
maEntries.emplace_back(new ScIconSetFrmtEntry( this, mpDoc, maPos ));
|
||||
break;
|
||||
case condformat::dialog::DATE:
|
||||
maEntries.push_back(VclPtr<ScDateFrmtEntry>::Create( this, mpDoc ));
|
||||
maEntries.emplace_back(new ScDateFrmtEntry( this, mpDoc ));
|
||||
break;
|
||||
case condformat::dialog::NONE:
|
||||
break;
|
||||
@@ -149,27 +142,6 @@ void ScCondFormatList::SetRange(const ScRangeList& rRange)
|
||||
maRanges = rRange;
|
||||
}
|
||||
|
||||
VCL_BUILDER_FACTORY_CONSTRUCTOR(ScCondFormatList, 0)
|
||||
|
||||
Size ScCondFormatList::GetOptimalSize() const
|
||||
{
|
||||
return LogicToPixel(Size(300, 185), MapMode(MapUnit::MapAppFont));
|
||||
}
|
||||
|
||||
void ScCondFormatList::Resize()
|
||||
{
|
||||
Control::Resize();
|
||||
RecalcAll();
|
||||
}
|
||||
|
||||
void ScCondFormatList::queue_resize(StateChangedType eReason)
|
||||
{
|
||||
Control::queue_resize(eReason);
|
||||
if (!mpDialogParent) //detects that this is during dispose
|
||||
return;
|
||||
RecalcAll();
|
||||
}
|
||||
|
||||
std::unique_ptr<ScConditionalFormat> ScCondFormatList::GetConditionalFormat() const
|
||||
{
|
||||
if(maEntries.empty())
|
||||
@@ -204,68 +176,31 @@ void ScCondFormatList::RecalcAll()
|
||||
if (mbFrozen)
|
||||
return;
|
||||
|
||||
sal_Int32 nTotalHeight = 0;
|
||||
sal_Int32 nIndex = 1;
|
||||
for (const auto& item : maEntries)
|
||||
{
|
||||
if (!item)
|
||||
continue;
|
||||
nTotalHeight += item->GetSizePixel().Height();
|
||||
item->SetIndex(nIndex);
|
||||
item->set_grid_top_attach(nIndex - 1);
|
||||
++nIndex;
|
||||
}
|
||||
|
||||
Size aCtrlSize = GetOutputSize();
|
||||
long nSrcBarSize = GetSettings().GetStyleSettings().GetScrollBarSize();
|
||||
if(nTotalHeight > GetSizePixel().Height())
|
||||
{
|
||||
mbHasScrollBar = true;
|
||||
mpScrollBar->SetPosSizePixel(Point(aCtrlSize.Width() -nSrcBarSize, 0),
|
||||
Size(nSrcBarSize, aCtrlSize.Height()) );
|
||||
mpScrollBar->SetRangeMax(nTotalHeight);
|
||||
mpScrollBar->SetVisibleSize(aCtrlSize.Height());
|
||||
mpScrollBar->Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
mbHasScrollBar = false;
|
||||
mpScrollBar->Hide();
|
||||
}
|
||||
|
||||
Point aPoint(0,-1*mpScrollBar->GetThumbPos());
|
||||
for (const auto& item : maEntries)
|
||||
{
|
||||
if (!item)
|
||||
continue;
|
||||
item->SetPosPixel(aPoint);
|
||||
Size aSize = item->GetSizePixel();
|
||||
if(mbHasScrollBar)
|
||||
aSize.setWidth( aCtrlSize.Width() - nSrcBarSize );
|
||||
else
|
||||
aSize.setWidth( aCtrlSize.Width() );
|
||||
item->SetSizePixel(aSize);
|
||||
|
||||
aPoint.AdjustY(item->GetSizePixel().Height() );
|
||||
}
|
||||
}
|
||||
|
||||
void ScCondFormatList::DoScroll(long nDelta)
|
||||
IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, weld::ComboBox&, rBox, void)
|
||||
{
|
||||
Point aNewPoint = mpScrollBar->GetPosPixel();
|
||||
tools::Rectangle aRect(Point(), GetOutputSize());
|
||||
aRect.AdjustRight( -(mpScrollBar->GetSizePixel().Width()) );
|
||||
Scroll( 0, -nDelta, aRect );
|
||||
mpScrollBar->SetPosPixel(aNewPoint);
|
||||
Application::PostUserEvent(LINK(this, ScCondFormatList, AfterColFormatTypeHdl), &rBox);
|
||||
}
|
||||
|
||||
IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox&, rBox, void)
|
||||
IMPL_LINK(ScCondFormatList, AfterColFormatTypeHdl, void*, p, void)
|
||||
{
|
||||
weld::ComboBox* pBox = static_cast<weld::ComboBox*>(p);
|
||||
EntryContainer::iterator itr = std::find_if(maEntries.begin(), maEntries.end(),
|
||||
[](const VclPtr<ScCondFrmtEntry>& widget) { return widget->IsSelected(); });
|
||||
[](const std::unique_ptr<ScCondFrmtEntry>& widget) { return widget->IsSelected(); });
|
||||
if(itr == maEntries.end())
|
||||
return;
|
||||
|
||||
sal_Int32 nPos = rBox.GetSelectedEntryPos();
|
||||
sal_Int32 nPos = pBox->get_active();
|
||||
switch(nPos)
|
||||
{
|
||||
case 0:
|
||||
@@ -273,32 +208,28 @@ IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox&, rBox, void)
|
||||
return;
|
||||
|
||||
Freeze();
|
||||
itr->disposeAndClear();
|
||||
*itr = VclPtr<ScColorScale2FrmtEntry>::Create( this, mpDoc, maPos );
|
||||
itr->reset(new ScColorScale2FrmtEntry(this, mpDoc, maPos));
|
||||
break;
|
||||
case 1:
|
||||
if((*itr)->GetType() == condformat::entry::COLORSCALE3)
|
||||
return;
|
||||
|
||||
Freeze();
|
||||
itr->disposeAndClear();
|
||||
*itr = VclPtr<ScColorScale3FrmtEntry>::Create( this, mpDoc, maPos );
|
||||
itr->reset(new ScColorScale3FrmtEntry(this, mpDoc, maPos));
|
||||
break;
|
||||
case 2:
|
||||
if((*itr)->GetType() == condformat::entry::DATABAR)
|
||||
return;
|
||||
|
||||
Freeze();
|
||||
itr->disposeAndClear();
|
||||
*itr = VclPtr<ScDataBarFrmtEntry>::Create( this, mpDoc, maPos );
|
||||
itr->reset(new ScDataBarFrmtEntry(this, mpDoc, maPos));
|
||||
break;
|
||||
case 3:
|
||||
if((*itr)->GetType() == condformat::entry::ICONSET)
|
||||
return;
|
||||
|
||||
Freeze();
|
||||
itr->disposeAndClear();
|
||||
*itr = VclPtr<ScIconSetFrmtEntry>::Create( this, mpDoc, maPos );
|
||||
itr->reset(new ScIconSetFrmtEntry(this, mpDoc, maPos));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -309,24 +240,24 @@ IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox&, rBox, void)
|
||||
RecalcAll();
|
||||
}
|
||||
|
||||
IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox&, rBox, void)
|
||||
IMPL_LINK(ScCondFormatList, TypeListHdl, weld::ComboBox&, rBox, void)
|
||||
{
|
||||
//Resolves: fdo#79021 At this point we are still inside the ListBox Select.
|
||||
//If we call maEntries.replace here then the pBox will be deleted before it
|
||||
//has finished Select and will crash on accessing its deleted this. So Post
|
||||
//to do the real work after the Select has completed
|
||||
Application::PostUserEvent(LINK(this, ScCondFormatList, AfterTypeListHdl), &rBox, true);
|
||||
Application::PostUserEvent(LINK(this, ScCondFormatList, AfterTypeListHdl), &rBox);
|
||||
}
|
||||
|
||||
IMPL_LINK(ScCondFormatList, AfterTypeListHdl, void*, p, void)
|
||||
{
|
||||
ListBox* pBox = static_cast<ListBox*>(p);
|
||||
weld::ComboBox* pBox = static_cast<weld::ComboBox*>(p);
|
||||
EntryContainer::iterator itr = std::find_if(maEntries.begin(), maEntries.end(),
|
||||
[](const VclPtr<ScCondFrmtEntry>& widget) { return widget->IsSelected(); });
|
||||
[](const std::unique_ptr<ScCondFrmtEntry>& widget) { return widget->IsSelected(); });
|
||||
if(itr == maEntries.end())
|
||||
return;
|
||||
|
||||
sal_Int32 nPos = pBox->GetSelectedEntryPos();
|
||||
sal_Int32 nPos = pBox->get_active();
|
||||
switch(nPos)
|
||||
{
|
||||
case 0:
|
||||
@@ -343,8 +274,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, void*, p, void)
|
||||
return;
|
||||
}
|
||||
Freeze();
|
||||
itr->disposeAndClear();
|
||||
*itr = VclPtr<ScColorScale3FrmtEntry>::Create(this, mpDoc, maPos);
|
||||
itr->reset(new ScColorScale3FrmtEntry(this, mpDoc, maPos));
|
||||
mpDialogParent->InvalidateRefData();
|
||||
(*itr)->SetActive();
|
||||
break;
|
||||
@@ -353,8 +283,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, void*, p, void)
|
||||
return;
|
||||
|
||||
Freeze();
|
||||
itr->disposeAndClear();
|
||||
*itr = VclPtr<ScConditionFrmtEntry>::Create(this, mpDoc, mpDialogParent, maPos);
|
||||
itr->reset(new ScConditionFrmtEntry(this, mpDoc, mpDialogParent, maPos));
|
||||
mpDialogParent->InvalidateRefData();
|
||||
(*itr)->SetActive();
|
||||
break;
|
||||
@@ -363,8 +292,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, void*, p, void)
|
||||
return;
|
||||
|
||||
Freeze();
|
||||
itr->disposeAndClear();
|
||||
*itr = VclPtr<ScFormulaFrmtEntry>::Create(this, mpDoc, mpDialogParent, maPos);
|
||||
itr->reset(new ScFormulaFrmtEntry(this, mpDoc, mpDialogParent, maPos));
|
||||
mpDialogParent->InvalidateRefData();
|
||||
(*itr)->SetActive();
|
||||
break;
|
||||
@@ -373,8 +301,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, void*, p, void)
|
||||
return;
|
||||
|
||||
Freeze();
|
||||
itr->disposeAndClear();
|
||||
*itr = VclPtr<ScDateFrmtEntry>::Create( this, mpDoc );
|
||||
itr->reset(new ScDateFrmtEntry( this, mpDoc ));
|
||||
mpDialogParent->InvalidateRefData();
|
||||
(*itr)->SetActive();
|
||||
break;
|
||||
@@ -384,30 +311,28 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, void*, p, void)
|
||||
RecalcAll();
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl, Button*, void )
|
||||
IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl, weld::Button&, void )
|
||||
{
|
||||
Freeze();
|
||||
VclPtr<ScCondFrmtEntry> pNewEntry = VclPtr<ScConditionFrmtEntry>::Create(this, mpDoc, mpDialogParent, maPos);
|
||||
maEntries.push_back( pNewEntry );
|
||||
maEntries.emplace_back(new ScConditionFrmtEntry(this, mpDoc, mpDialogParent, maPos));
|
||||
for(auto& rxEntry : maEntries)
|
||||
{
|
||||
rxEntry->SetInactive();
|
||||
}
|
||||
mpDialogParent->InvalidateRefData();
|
||||
pNewEntry->SetActive();
|
||||
maEntries.back()->SetActive();
|
||||
mpDialogParent->OnSelectionChange(maEntries.size() - 1, maEntries.size());
|
||||
Thaw();
|
||||
RecalcAll();
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG( ScCondFormatList, RemoveBtnHdl, Button*, void )
|
||||
IMPL_LINK_NOARG( ScCondFormatList, RemoveBtnHdl, weld::Button&, void )
|
||||
{
|
||||
Freeze();
|
||||
auto itr = std::find_if(maEntries.begin(), maEntries.end(),
|
||||
[](const VclPtr<ScCondFrmtEntry>& widget) { return widget->IsSelected(); });
|
||||
[](const std::unique_ptr<ScCondFrmtEntry>& widget) { return widget->IsSelected(); });
|
||||
if (itr != maEntries.end())
|
||||
{
|
||||
itr->disposeAndClear();
|
||||
maEntries.erase(itr);
|
||||
}
|
||||
mpDialogParent->InvalidateRefData();
|
||||
@@ -416,13 +341,13 @@ IMPL_LINK_NOARG( ScCondFormatList, RemoveBtnHdl, Button*, void )
|
||||
RecalcAll();
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG(ScCondFormatList, UpBtnHdl, Button*, void)
|
||||
IMPL_LINK_NOARG(ScCondFormatList, UpBtnHdl, weld::Button&, void)
|
||||
{
|
||||
Freeze();
|
||||
size_t index = 0;
|
||||
for (size_t i = 0; i < maEntries.size(); i++)
|
||||
{
|
||||
auto widget = maEntries[i];
|
||||
auto& widget = maEntries[i];
|
||||
if (widget->IsSelected() && i > 0)
|
||||
{
|
||||
std::swap(maEntries[i], maEntries[i - 1]);
|
||||
@@ -436,13 +361,13 @@ IMPL_LINK_NOARG(ScCondFormatList, UpBtnHdl, Button*, void)
|
||||
RecalcAll();
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG(ScCondFormatList, DownBtnHdl, Button*, void)
|
||||
IMPL_LINK_NOARG(ScCondFormatList, DownBtnHdl, weld::Button&, void)
|
||||
{
|
||||
Freeze();
|
||||
size_t index = 0;
|
||||
for (size_t i = 0; i < maEntries.size(); i++)
|
||||
{
|
||||
auto widget = maEntries[i];
|
||||
auto& widget = maEntries[i];
|
||||
if (widget->IsSelected())
|
||||
{
|
||||
index = i;
|
||||
@@ -466,13 +391,10 @@ IMPL_LINK( ScCondFormatList, EntrySelectHdl, ScCondFrmtEntry&, rEntry, void )
|
||||
return;
|
||||
|
||||
Freeze();
|
||||
//A child has focus, but we will hide that, so regrab to whatever new thing gets
|
||||
//shown instead of leaving it stuck in the inaccessible hidden element
|
||||
bool bReGrabFocus = HasChildPathFocus();
|
||||
size_t index = 0;
|
||||
for(size_t i = 0; i < maEntries.size(); i++)
|
||||
{
|
||||
if (maEntries[i] == &rEntry)
|
||||
if (maEntries[i].get() == &rEntry)
|
||||
{
|
||||
index = i;
|
||||
}
|
||||
@@ -483,37 +405,31 @@ IMPL_LINK( ScCondFormatList, EntrySelectHdl, ScCondFrmtEntry&, rEntry, void )
|
||||
rEntry.SetActive();
|
||||
Thaw();
|
||||
RecalcAll();
|
||||
if (bReGrabFocus)
|
||||
GrabFocus();
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG( ScCondFormatList, ScrollHdl, ScrollBar*, void )
|
||||
{
|
||||
DoScroll(mpScrollBar->GetDelta());
|
||||
}
|
||||
|
||||
ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW,
|
||||
vcl::Window* pParent, ScViewData* pViewData,
|
||||
weld::Window* pParent, ScViewData* pViewData,
|
||||
const ScCondFormatDlgItem* pItem)
|
||||
: ScAnyRefDlg(pB, pCW, pParent, "ConditionalFormatDialog",
|
||||
"modules/scalc/ui/conditionalformatdialog.ui")
|
||||
: ScAnyRefDlgController(pB, pCW, pParent,
|
||||
"modules/scalc/ui/conditionalformatdialog.ui",
|
||||
"ConditionalFormatDialog")
|
||||
, mpViewData(pViewData)
|
||||
, mpLastEdit(nullptr)
|
||||
, mpDlgItem(static_cast<ScCondFormatDlgItem*>(pItem->Clone()))
|
||||
, mpLastEdit(nullptr)
|
||||
, mxBtnOk(m_xBuilder->weld_button("ok"))
|
||||
, mxBtnAdd(m_xBuilder->weld_button("add"))
|
||||
, mxBtnRemove(m_xBuilder->weld_button("delete"))
|
||||
, mxBtnUp(m_xBuilder->weld_button("up"))
|
||||
, mxBtnDown(m_xBuilder->weld_button("down"))
|
||||
, mxBtnCancel(m_xBuilder->weld_button("cancel"))
|
||||
, mxFtRange(m_xBuilder->weld_label("ftassign"))
|
||||
, mxEdRange(new formula::WeldRefEdit(m_xBuilder->weld_entry("edassign")))
|
||||
, mxRbRange(new formula::WeldRefButton(m_xBuilder->weld_button("rbassign")))
|
||||
, mxCondFormList(new ScCondFormatList(this, m_xBuilder->weld_scrolled_window("listwindow"),
|
||||
m_xBuilder->weld_container("list")))
|
||||
{
|
||||
get(mpBtnOk, "ok");
|
||||
get(mpBtnAdd, "add");
|
||||
get(mpBtnUp, "up");
|
||||
get(mpBtnDown, "down");
|
||||
get(mpBtnRemove, "delete");
|
||||
get(mpBtnCancel, "cancel");
|
||||
|
||||
get(mpFtRange, "ftassign");
|
||||
get(mpEdRange, "edassign");
|
||||
mpEdRange->SetReferences(this, mpFtRange);
|
||||
|
||||
get(mpRbRange, "rbassign");
|
||||
mpRbRange->SetReferences(this, mpEdRange);
|
||||
mxEdRange->SetReferences(this, mxFtRange.get());
|
||||
mxRbRange->SetReferences(this, mxEdRange.get());
|
||||
|
||||
ScConditionalFormat* pFormat = nullptr;
|
||||
mnKey = mpDlgItem->GetIndex();
|
||||
@@ -545,58 +461,35 @@ ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW,
|
||||
}
|
||||
maPos = aRange.GetTopLeftCorner();
|
||||
|
||||
get(mpCondFormList, "list");
|
||||
mpCondFormList->init(mpViewData->GetDocument(), this, pFormat, aRange, maPos, mpDlgItem->GetDialogType());
|
||||
mxCondFormList->init(mpViewData->GetDocument(), pFormat, aRange, maPos, mpDlgItem->GetDialogType());
|
||||
|
||||
// tdf#114603: enable setting the background to a different color;
|
||||
// relevant for GTK; see also #i75179#
|
||||
mpEdRange->SetForceControlBackground(true);
|
||||
|
||||
mpBtnOk->SetClickHdl(LINK(this, ScCondFormatDlg, BtnPressedHdl ) );
|
||||
mpBtnAdd->SetClickHdl( LINK( mpCondFormList, ScCondFormatList, AddBtnHdl ) );
|
||||
mpBtnRemove->SetClickHdl( LINK( mpCondFormList, ScCondFormatList, RemoveBtnHdl ) );
|
||||
mpBtnUp->SetClickHdl(LINK(mpCondFormList, ScCondFormatList, UpBtnHdl));
|
||||
mpBtnDown->SetClickHdl(LINK(mpCondFormList, ScCondFormatList, DownBtnHdl));
|
||||
mpBtnCancel->SetClickHdl( LINK(this, ScCondFormatDlg, BtnPressedHdl ) );
|
||||
mpEdRange->SetModifyHdl( LINK( this, ScCondFormatDlg, EdRangeModifyHdl ) );
|
||||
mpEdRange->SetGetFocusHdl( LINK( this, ScCondFormatDlg, RangeGetFocusHdl ) );
|
||||
mxBtnOk->connect_clicked(LINK(this, ScCondFormatDlg, BtnPressedHdl ) );
|
||||
mxBtnAdd->connect_clicked( LINK( mxCondFormList.get(), ScCondFormatList, AddBtnHdl ) );
|
||||
mxBtnRemove->connect_clicked( LINK( mxCondFormList.get(), ScCondFormatList, RemoveBtnHdl ) );
|
||||
mxBtnUp->connect_clicked(LINK(mxCondFormList.get(), ScCondFormatList, UpBtnHdl));
|
||||
mxBtnDown->connect_clicked(LINK(mxCondFormList.get(), ScCondFormatList, DownBtnHdl));
|
||||
mxBtnCancel->connect_clicked( LINK(this, ScCondFormatDlg, BtnPressedHdl ) );
|
||||
mxEdRange->SetModifyHdl( LINK( this, ScCondFormatDlg, EdRangeModifyHdl ) );
|
||||
mxEdRange->SetGetFocusHdl( LINK( this, ScCondFormatDlg, RangeGetFocusHdl ) );
|
||||
|
||||
OUString aRangeString;
|
||||
aRange.Format(aRangeString, ScRefFlags::VALID, pViewData->GetDocument(),
|
||||
pViewData->GetDocument()->GetAddressConvention());
|
||||
mpEdRange->SetText(aRangeString);
|
||||
mxEdRange->SetText(aRangeString);
|
||||
|
||||
msBaseTitle = GetText();
|
||||
msBaseTitle = m_xDialog->get_title();
|
||||
updateTitle();
|
||||
}
|
||||
|
||||
void ScCondFormatDlg::updateTitle()
|
||||
{
|
||||
OUString aTitle = msBaseTitle + " " + mpEdRange->GetText();
|
||||
OUString aTitle = msBaseTitle + " " + mxEdRange->GetText();
|
||||
|
||||
SetText(aTitle);
|
||||
m_xDialog->set_title(aTitle);
|
||||
}
|
||||
|
||||
ScCondFormatDlg::~ScCondFormatDlg()
|
||||
{
|
||||
disposeOnce();
|
||||
}
|
||||
|
||||
void ScCondFormatDlg::dispose()
|
||||
{
|
||||
mpBtnOk.clear();
|
||||
mpBtnAdd.clear();
|
||||
mpBtnRemove.clear();
|
||||
mpBtnUp.clear();
|
||||
mpBtnDown.clear();
|
||||
mpBtnCancel.clear();
|
||||
mpFtRange.clear();
|
||||
mpEdRange.clear();
|
||||
mpRbRange.clear();
|
||||
mpCondFormList.clear();
|
||||
mpLastEdit.clear();
|
||||
|
||||
ScAnyRefDlg::dispose();
|
||||
}
|
||||
|
||||
void ScCondFormatDlg::SetActive()
|
||||
@@ -604,14 +497,14 @@ void ScCondFormatDlg::SetActive()
|
||||
if(mpLastEdit)
|
||||
mpLastEdit->GrabFocus();
|
||||
else
|
||||
mpEdRange->GrabFocus();
|
||||
mxEdRange->GrabFocus();
|
||||
|
||||
RefInputDone();
|
||||
}
|
||||
|
||||
void ScCondFormatDlg::RefInputDone( bool bForced )
|
||||
{
|
||||
ScAnyRefDlg::RefInputDone(bForced);
|
||||
ScAnyRefDlgController::RefInputDone(bForced);
|
||||
|
||||
// ScAnyRefModalDlg::RefInputDone resets the title back
|
||||
// to its original state.
|
||||
@@ -627,39 +520,39 @@ void ScCondFormatDlg::RefInputDone( bool bForced )
|
||||
|
||||
bool ScCondFormatDlg::IsTableLocked() const
|
||||
{
|
||||
return !mpLastEdit || mpLastEdit == mpEdRange;
|
||||
return !mpLastEdit || mpLastEdit == mxEdRange.get();
|
||||
}
|
||||
|
||||
bool ScCondFormatDlg::IsRefInputMode() const
|
||||
{
|
||||
return mpEdRange->IsEnabled();
|
||||
return mxEdRange->GetWidget()->get_sensitive();
|
||||
}
|
||||
|
||||
void ScCondFormatDlg::SetReference(const ScRange& rRef, ScDocument*)
|
||||
{
|
||||
formula::RefEdit* pEdit = mpLastEdit;
|
||||
formula::WeldRefEdit* pEdit = mpLastEdit;
|
||||
if (!mpLastEdit)
|
||||
pEdit = mpEdRange;
|
||||
pEdit = mxEdRange.get();
|
||||
|
||||
if( pEdit->IsEnabled() )
|
||||
if (pEdit->GetWidget()->get_sensitive())
|
||||
{
|
||||
if(rRef.aStart != rRef.aEnd)
|
||||
RefInputStart(pEdit);
|
||||
|
||||
ScRefFlags nFlags;
|
||||
if (mpLastEdit && mpLastEdit != mpEdRange)
|
||||
if (mpLastEdit && mpLastEdit != mxEdRange.get())
|
||||
nFlags = ScRefFlags::RANGE_ABS_3D;
|
||||
else
|
||||
nFlags = ScRefFlags::RANGE_ABS;
|
||||
|
||||
OUString aRefStr(rRef.Format(nFlags, mpViewData->GetDocument(),
|
||||
ScAddress::Details(mpViewData->GetDocument()->GetAddressConvention(), 0, 0)));
|
||||
if (pEdit != mpEdRange)
|
||||
if (pEdit != mxEdRange.get())
|
||||
{
|
||||
Selection sel = pEdit->GetSelection();
|
||||
sel.Justify(); // in case of RtL selection
|
||||
sel.Justify(); // in case of RTL selection
|
||||
sel.Max() = sel.Min() + aRefStr.getLength();
|
||||
pEdit->ReplaceSelected(aRefStr);
|
||||
pEdit->GetWidget()->replace_selection(aRefStr);
|
||||
pEdit->SetSelection(sel); // to replace it again with next drag event
|
||||
}
|
||||
else
|
||||
@@ -670,15 +563,15 @@ void ScCondFormatDlg::SetReference(const ScRange& rRef, ScDocument*)
|
||||
|
||||
std::unique_ptr<ScConditionalFormat> ScCondFormatDlg::GetConditionalFormat() const
|
||||
{
|
||||
OUString aRangeStr = mpEdRange->GetText();
|
||||
OUString aRangeStr = mxEdRange->GetText();
|
||||
if(aRangeStr.isEmpty())
|
||||
return nullptr;
|
||||
|
||||
ScRangeList aRange;
|
||||
ScRefFlags nFlags = aRange.Parse(aRangeStr, mpViewData->GetDocument(),
|
||||
mpViewData->GetDocument()->GetAddressConvention(), maPos.Tab());
|
||||
mpCondFormList->SetRange(aRange);
|
||||
std::unique_ptr<ScConditionalFormat> pFormat = mpCondFormList->GetConditionalFormat();
|
||||
mxCondFormList->SetRange(aRange);
|
||||
std::unique_ptr<ScConditionalFormat> pFormat = mxCondFormList->GetConditionalFormat();
|
||||
|
||||
if((nFlags & ScRefFlags::VALID) && !aRange.empty() && pFormat)
|
||||
pFormat->SetRange(aRange);
|
||||
@@ -695,9 +588,9 @@ void ScCondFormatDlg::InvalidateRefData()
|
||||
|
||||
// Close the Conditional Format Dialog
|
||||
//
|
||||
bool ScCondFormatDlg::Close()
|
||||
void ScCondFormatDlg::Close()
|
||||
{
|
||||
return DoClose( ScCondFormatDlgWrapper::GetChildWindowId() );
|
||||
DoClose( ScCondFormatDlgWrapper::GetChildWindowId() );
|
||||
}
|
||||
|
||||
// Occurs when the Conditional Format Dialog the OK button is pressed.
|
||||
@@ -740,7 +633,7 @@ void ScCondFormatDlg::OkPressed()
|
||||
GetBindings().GetDispatcher()->Execute( SID_OPENDLG_CONDFRMT_MANAGER,
|
||||
SfxCallMode::ASYNCHRON );
|
||||
}
|
||||
Close();
|
||||
m_xDialog->response(RET_OK);
|
||||
}
|
||||
|
||||
// Occurs when the Conditional Format Dialog is cancelled.
|
||||
@@ -755,24 +648,24 @@ void ScCondFormatDlg::CancelPressed()
|
||||
GetBindings().GetDispatcher()->Execute( SID_OPENDLG_CONDFRMT_MANAGER,
|
||||
SfxCallMode::ASYNCHRON );
|
||||
}
|
||||
Close();
|
||||
m_xDialog->response(RET_CANCEL);
|
||||
}
|
||||
|
||||
void ScCondFormatDlg::OnSelectionChange(size_t nIndex, size_t nSize, bool bSelected)
|
||||
{
|
||||
if (nSize <= 1 || !bSelected)
|
||||
{
|
||||
mpBtnUp->Enable(false);
|
||||
mpBtnDown->Enable(false);
|
||||
mxBtnUp->set_sensitive(false);
|
||||
mxBtnDown->set_sensitive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
mpBtnUp->Enable(nIndex != 0);
|
||||
mpBtnDown->Enable(nIndex < nSize - 1);
|
||||
mxBtnUp->set_sensitive(nIndex != 0);
|
||||
mxBtnDown->set_sensitive(nIndex < nSize - 1);
|
||||
}
|
||||
}
|
||||
|
||||
IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit&, rEdit, void )
|
||||
IMPL_LINK(ScCondFormatDlg, EdRangeModifyHdl, formula::WeldRefEdit&, rEdit, void)
|
||||
{
|
||||
OUString aRangeStr = rEdit.GetText();
|
||||
ScRangeList aRange;
|
||||
@@ -780,28 +673,28 @@ IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit&, rEdit, void )
|
||||
mpViewData->GetDocument()->GetAddressConvention());
|
||||
if(nFlags & ScRefFlags::VALID)
|
||||
{
|
||||
rEdit.SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor());
|
||||
mpBtnOk->Enable(true);
|
||||
rEdit.GetWidget()->set_message_type(weld::EntryMessageType::Normal);
|
||||
mxBtnOk->set_sensitive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
rEdit.SetControlBackground(COL_LIGHTRED);
|
||||
mpBtnOk->Enable(false);
|
||||
rEdit.GetWidget()->set_message_type(weld::EntryMessageType::Error);
|
||||
mxBtnOk->set_sensitive(false);
|
||||
}
|
||||
|
||||
updateTitle();
|
||||
}
|
||||
|
||||
IMPL_LINK( ScCondFormatDlg, RangeGetFocusHdl, Control&, rControl, void )
|
||||
IMPL_LINK(ScCondFormatDlg, RangeGetFocusHdl, formula::WeldRefEdit&, rControl, void)
|
||||
{
|
||||
mpLastEdit = static_cast<formula::RefEdit*>(&rControl);
|
||||
mpLastEdit = &rControl;
|
||||
}
|
||||
|
||||
IMPL_LINK( ScCondFormatDlg, BtnPressedHdl, Button*, pBtn, void)
|
||||
IMPL_LINK( ScCondFormatDlg, BtnPressedHdl, weld::Button&, rBtn, void)
|
||||
{
|
||||
if (pBtn == mpBtnOk)
|
||||
if (&rBtn == mxBtnOk.get())
|
||||
OkPressed();
|
||||
else if (pBtn == mpBtnCancel)
|
||||
else if (&rBtn == mxBtnCancel.get())
|
||||
CancelPressed();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,83 +31,82 @@ class ScViewData;
|
||||
|
||||
class ScCondFormatDlg;
|
||||
|
||||
class ScCondFormatList : public Control
|
||||
class ScCondFormatList
|
||||
{
|
||||
private:
|
||||
typedef std::vector<VclPtr<ScCondFrmtEntry>> EntryContainer;
|
||||
std::unique_ptr<weld::ScrolledWindow> mxScrollWindow;
|
||||
std::unique_ptr<weld::Container> mxGrid;
|
||||
|
||||
typedef std::vector<std::unique_ptr<ScCondFrmtEntry>> EntryContainer;
|
||||
EntryContainer maEntries;
|
||||
|
||||
bool mbHasScrollBar;
|
||||
bool mbFrozen;
|
||||
bool mbNewEntry;
|
||||
VclPtr<ScrollBar> mpScrollBar;
|
||||
|
||||
ScDocument* mpDoc;
|
||||
ScAddress maPos;
|
||||
ScRangeList maRanges;
|
||||
VclPtr<ScCondFormatDlg> mpDialogParent;
|
||||
|
||||
void DoScroll(long nDiff);
|
||||
ScCondFormatDlg* mpDialogParent;
|
||||
|
||||
public:
|
||||
ScCondFormatList(vcl::Window* pParent, WinBits nStyle);
|
||||
virtual ~ScCondFormatList() override;
|
||||
virtual void dispose() override;
|
||||
ScCondFormatList(ScCondFormatDlg* pParent,
|
||||
std::unique_ptr<weld::ScrolledWindow> xWindow,
|
||||
std::unique_ptr<weld::Container> xGrid);
|
||||
weld::ScrolledWindow* GetWidget() { return mxScrollWindow.get(); }
|
||||
weld::Container* GetContainer() { return mxGrid.get(); }
|
||||
~ScCondFormatList();
|
||||
|
||||
void init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent, const ScConditionalFormat* pFormat,
|
||||
void init(ScDocument* pDoc, const ScConditionalFormat* pFormat,
|
||||
const ScRangeList& rRanges, const ScAddress& rPos,
|
||||
condformat::dialog::ScCondFormatDialogType eType);
|
||||
|
||||
void SetRange(const ScRangeList& rRange);
|
||||
|
||||
virtual Size GetOptimalSize() const override;
|
||||
virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override;
|
||||
virtual void Resize() override;
|
||||
|
||||
std::unique_ptr<ScConditionalFormat> GetConditionalFormat() const;
|
||||
weld::Window* GetFrameWeld();
|
||||
void Freeze() { mbFrozen = true; }
|
||||
void Thaw() { mbFrozen = false; }
|
||||
void RecalcAll();
|
||||
|
||||
DECL_LINK( AddBtnHdl, Button*, void );
|
||||
DECL_LINK( RemoveBtnHdl, Button*, void );
|
||||
DECL_LINK( UpBtnHdl, Button*, void );
|
||||
DECL_LINK( DownBtnHdl, Button*, void );
|
||||
DECL_LINK( ScrollHdl, ScrollBar*, void );
|
||||
DECL_LINK( AddBtnHdl, weld::Button&, void );
|
||||
DECL_LINK( RemoveBtnHdl, weld::Button&, void );
|
||||
DECL_LINK( UpBtnHdl, weld::Button&, void );
|
||||
DECL_LINK( DownBtnHdl, weld::Button&, void );
|
||||
DECL_LINK( ScrollHdl, weld::ScrolledWindow&, void );
|
||||
DECL_LINK( EntrySelectHdl, ScCondFrmtEntry&, void );
|
||||
|
||||
DECL_LINK( TypeListHdl, ListBox&, void );
|
||||
DECL_LINK( TypeListHdl, weld::ComboBox&, void );
|
||||
DECL_LINK( AfterTypeListHdl, void*, void );
|
||||
DECL_LINK( ColFormatTypeHdl, ListBox&, void );
|
||||
DECL_LINK( ColFormatTypeHdl, weld::ComboBox&, void );
|
||||
DECL_LINK( AfterColFormatTypeHdl, void*, void );
|
||||
};
|
||||
|
||||
class ScCondFormatDlg : public ScAnyRefDlg
|
||||
class ScCondFormatDlg : public ScAnyRefDlgController
|
||||
{
|
||||
private:
|
||||
VclPtr<PushButton> mpBtnOk;
|
||||
VclPtr<PushButton> mpBtnAdd;
|
||||
VclPtr<PushButton> mpBtnRemove;
|
||||
VclPtr<PushButton> mpBtnUp;
|
||||
VclPtr<PushButton> mpBtnDown;
|
||||
VclPtr<PushButton> mpBtnCancel;
|
||||
VclPtr<FixedText> mpFtRange;
|
||||
VclPtr<formula::RefEdit> mpEdRange;
|
||||
VclPtr<formula::RefButton> mpRbRange;
|
||||
|
||||
VclPtr<ScCondFormatList> mpCondFormList;
|
||||
sal_Int32 mnKey;
|
||||
|
||||
ScAddress maPos;
|
||||
ScViewData* mpViewData;
|
||||
|
||||
VclPtr<formula::RefEdit> mpLastEdit;
|
||||
|
||||
std::shared_ptr<ScCondFormatDlgItem> mpDlgItem;
|
||||
|
||||
OUString msBaseTitle;
|
||||
void updateTitle();
|
||||
|
||||
DECL_LINK( EdRangeModifyHdl, Edit&, void );
|
||||
formula::WeldRefEdit* mpLastEdit;
|
||||
std::unique_ptr<weld::Button> mxBtnOk;
|
||||
std::unique_ptr<weld::Button> mxBtnAdd;
|
||||
std::unique_ptr<weld::Button> mxBtnRemove;
|
||||
std::unique_ptr<weld::Button> mxBtnUp;
|
||||
std::unique_ptr<weld::Button> mxBtnDown;
|
||||
std::unique_ptr<weld::Button> mxBtnCancel;
|
||||
std::unique_ptr<weld::Label> mxFtRange;
|
||||
std::unique_ptr<formula::WeldRefEdit> mxEdRange;
|
||||
std::unique_ptr<formula::WeldRefButton> mxRbRange;
|
||||
std::unique_ptr<ScCondFormatList> mxCondFormList;
|
||||
|
||||
void updateTitle();
|
||||
DECL_LINK( EdRangeModifyHdl, formula::WeldRefEdit&, void );
|
||||
protected:
|
||||
|
||||
virtual void RefInputDone( bool bForced = false ) override;
|
||||
@@ -115,10 +114,9 @@ protected:
|
||||
void CancelPressed();
|
||||
|
||||
public:
|
||||
SC_DLLPUBLIC ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pWindow,
|
||||
SC_DLLPUBLIC ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pWindow,
|
||||
ScViewData* pViewData, const ScCondFormatDlgItem* pDlgItem);
|
||||
virtual ~ScCondFormatDlg() override;
|
||||
virtual void dispose() override;
|
||||
|
||||
SC_DLLPUBLIC std::unique_ptr<ScConditionalFormat> GetConditionalFormat() const;
|
||||
|
||||
@@ -126,13 +124,13 @@ public:
|
||||
virtual bool IsRefInputMode() const override;
|
||||
virtual void SetActive() override;
|
||||
virtual bool IsTableLocked() const override;
|
||||
virtual bool Close() override;
|
||||
virtual void Close() override;
|
||||
|
||||
void InvalidateRefData();
|
||||
void OnSelectionChange(size_t nIndex, size_t nSize, bool bSelected = true);
|
||||
|
||||
DECL_LINK( BtnPressedHdl, Button*, void );
|
||||
DECL_LINK( RangeGetFocusHdl, Control&, void );
|
||||
DECL_LINK( BtnPressedHdl, weld::Button&, void );
|
||||
DECL_LINK( RangeGetFocusHdl, formula::WeldRefEdit&, void );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,12 +15,14 @@
|
||||
#include <vcl/vclptr.hxx>
|
||||
#include <vcl/builder.hxx>
|
||||
#include <vcl/layout.hxx>
|
||||
#include <vcl/weld.hxx>
|
||||
#include <svl/lstner.hxx>
|
||||
#include <svx/fntctrl.hxx>
|
||||
|
||||
class ScIconSetFrmtDataEntry;
|
||||
class ScCondFormatDlg;
|
||||
class SvxColorListBox;
|
||||
class ScCondFormatList;
|
||||
class ColorListBox;
|
||||
class ScColorScaleFormat;
|
||||
class ScDataBarFormat;
|
||||
class ScIconSetFormat;
|
||||
@@ -45,22 +47,27 @@ enum ScCondFrmtEntryType
|
||||
|
||||
}
|
||||
|
||||
class ScCondFrmtEntry : public VclContainer
|
||||
, public VclBuilderContainer
|
||||
class ScCondFrmtEntry
|
||||
{
|
||||
private:
|
||||
bool mbActive;
|
||||
protected:
|
||||
ScCondFormatList* mpParent;
|
||||
std::unique_ptr<weld::Builder> mxBuilder;
|
||||
|
||||
private:
|
||||
//general ui elements
|
||||
std::unique_ptr<weld::Widget> mxBorder;
|
||||
std::unique_ptr<weld::Container> mxGrid;
|
||||
std::unique_ptr<weld::Label> mxFtCondNr;
|
||||
std::unique_ptr<weld::Label> mxFtCondition;
|
||||
|
||||
bool mbActive;
|
||||
OUString const maStrCondition;
|
||||
Link<ScCondFrmtEntry&,void> maClickHdl;
|
||||
|
||||
//general ui elements
|
||||
VclPtr<VclContainer> maGrid;
|
||||
VclPtr<FixedText> maFtCondNr;
|
||||
VclPtr<FixedText> maFtCondition;
|
||||
DECL_LINK( EntrySelectHdl, const MouseEvent&, bool );
|
||||
|
||||
OUString const maStrCondition;
|
||||
protected:
|
||||
VclPtr<ListBox> maLbType;
|
||||
std::unique_ptr<weld::ComboBox> mxLbType;
|
||||
|
||||
ScDocument* mpDoc;
|
||||
ScAddress maPos;
|
||||
@@ -71,18 +78,20 @@ protected:
|
||||
virtual OUString GetExpressionString() = 0;
|
||||
|
||||
public:
|
||||
ScCondFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos );
|
||||
virtual ~ScCondFrmtEntry() override;
|
||||
virtual Size calculateRequisition() const override;
|
||||
virtual void setAllocation(const Size &rAllocation) override;
|
||||
virtual void dispose() override;
|
||||
ScCondFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos);
|
||||
virtual ~ScCondFrmtEntry();
|
||||
|
||||
virtual bool EventNotify( NotifyEvent& rNEvt ) override;
|
||||
void Show() { mxGrid->show(); }
|
||||
void Hide() { mxGrid->hide(); }
|
||||
|
||||
void set_grid_top_attach(int nAttach) { mxBorder->set_grid_top_attach(nAttach); }
|
||||
int get_grid_top_attach() const { return mxBorder->get_grid_top_attach(); }
|
||||
|
||||
Size get_preferred_size() const { return mxBorder->get_preferred_size(); }
|
||||
|
||||
void SetPos(const ScAddress& rPos) { maPos = rPos; };
|
||||
bool IsSelected() const { return mbActive;}
|
||||
void SetIndex(sal_Int32 nIndex);
|
||||
void SetHeight();
|
||||
|
||||
virtual ScFormatEntry* GetEntry() const = 0;
|
||||
virtual void SetActive() = 0;
|
||||
@@ -94,13 +103,15 @@ public:
|
||||
class ScConditionFrmtEntry : public ScCondFrmtEntry, public SfxListener
|
||||
{
|
||||
//cond format ui elements
|
||||
VclPtr<ListBox> maLbCondType;
|
||||
VclPtr<formula::RefEdit> maEdVal1;
|
||||
VclPtr<formula::RefEdit> maEdVal2;
|
||||
VclPtr<FixedText> maFtVal;
|
||||
VclPtr<FixedText> maFtStyle;
|
||||
VclPtr<ListBox> maLbStyle;
|
||||
VclPtr<SvxFontPrevWindow> maWdPreview;
|
||||
FontPrevWindow maWdPreview;
|
||||
std::unique_ptr<weld::ComboBox> mxLbCondType;
|
||||
std::unique_ptr<formula::WeldRefEdit> mxEdVal1;
|
||||
std::unique_ptr<formula::WeldRefEdit> mxEdVal2;
|
||||
std::unique_ptr<weld::Label> mxFtVal;
|
||||
std::unique_ptr<weld::Label> mxFtStyle;
|
||||
std::unique_ptr<weld::ComboBox> mxLbStyle;
|
||||
std::unique_ptr<weld::Widget> mxWdPreviewWin;
|
||||
std::unique_ptr<weld::CustomWeld> mxWdPreview;
|
||||
bool mbIsInStyleCreate;
|
||||
|
||||
static const sal_Int32 NUM_COND_ENTRIES = 24;
|
||||
@@ -111,9 +122,9 @@ class ScConditionFrmtEntry : public ScCondFrmtEntry, public SfxListener
|
||||
|
||||
virtual OUString GetExpressionString() override;
|
||||
void Init(ScCondFormatDlg* pDialogParent);
|
||||
DECL_LINK( StyleSelectHdl, ListBox&, void );
|
||||
DECL_LINK( ConditionTypeSelectHdl, ListBox&, void );
|
||||
DECL_LINK( OnEdChanged, Edit&, void );
|
||||
DECL_LINK( StyleSelectHdl, weld::ComboBox&, void );
|
||||
DECL_LINK( ConditionTypeSelectHdl, weld::ComboBox&, void );
|
||||
DECL_LINK( OnEdChanged, formula::WeldRefEdit&, void );
|
||||
|
||||
// Searches the lookup table for the entry position, given condition mode
|
||||
static sal_Int32 ConditionModeToEntryPos( ScConditionMode eMode );
|
||||
@@ -127,10 +138,9 @@ protected:
|
||||
virtual void Deselect() override;
|
||||
|
||||
public:
|
||||
ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
|
||||
const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = nullptr );
|
||||
ScConditionFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
|
||||
const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = nullptr);
|
||||
virtual ~ScConditionFrmtEntry() override;
|
||||
virtual void dispose() override;
|
||||
|
||||
virtual ScFormatEntry* GetEntry() const override;
|
||||
virtual void SetActive() override;
|
||||
@@ -143,21 +153,22 @@ public:
|
||||
|
||||
class ScFormulaFrmtEntry : public ScCondFrmtEntry
|
||||
{
|
||||
VclPtr<FixedText> maFtStyle;
|
||||
VclPtr<ListBox> maLbStyle;
|
||||
VclPtr<SvxFontPrevWindow> maWdPreview;
|
||||
VclPtr<formula::RefEdit> maEdFormula;
|
||||
FontPrevWindow maWdPreview;
|
||||
std::unique_ptr<weld::Label> mxFtStyle;
|
||||
std::unique_ptr<weld::ComboBox> mxLbStyle;
|
||||
std::unique_ptr<weld::Widget> mxWdPreviewWin;
|
||||
std::unique_ptr<weld::CustomWeld> mxWdPreview;
|
||||
std::unique_ptr<formula::WeldRefEdit> mxEdFormula;
|
||||
|
||||
ScFormatEntry* createFormulaEntry() const;
|
||||
virtual OUString GetExpressionString() override;
|
||||
void Init(ScCondFormatDlg* pDialogParent);
|
||||
|
||||
DECL_LINK( StyleSelectHdl, ListBox&, void );
|
||||
DECL_LINK(StyleSelectHdl, weld::ComboBox&, void);
|
||||
|
||||
public:
|
||||
ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* PDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = nullptr );
|
||||
ScFormulaFrmtEntry(ScCondFormatList* pParent, ScDocument* PDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = nullptr);
|
||||
virtual ~ScFormulaFrmtEntry() override;
|
||||
virtual void dispose() override;
|
||||
|
||||
virtual ScFormatEntry* GetEntry() const override;
|
||||
virtual void SetActive() override;
|
||||
@@ -169,31 +180,30 @@ class ScColorScale2FrmtEntry : public ScCondFrmtEntry
|
||||
{
|
||||
|
||||
//color format ui elements
|
||||
VclPtr<ListBox> maLbColorFormat;
|
||||
std::unique_ptr<weld::ComboBox> mxLbColorFormat;
|
||||
|
||||
//color scale ui elements
|
||||
VclPtr<ListBox> maLbEntryTypeMin;
|
||||
VclPtr<ListBox> maLbEntryTypeMax;
|
||||
std::unique_ptr<weld::ComboBox> mxLbEntryTypeMin;
|
||||
std::unique_ptr<weld::ComboBox> mxLbEntryTypeMax;
|
||||
|
||||
VclPtr<Edit> maEdMin;
|
||||
VclPtr<Edit> maEdMax;
|
||||
std::unique_ptr<weld::Entry> mxEdMin;
|
||||
std::unique_ptr<weld::Entry> mxEdMax;
|
||||
|
||||
VclPtr<SvxColorListBox> maLbColMin;
|
||||
VclPtr<SvxColorListBox> maLbColMax;
|
||||
std::unique_ptr<ColorListBox> mxLbColMin;
|
||||
std::unique_ptr<ColorListBox> mxLbColMax;
|
||||
|
||||
VclPtr<FixedText> maFtMin;
|
||||
VclPtr<FixedText> maFtMax;
|
||||
std::unique_ptr<weld::Label> mxFtMin;
|
||||
std::unique_ptr<weld::Label> mxFtMax;
|
||||
|
||||
ScFormatEntry* createColorscaleEntry() const;
|
||||
|
||||
virtual OUString GetExpressionString() override;
|
||||
void Init();
|
||||
|
||||
DECL_LINK( EntryTypeHdl, ListBox&, void );
|
||||
DECL_LINK( EntryTypeHdl, weld::ComboBox&, void );
|
||||
public:
|
||||
ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = nullptr );
|
||||
ScColorScale2FrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = nullptr);
|
||||
virtual ~ScColorScale2FrmtEntry() override;
|
||||
virtual void dispose() override;
|
||||
virtual ScFormatEntry* GetEntry() const override;
|
||||
virtual void SetActive() override;
|
||||
virtual void SetInactive() override;
|
||||
@@ -204,34 +214,33 @@ class ScColorScale3FrmtEntry : public ScCondFrmtEntry
|
||||
{
|
||||
|
||||
//color format ui elements
|
||||
VclPtr<ListBox> maLbColorFormat;
|
||||
std::unique_ptr<weld::ComboBox> mxLbColorFormat;
|
||||
|
||||
//color scale ui elements
|
||||
VclPtr<ListBox> maLbEntryTypeMin;
|
||||
VclPtr<ListBox> maLbEntryTypeMiddle;
|
||||
VclPtr<ListBox> maLbEntryTypeMax;
|
||||
std::unique_ptr<weld::ComboBox> mxLbEntryTypeMin;
|
||||
std::unique_ptr<weld::ComboBox> mxLbEntryTypeMiddle;
|
||||
std::unique_ptr<weld::ComboBox> mxLbEntryTypeMax;
|
||||
|
||||
VclPtr<Edit> maEdMin;
|
||||
VclPtr<Edit> maEdMiddle;
|
||||
VclPtr<Edit> maEdMax;
|
||||
std::unique_ptr<weld::Entry> mxEdMin;
|
||||
std::unique_ptr<weld::Entry> mxEdMiddle;
|
||||
std::unique_ptr<weld::Entry> mxEdMax;
|
||||
|
||||
VclPtr<SvxColorListBox> maLbColMin;
|
||||
VclPtr<SvxColorListBox> maLbColMiddle;
|
||||
VclPtr<SvxColorListBox> maLbColMax;
|
||||
std::unique_ptr<ColorListBox> mxLbColMin;
|
||||
std::unique_ptr<ColorListBox> mxLbColMiddle;
|
||||
std::unique_ptr<ColorListBox> mxLbColMax;
|
||||
|
||||
VclPtr<FixedText> maFtMin;
|
||||
VclPtr<FixedText> maFtMax;
|
||||
std::unique_ptr<weld::Label> mxFtMin;
|
||||
std::unique_ptr<weld::Label> mxFtMax;
|
||||
|
||||
ScFormatEntry* createColorscaleEntry() const;
|
||||
|
||||
virtual OUString GetExpressionString() override;
|
||||
void Init();
|
||||
|
||||
DECL_LINK( EntryTypeHdl, ListBox&, void );
|
||||
DECL_LINK( EntryTypeHdl, weld::ComboBox&, void );
|
||||
public:
|
||||
ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = nullptr );
|
||||
ScColorScale3FrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = nullptr);
|
||||
virtual ~ScColorScale3FrmtEntry() override;
|
||||
virtual void dispose() override;
|
||||
virtual ScFormatEntry* GetEntry() const override;
|
||||
virtual void SetActive() override;
|
||||
virtual void SetInactive() override;
|
||||
@@ -241,18 +250,17 @@ public:
|
||||
class ScDataBarFrmtEntry : public ScCondFrmtEntry
|
||||
{
|
||||
//color format ui elements
|
||||
VclPtr<ListBox> maLbColorFormat;
|
||||
std::unique_ptr<weld::ComboBox> mxLbColorFormat;
|
||||
|
||||
//data bar ui elements
|
||||
VclPtr<ListBox> maLbDataBarMinType;
|
||||
VclPtr<ListBox> maLbDataBarMaxType;
|
||||
VclPtr<Edit> maEdDataBarMin;
|
||||
VclPtr<Edit> maEdDataBarMax;
|
||||
std::unique_ptr<weld::ComboBox> mxLbDataBarMinType;
|
||||
std::unique_ptr<weld::ComboBox> mxLbDataBarMaxType;
|
||||
std::unique_ptr<weld::Entry> mxEdDataBarMin;
|
||||
std::unique_ptr<weld::Entry> mxEdDataBarMax;
|
||||
std::unique_ptr<weld::Button> mxBtOptions;
|
||||
|
||||
VclPtr<PushButton> maBtOptions;
|
||||
|
||||
VclPtr<FixedText> maFtMin;
|
||||
VclPtr<FixedText> maFtMax;
|
||||
std::unique_ptr<weld::Label> mxFtMin;
|
||||
std::unique_ptr<weld::Label> mxFtMax;
|
||||
|
||||
std::unique_ptr<ScDataBarFormatData> mpDataBarData;
|
||||
|
||||
@@ -261,12 +269,11 @@ class ScDataBarFrmtEntry : public ScCondFrmtEntry
|
||||
virtual OUString GetExpressionString() override;
|
||||
void Init();
|
||||
|
||||
DECL_LINK( OptionBtnHdl, Button*, void );
|
||||
DECL_LINK( DataBarTypeSelectHdl, ListBox&, void );
|
||||
DECL_LINK( OptionBtnHdl, weld::Button&, void );
|
||||
DECL_LINK( DataBarTypeSelectHdl, weld::ComboBox&, void );
|
||||
public:
|
||||
ScDataBarFrmtEntry( vcl::Window* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = nullptr );
|
||||
ScDataBarFrmtEntry(ScCondFormatList* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = nullptr);
|
||||
virtual ~ScDataBarFrmtEntry() override;
|
||||
virtual void dispose() override;
|
||||
virtual ScFormatEntry* GetEntry() const override;
|
||||
virtual void SetActive() override;
|
||||
virtual void SetInactive() override;
|
||||
@@ -277,9 +284,8 @@ public:
|
||||
class ScDateFrmtEntry : public ScCondFrmtEntry, public SfxListener
|
||||
{
|
||||
public:
|
||||
ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat = nullptr );
|
||||
ScDateFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat = nullptr);
|
||||
virtual ~ScDateFrmtEntry() override;
|
||||
virtual void dispose() override;
|
||||
virtual ScFormatEntry* GetEntry() const override;
|
||||
virtual void SetActive() override;
|
||||
virtual void SetInactive() override;
|
||||
@@ -293,12 +299,14 @@ protected:
|
||||
private:
|
||||
void Init();
|
||||
|
||||
DECL_LINK( StyleSelectHdl, ListBox&, void );
|
||||
DECL_LINK( StyleSelectHdl, weld::ComboBox&, void );
|
||||
|
||||
VclPtr<ListBox> maLbDateEntry;
|
||||
VclPtr<FixedText> maFtStyle;
|
||||
VclPtr<ListBox> maLbStyle;
|
||||
VclPtr<SvxFontPrevWindow> maWdPreview;
|
||||
FontPrevWindow maWdPreview;
|
||||
std::unique_ptr<weld::ComboBox> mxLbDateEntry;
|
||||
std::unique_ptr<weld::Label> mxFtStyle;
|
||||
std::unique_ptr<weld::ComboBox> mxLbStyle;
|
||||
std::unique_ptr<weld::Widget> mxWdPreviewWin;
|
||||
std::unique_ptr<weld::CustomWeld> mxWdPreview;
|
||||
|
||||
bool mbIsInStyleCreate;
|
||||
};
|
||||
@@ -306,26 +314,25 @@ private:
|
||||
class ScIconSetFrmtEntry : public ScCondFrmtEntry
|
||||
{
|
||||
//color format ui elements
|
||||
VclPtr<ListBox> maLbColorFormat;
|
||||
std::unique_ptr<weld::ComboBox> mxLbColorFormat;
|
||||
|
||||
// icon set ui elements
|
||||
VclPtr<ListBox> maLbIconSetType;
|
||||
std::unique_ptr<weld::ComboBox> mxLbIconSetType;
|
||||
|
||||
VclPtr<VclContainer> maIconParent;
|
||||
std::unique_ptr<weld::Container> mxIconParent;
|
||||
|
||||
typedef std::vector<VclPtr<ScIconSetFrmtDataEntry>> ScIconSetFrmtDataEntriesType;
|
||||
typedef std::vector<std::unique_ptr<ScIconSetFrmtDataEntry>> ScIconSetFrmtDataEntriesType;
|
||||
ScIconSetFrmtDataEntriesType maEntries;
|
||||
|
||||
virtual OUString GetExpressionString() override;
|
||||
|
||||
void Init();
|
||||
|
||||
DECL_LINK( IconSetTypeHdl, ListBox&, void );
|
||||
DECL_LINK(IconSetTypeHdl, weld::ComboBox&, void);
|
||||
|
||||
public:
|
||||
ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat = nullptr );
|
||||
ScIconSetFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat = nullptr);
|
||||
virtual ~ScIconSetFrmtEntry() override;
|
||||
virtual void dispose() override;
|
||||
virtual ScFormatEntry* GetEntry() const override;
|
||||
virtual void SetActive() override;
|
||||
virtual void SetInactive() override;
|
||||
|
||||
@@ -325,9 +325,6 @@ public:
|
||||
void DeactivateOle();
|
||||
|
||||
static ScTabViewShell* GetActiveViewShell();
|
||||
VclPtr<SfxModelessDialog> CreateRefDialog( SfxBindings* pB, SfxChildWindow* pCW,
|
||||
const SfxChildWinInfo* pInfo,
|
||||
vcl::Window* pParent, sal_uInt16 nSlotId );
|
||||
|
||||
std::unique_ptr<SfxModelessDialogController> CreateRefDialogController(SfxBindings* pB, SfxChildWindow* pCW,
|
||||
const SfxChildWinInfo* pInfo,
|
||||
|
||||
@@ -132,7 +132,7 @@ bool ScNameDefDlg::IsNameValid()
|
||||
}
|
||||
|
||||
ScRangeData::IsNameValidType eType;
|
||||
m_xFtInfo->set_error(false);
|
||||
m_xFtInfo->set_message_type(weld::EntryMessageType::Normal);
|
||||
if ( aName.isEmpty() )
|
||||
{
|
||||
m_xBtnAdd->set_sensitive(false);
|
||||
@@ -141,7 +141,7 @@ bool ScNameDefDlg::IsNameValid()
|
||||
}
|
||||
else if ((eType = ScRangeData::IsNameValid( aName, mpDoc )) != ScRangeData::NAME_VALID)
|
||||
{
|
||||
m_xFtInfo->set_error(true);
|
||||
m_xFtInfo->set_message_type(weld::EntryMessageType::Error);
|
||||
if (eType == ScRangeData::NAME_INVALID_BAD_STRING)
|
||||
{
|
||||
m_xFtInfo->set_label(maErrInvalidNameStr);
|
||||
@@ -155,7 +155,7 @@ bool ScNameDefDlg::IsNameValid()
|
||||
}
|
||||
else if (pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(aName)))
|
||||
{
|
||||
m_xFtInfo->set_error(true);
|
||||
m_xFtInfo->set_message_type(weld::EntryMessageType::Error);
|
||||
m_xFtInfo->set_label(maErrNameInUse);
|
||||
m_xBtnAdd->set_sensitive(false);
|
||||
return false;
|
||||
@@ -163,7 +163,7 @@ bool ScNameDefDlg::IsNameValid()
|
||||
|
||||
if (!IsFormulaValid())
|
||||
{
|
||||
m_xFtInfo->set_error(true);
|
||||
m_xFtInfo->set_message_type(weld::EntryMessageType::Error);
|
||||
m_xBtnAdd->set_sensitive(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -252,13 +252,13 @@ bool ScNameDlg::IsNameValid()
|
||||
|
||||
if (ScRangeData::IsNameValid( aName, mpDoc ) != ScRangeData::NAME_VALID)
|
||||
{
|
||||
m_xFtInfo->set_error(true);
|
||||
m_xFtInfo->set_message_type(weld::EntryMessageType::Error);
|
||||
m_xFtInfo->set_label(maErrInvalidNameStr);
|
||||
return false;
|
||||
}
|
||||
else if (pRangeName && pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(aName)))
|
||||
{
|
||||
m_xFtInfo->set_error(true);
|
||||
m_xFtInfo->set_message_type(weld::EntryMessageType::Error);
|
||||
m_xFtInfo->set_label(maErrNameInUse);
|
||||
return false;
|
||||
}
|
||||
@@ -272,7 +272,7 @@ bool ScNameDlg::IsFormulaValid()
|
||||
std::unique_ptr<ScTokenArray> pCode = aComp.CompileString(m_xEdAssign->GetText());
|
||||
if (pCode->GetCodeError() != FormulaError::NONE)
|
||||
{
|
||||
m_xFtInfo->set_error(true);
|
||||
m_xFtInfo->set_message_type(weld::EntryMessageType::Error);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -343,7 +343,7 @@ void ScNameDlg::NameModified()
|
||||
OUString aOldName = aLine.aName;
|
||||
OUString aNewName = m_xEdName->get_text();
|
||||
aNewName = aNewName.trim();
|
||||
m_xFtInfo->set_error(false);
|
||||
m_xFtInfo->set_message_type(weld::EntryMessageType::Normal);
|
||||
if (aNewName != aOldName)
|
||||
{
|
||||
if (!IsNameValid())
|
||||
|
||||
@@ -434,7 +434,10 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
|
||||
aStyleName = static_cast<const SfxStringItem*>(pNameItem)->GetValue();
|
||||
else if ( nSlotId == SID_STYLE_NEW_BY_EXAMPLE )
|
||||
{
|
||||
SfxNewStyleDlg aDlg(pTabViewShell->GetFrameWeld(), *pStylePool);
|
||||
weld::Window* pDialogParent = rReq.GetFrameWeld();
|
||||
if (!pDialogParent)
|
||||
pDialogParent = pTabViewShell->GetFrameWeld();
|
||||
SfxNewStyleDlg aDlg(pDialogParent, *pStylePool);
|
||||
if (aDlg.run() != RET_OK)
|
||||
return;
|
||||
aStyleName = aDlg.GetName();
|
||||
@@ -848,7 +851,10 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
|
||||
|
||||
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
|
||||
|
||||
pDlg.disposeAndReset(pFact->CreateScStyleDlg(pTabViewShell->GetFrameWeld(), *pStyleSheet, bPage));
|
||||
weld::Window* pDialogParent = rReq.GetFrameWeld();
|
||||
if (!pDialogParent)
|
||||
pDialogParent = pTabViewShell->GetFrameWeld();
|
||||
pDlg.disposeAndReset(pFact->CreateScStyleDlg(pDialogParent, *pStyleSheet, bPage));
|
||||
short nResult = pDlg->Execute();
|
||||
pTabViewShell->SetInFormatDialog(false);
|
||||
|
||||
|
||||
@@ -38,18 +38,18 @@ SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScSolverDlgWrapper, SID_OPENDLG_SOLVE)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScXMLSourceDlgWrapper, SID_MANAGE_XML_SOURCE)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScPivotLayoutWrapper, SID_OPENDLG_PIVOTTABLE)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScTabOpDlgWrapper, SID_OPENDLG_TABOP )
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScFilterDlgWrapper, SID_FILTER )
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScSpecialFilterDlgWrapper, SID_SPECIAL_FILTER )
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScDbNameDlgWrapper, SID_DEFINE_DBNAME )
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScTabOpDlgWrapper, SID_OPENDLG_TABOP)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScFilterDlgWrapper, SID_FILTER)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScSpecialFilterDlgWrapper, SID_SPECIAL_FILTER)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScDbNameDlgWrapper, SID_DEFINE_DBNAME)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScConsolidateDlgWrapper, SID_OPENDLG_CONSOLIDATE)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScPrintAreasDlgWrapper, SID_OPENDLG_EDIT_PRINTAREA )
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScColRowNameRangesDlgWrapper, SID_DEFINE_COLROWNAMERANGES )
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScPrintAreasDlgWrapper, SID_OPENDLG_EDIT_PRINTAREA)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScColRowNameRangesDlgWrapper, SID_DEFINE_COLROWNAMERANGES)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScFormulaDlgWrapper, SID_OPENDLG_FUNCTION)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScAcceptChgDlgWrapper, FID_CHG_ACCEPT)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScHighlightChgDlgWrapper, FID_CHG_SHOW )
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScSimpleRefDlgWrapper, WID_SIMPLE_REF )
|
||||
SFX_IMPL_MODELESSDIALOG_WITHID(ScCondFormatDlgWrapper, WID_CONDFRMT_REF )
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScHighlightChgDlgWrapper, FID_CHG_SHOW)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScSimpleRefDlgWrapper, WID_SIMPLE_REF)
|
||||
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScCondFormatDlgWrapper, WID_CONDFRMT_REF)
|
||||
|
||||
SFX_IMPL_CHILDWINDOW_WITHID(ScValidityRefChildWin, SID_VALIDITY_REFERENCE)
|
||||
|
||||
@@ -64,29 +64,6 @@ namespace
|
||||
ScTabViewShell* lcl_GetTabViewShell( const SfxBindings* pBindings );
|
||||
}
|
||||
|
||||
#define IMPL_CHILD_CTOR(Class,sid) \
|
||||
Class::Class( vcl::Window* pParentP, \
|
||||
sal_uInt16 nId, \
|
||||
SfxBindings* p, \
|
||||
const SfxChildWinInfo* pInfo ) \
|
||||
: SfxChildWindow(pParentP, nId) \
|
||||
{ \
|
||||
/************************************************************************************/\
|
||||
/* When a new document is creating, the SfxViewFrame may be ready, */\
|
||||
/* But the ScTabViewShell may have not been activated yet. In this */\
|
||||
/* situation, SfxViewShell::Current() does not get the correct shell, */\
|
||||
/* and we should lcl_GetTabViewShell( p ) instead of SfxViewShell::Current() */\
|
||||
/************************************************************************************/\
|
||||
ScTabViewShell* pViewShell = lcl_GetTabViewShell( p ); \
|
||||
if (!pViewShell) \
|
||||
pViewShell = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() ); \
|
||||
OSL_ENSURE( pViewShell, "missing view shell :-(" ); \
|
||||
SetWindow( pViewShell ? \
|
||||
pViewShell->CreateRefDialog( p, this, pInfo, pParentP, sid ) : nullptr ); \
|
||||
if (pViewShell && !GetWindow()) \
|
||||
pViewShell->GetViewFrame()->SetChildWindow( nId, false ); \
|
||||
}
|
||||
|
||||
#define IMPL_CONTROLLER_CHILD_CTOR(Class,sid) \
|
||||
Class::Class( vcl::Window* pParentP, \
|
||||
sal_uInt16 nId, \
|
||||
@@ -316,6 +293,6 @@ ScValidityRefChildWin::~ScValidityRefChildWin()
|
||||
SetController(nullptr);
|
||||
}
|
||||
|
||||
IMPL_CHILD_CTOR( ScCondFormatDlgWrapper, WID_CONDFRMT_REF )
|
||||
IMPL_CONTROLLER_CHILD_CTOR( ScCondFormatDlgWrapper, WID_CONDFRMT_REF )
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -115,73 +115,6 @@ void ScTabViewShell::SwitchBetweenRefDialogs(SfxModelessDialogController* pDialo
|
||||
}
|
||||
}
|
||||
|
||||
VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
|
||||
SfxBindings* pB, SfxChildWindow* pCW,
|
||||
const SfxChildWinInfo* pInfo,
|
||||
vcl::Window* pParent, sal_uInt16 nSlotId )
|
||||
{
|
||||
// only open dialog when called through ScModule::SetRefDialog,
|
||||
// so that it does not re appear for instance after a crash (#42341#).
|
||||
|
||||
if ( SC_MOD()->GetCurRefDlgId() != nSlotId )
|
||||
return nullptr;
|
||||
|
||||
if ( nCurRefDlgId != nSlotId )
|
||||
{
|
||||
// the dialog has been opened in a different view
|
||||
// -> lock the dispatcher for this view (modal mode)
|
||||
|
||||
GetViewData().GetDispatcher().Lock( true ); // lock is reset when closing dialog
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
VclPtr<SfxModelessDialog> pResult;
|
||||
|
||||
if(pCW)
|
||||
pCW->SetHideNotDelete(true);
|
||||
|
||||
switch( nSlotId )
|
||||
{
|
||||
case WID_CONDFRMT_REF:
|
||||
{
|
||||
bool bFound = false;
|
||||
const ScCondFormatDlgItem* pDlgItem = nullptr;
|
||||
// Get the pool item stored by Conditional Format Manager Dialog.
|
||||
const SfxPoolItem* pItem = nullptr;
|
||||
auto itemsRange = GetPool().GetItemSurrogates(SCITEM_CONDFORMATDLGDATA);
|
||||
if (itemsRange.begin() != itemsRange.end())
|
||||
{
|
||||
pItem = *itemsRange.begin();
|
||||
pDlgItem = static_cast<const ScCondFormatDlgItem*>(pItem);
|
||||
bFound = true;
|
||||
}
|
||||
|
||||
ScViewData& rViewData = GetViewData();
|
||||
rViewData.SetRefTabNo( rViewData.GetTabNo() );
|
||||
|
||||
pResult = VclPtr<ScCondFormatDlg>::Create( pB, pCW, pParent, &rViewData, pDlgItem );
|
||||
|
||||
// Remove the pool item stored by Conditional Format Manager Dialog.
|
||||
if ( bFound && pItem )
|
||||
GetPool().Remove( *pItem );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (pResult)
|
||||
{
|
||||
// the dialogs are always displayed with the option button collapsed,
|
||||
// the size has to be carried over initialize
|
||||
// (or store the option status !!!)
|
||||
|
||||
Size aSize = pResult->GetSizePixel();
|
||||
pResult->Initialize( pInfo );
|
||||
pResult->SetSizePixel(aSize);
|
||||
}
|
||||
|
||||
return pResult;
|
||||
}
|
||||
|
||||
std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogController(
|
||||
SfxBindings* pB, SfxChildWindow* pCW,
|
||||
const SfxChildWinInfo* pInfo,
|
||||
@@ -473,6 +406,30 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
|
||||
xResult.reset(new ScFormulaDlg(pB, pCW, pParent, &GetViewData(),ScGlobal::GetStarCalcFunctionMgr()));
|
||||
break;
|
||||
}
|
||||
case WID_CONDFRMT_REF:
|
||||
{
|
||||
bool bFound = false;
|
||||
const ScCondFormatDlgItem* pDlgItem = nullptr;
|
||||
// Get the pool item stored by Conditional Format Manager Dialog.
|
||||
const SfxPoolItem* pItem = nullptr;
|
||||
auto itemsRange = GetPool().GetItemSurrogates(SCITEM_CONDFORMATDLGDATA);
|
||||
if (itemsRange.begin() != itemsRange.end())
|
||||
{
|
||||
pItem = *itemsRange.begin();
|
||||
pDlgItem = static_cast<const ScCondFormatDlgItem*>(pItem);
|
||||
bFound = true;
|
||||
}
|
||||
|
||||
ScViewData& rViewData = GetViewData();
|
||||
rViewData.SetRefTabNo( rViewData.GetTabNo() );
|
||||
|
||||
xResult.reset(new ScCondFormatDlg(pB, pCW, pParent, &rViewData, pDlgItem));
|
||||
|
||||
// Remove the pool item stored by Conditional Format Manager Dialog.
|
||||
if ( bFound && pItem )
|
||||
GetPool().Remove( *pItem );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (xResult)
|
||||
|
||||
@@ -2,251 +2,371 @@
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface domain="sc">
|
||||
<requires lib="gtk+" version="3.18"/>
|
||||
<requires lib="LibreOffice" version="1.0"/>
|
||||
<object class="GtkGrid" id="grid">
|
||||
<object class="GtkScrolledWindow" id="border">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="vscrollbar_policy">never</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<object class="GtkViewport">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="number">
|
||||
<object class="GtkGrid" id="grid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="condition">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<property name="column_homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="type">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<items>
|
||||
<item translatable="yes" context="conditionalentry|type">All Cells</item>
|
||||
<item translatable="yes" context="conditionalentry|type">Cell value is</item>
|
||||
<item translatable="yes" context="conditionalentry|type">Formula is</item>
|
||||
<item translatable="yes" context="conditionalentry|type">Date is</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="styleft">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes" context="conditionalentry|styleft">Apply Style:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">style</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="style">
|
||||
<property name="can_focus">False</property>
|
||||
<items>
|
||||
<item translatable="yes" context="conditionalentry|style">New Style...</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="valueft">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes" context="conditionalentry|valueft">Enter a value:</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="width">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="edcolscalemin">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="edcolscalemiddle">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="edcolscalemax">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="svxcorelo-SvxColorListBox" id="lbcolmin">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="svxcorelo-SvxColorListBox" id="lbcolmiddle">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="svxcorelo-SvxColorListBox" id="lbcolmax">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="options">
|
||||
<property name="label" translatable="yes" context="conditionalentry|options">More Options...</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="colscalemin">
|
||||
<property name="can_focus">False</property>
|
||||
<items>
|
||||
<item id="auto" translatable="yes" context="conditionalentry|colscalemin">Automatic</item>
|
||||
<item id="min" translatable="yes" context="conditionalentry|colscalemin">Min</item>
|
||||
<item id="max" translatable="yes" context="conditionalentry|colscalemin">Max</item>
|
||||
<item id="percentil" translatable="yes" context="conditionalentry|colscalemin">Percentile</item>
|
||||
<item id="value" translatable="yes" context="conditionalentry|colscalemin">Value</item>
|
||||
<item id="percent" translatable="yes" context="conditionalentry|colscalemin">Percent</item>
|
||||
<item id="formula" translatable="yes" context="conditionalentry|colscalemin">Formula</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="colscalemiddle">
|
||||
<property name="can_focus">False</property>
|
||||
<items>
|
||||
<item id="auto" translatable="yes" context="conditionalentry|colscalemiddle">Automatic</item>
|
||||
<item id="min" translatable="yes" context="conditionalentry|colscalemiddle">Min</item>
|
||||
<item id="max" translatable="yes" context="conditionalentry|colscalemiddle">Max</item>
|
||||
<item id="percentil" translatable="yes" context="conditionalentry|colscalemiddle">Percentile</item>
|
||||
<item id="value" translatable="yes" context="conditionalentry|colscalemiddle">Value</item>
|
||||
<item id="percent" translatable="yes" context="conditionalentry|colscalemiddle">Percent</item>
|
||||
<item id="formula" translatable="yes" context="conditionalentry|colscalemiddle">Formula</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="colscalemax">
|
||||
<property name="can_focus">False</property>
|
||||
<items>
|
||||
<item id="auto" translatable="yes" context="conditionalentry|colscalemax">Automatic</item>
|
||||
<item id="min" translatable="yes" context="conditionalentry|colscalemax">Min</item>
|
||||
<item id="max" translatable="yes" context="conditionalentry|colscalemax">Max</item>
|
||||
<item id="percentil" translatable="yes" context="conditionalentry|colscalemax">Percentile</item>
|
||||
<item id="value" translatable="yes" context="conditionalentry|colscalemax">Value</item>
|
||||
<item id="percent" translatable="yes" context="conditionalentry|colscalemax">Percent</item>
|
||||
<item id="formula" translatable="yes" context="conditionalentry|colscalemax">Formula</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="svxlo-SvxFontPrevWindow" id="preview:border">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes" context="conditionalentry|preview|tooltip_text">Example</property>
|
||||
<property name="hexpand">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<property name="column_homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="number">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="condition">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<property name="column_homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="styleft">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes" context="conditionalentry|styleft">Apply Style:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">style</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="style">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<items>
|
||||
<item translatable="yes" context="conditionalentry|style">New Style...</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="valueft">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes" context="conditionalentry|valueft">Enter a value:</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="width">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="edcolscalemin">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="activates_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="edcolscalemiddle">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="activates_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="edcolscalemax">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="activates_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="lbcolmin">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="label" translatable="no"></property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="lbcolmiddle">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="label" translatable="no"></property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="lbcolmax">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="label" translatable="no"></property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="options">
|
||||
<property name="label" translatable="yes" context="conditionalentry|options">More Options...</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="colscalemin">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<items>
|
||||
<item id="auto" translatable="yes" context="conditionalentry|colscalemin">Automatic</item>
|
||||
<item id="min" translatable="yes" context="conditionalentry|colscalemin">Min</item>
|
||||
<item id="max" translatable="yes" context="conditionalentry|colscalemin">Max</item>
|
||||
<item id="percentil" translatable="yes" context="conditionalentry|colscalemin">Percentile</item>
|
||||
<item id="value" translatable="yes" context="conditionalentry|colscalemin">Value</item>
|
||||
<item id="percent" translatable="yes" context="conditionalentry|colscalemin">Percent</item>
|
||||
<item id="formula" translatable="yes" context="conditionalentry|colscalemin">Formula</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="colscalemiddle">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<items>
|
||||
<item id="auto" translatable="yes" context="conditionalentry|colscalemiddle">Automatic</item>
|
||||
<item id="min" translatable="yes" context="conditionalentry|colscalemiddle">Min</item>
|
||||
<item id="max" translatable="yes" context="conditionalentry|colscalemiddle">Max</item>
|
||||
<item id="percentil" translatable="yes" context="conditionalentry|colscalemiddle">Percentile</item>
|
||||
<item id="value" translatable="yes" context="conditionalentry|colscalemiddle">Value</item>
|
||||
<item id="percent" translatable="yes" context="conditionalentry|colscalemiddle">Percent</item>
|
||||
<item id="formula" translatable="yes" context="conditionalentry|colscalemiddle">Formula</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="colscalemax">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<items>
|
||||
<item id="auto" translatable="yes" context="conditionalentry|colscalemax">Automatic</item>
|
||||
<item id="min" translatable="yes" context="conditionalentry|colscalemax">Min</item>
|
||||
<item id="max" translatable="yes" context="conditionalentry|colscalemax">Max</item>
|
||||
<item id="percentil" translatable="yes" context="conditionalentry|colscalemax">Percentile</item>
|
||||
<item id="value" translatable="yes" context="conditionalentry|colscalemax">Value</item>
|
||||
<item id="percent" translatable="yes" context="conditionalentry|colscalemax">Percent</item>
|
||||
<item id="formula" translatable="yes" context="conditionalentry|colscalemax">Formula</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="iconparent">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">7</property>
|
||||
<property name="width">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="Label_minimum">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes" context="conditionalentry|Label_minimum">Minimum</property>
|
||||
<property name="mnemonic_widget">colscalemin</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="Label_maximum">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes" context="conditionalentry|Label_maximum">Maximum</property>
|
||||
<property name="mnemonic_widget">colscalemax</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="previewwin">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="no_show_all">True</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="preview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes" context="conditionalentry|preview|tooltip_text">Example</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<property name="column_homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="typeis">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<items>
|
||||
<item translatable="yes" context="conditionalentry|typeis">equal to</item>
|
||||
<item translatable="yes" context="conditionalentry|typeis">less than</item>
|
||||
@@ -275,14 +395,13 @@
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="datetype">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<items>
|
||||
<item translatable="yes" context="conditionalentry|datetype">Today</item>
|
||||
<item translatable="yes" context="conditionalentry|datetype">Yesterday</item>
|
||||
@@ -301,13 +420,12 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="colorformat">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<items>
|
||||
<item translatable="yes" context="conditionalentry|colorformat">Color Scale (2 Entries)</item>
|
||||
<item translatable="yes" context="conditionalentry|colorformat">Color Scale (3 Entries)</item>
|
||||
@@ -316,45 +434,79 @@
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<child>
|
||||
<object class="foruilo-RefEdit" id="val1">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="foruilo-RefEdit" id="val2">
|
||||
<object class="GtkEntry" id="formula">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="type">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<items>
|
||||
<item translatable="yes" context="conditionalentry|type">All Cells</item>
|
||||
<item translatable="yes" context="conditionalentry|type">Cell value is</item>
|
||||
<item translatable="yes" context="conditionalentry|type">Formula is</item>
|
||||
<item translatable="yes" context="conditionalentry|type">Date is</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="height">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="val1">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="width_chars">5</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="val2">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="width_chars">5</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="iconsettype">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<items>
|
||||
<item translatable="yes" context="conditionalentry|iconsettype">3 Arrows</item>
|
||||
<item translatable="yes" context="conditionalentry|iconsettype">3 Gray Arrows</item>
|
||||
@@ -382,83 +534,21 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="foruilo-RefEdit" id="formula">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="iconparent">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">8</property>
|
||||
<property name="width">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="Label_minimum">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes" context="conditionalentry|Label_minimum">Minimum</property>
|
||||
<property name="mnemonic_widget">colscalemin</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="Label_maximum">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes" context="conditionalentry|Label_maximum">Maximum</property>
|
||||
<property name="mnemonic_widget">colscalemax</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
</interface>
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface domain="sc">
|
||||
<requires lib="gtk+" version="3.18"/>
|
||||
<requires lib="LibreOffice" version="1.0"/>
|
||||
<object class="GtkDialog" id="ConditionalFormatDialog">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="title" translatable="yes" context="conditionalformatdialog|ConditionalFormatDialog">Conditional Formatting for</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="can_focus">False</property>
|
||||
@@ -15,6 +18,64 @@
|
||||
<property name="vexpand">True</property>
|
||||
<property name="orientation">vertical</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="layout_style">end</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="can_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">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>
|
||||
<property name="secondary">True</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="framecondition">
|
||||
<property name="visible">True</property>
|
||||
@@ -36,11 +97,57 @@
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="sclo-ScCondFormatList" id="list:border">
|
||||
<object class="GtkScrolledWindow" id="listwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_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="GtkGrid" id="list">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<style>
|
||||
<class name="notebook"/>
|
||||
<class name="stack"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -138,64 +245,6 @@
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="dialog-action_area1">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</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="can_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">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>
|
||||
<property name="secondary">True</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="framerange">
|
||||
<property name="visible">True</property>
|
||||
@@ -231,7 +280,7 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="foruilo-RefEdit" id="edassign">
|
||||
<object class="GtkEntry" id="edassign">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="valign">center</property>
|
||||
@@ -244,7 +293,7 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="foruilo-RefButton" id="rbassign">
|
||||
<object class="GtkButton" id="rbassign">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface domain="sc">
|
||||
<requires lib="gtk+" version="3.18"/>
|
||||
<object class="GtkGrid" id="ConditionalIconSet">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="border_width">6</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<child>
|
||||
|
||||
@@ -460,12 +460,9 @@ custom_widgets = [
|
||||
'PriorityMergedHBox',
|
||||
'PropertyControl',
|
||||
'RecentDocsView',
|
||||
'RefButton',
|
||||
'RefEdit',
|
||||
'ReplaceEdit',
|
||||
'RowEdit',
|
||||
'SameContentListBox',
|
||||
'ScCondFormatList',
|
||||
'ScCsvTableBox',
|
||||
'ScDataTableView',
|
||||
'ScDoubleField',
|
||||
|
||||
@@ -137,10 +137,6 @@ gb_UIConfig_gla11y_PARAMETERS += -g $(UI_A11YSUPPRS)
|
||||
endif
|
||||
|
||||
# Tell gla11y about LO-specific widgets
|
||||
# These are already automatically labelled Shrink/Expand
|
||||
gb_UIConfig_gla11y_PARAMETERS += --widgets-ignored +foruilo-RefButton
|
||||
# These, however, do need a label like a GtkEntry
|
||||
gb_UIConfig_gla11y_PARAMETERS += --widgets-needlabel +foruilo-RefEdit
|
||||
# These are storage, containers, or preview
|
||||
gb_UIConfig_gla11y_PARAMETERS += --widgets-suffixignored +ValueSet,HBox,VBox,ToolBox,Preview,PreviewWin,PreviewWindow,PrevWindow
|
||||
# These are buttons, thus already contain their label (but an image is not enough)
|
||||
|
||||
@@ -5,6 +5,7 @@ sc/uiconfig/scalc/ui/analysisofvariancedialog.ui://GtkButton[@id='input-range-bu
|
||||
sc/uiconfig/scalc/ui/analysisofvariancedialog.ui://GtkButton[@id='output-range-button'] button-no-label
|
||||
sc/uiconfig/scalc/ui/chisquaretestdialog.ui://GtkButton[@id='input-range-button'] button-no-label
|
||||
sc/uiconfig/scalc/ui/chisquaretestdialog.ui://GtkButton[@id='output-range-button'] button-no-label
|
||||
sc/uiconfig/scalc/ui/conditionalformatdialog.ui://GtkButton[@id='rbassign'] button-no-label
|
||||
sc/uiconfig/scalc/ui/consolidatedialog.ui://GtkButton[@id='rbdataarea'] button-no-label
|
||||
sc/uiconfig/scalc/ui/consolidatedialog.ui://GtkButton[@id='rbdestarea'] button-no-label
|
||||
sc/uiconfig/scalc/ui/correlationdialog.ui://GtkButton[@id='input-range-button'] button-no-label
|
||||
|
||||
@@ -11,19 +11,20 @@ sc/uiconfig/scalc/ui/conditionalentry.ui://GtkLabel[@id='valueft'] orphan-label
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkEntry[@id='edcolscalemin'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkEntry[@id='edcolscalemiddle'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkEntry[@id='edcolscalemax'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://svxcorelo-SvxColorListBox[@id='lbcolmin'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://svxcorelo-SvxColorListBox[@id='lbcolmiddle'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://svxcorelo-SvxColorListBox[@id='lbcolmax'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkMenuButton[@id='lbcolmin'] button-no-label
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkMenuButton[@id='lbcolmiddle'] button-no-label
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkMenuButton[@id='lbcolmax'] button-no-label
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkComboBoxText[@id='colscalemin'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkComboBoxText[@id='colscalemiddle'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkComboBoxText[@id='colscalemax'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkComboBoxText[@id='typeis'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkComboBoxText[@id='datetype'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkComboBoxText[@id='colorformat'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://foruilo-RefEdit[@id='val1'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://foruilo-RefEdit[@id='val2'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkEntry[@id='val1'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkEntry[@id='val2'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkComboBoxText[@id='iconsettype'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://foruilo-RefEdit[@id='formula'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkEntry[@id='formula'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionalentry.ui://GtkEntry[@id='formula1'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionaliconset.ui://GtkLabel[@id='label'] orphan-label
|
||||
sc/uiconfig/scalc/ui/conditionaliconset.ui://GtkEntry[@id='entry'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/conditionaliconset.ui://GtkComboBoxText[@id='listbox'] no-labelled-by
|
||||
@@ -58,7 +59,7 @@ sc/uiconfig/scalc/ui/dataproviderentry.ui://GtkEntry[@id='ed_id'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/dataproviderentry.ui:GtkGrid[@id='grid']/GtkLabel orphan-label
|
||||
sc/uiconfig/scalc/ui/dataproviderentry.ui:GtkGrid[@id='grid']/GtkLabel orphan-label
|
||||
sc/uiconfig/scalc/ui/dataproviderentry.ui:GtkGrid[@id='grid']/GtkLabel orphan-label
|
||||
sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://foruilo-RefEdit[@id='assign'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://GtkEntry[@id='assign'] no-labelled-by
|
||||
sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://GtkLabel[@id='Source'] orphan-label
|
||||
sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://GtkLabel[@id='Operations'] orphan-label
|
||||
sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://GtkLabel[@id='invalid'] orphan-label
|
||||
|
||||
@@ -749,9 +749,9 @@ IMPL_LINK(LanguageBox, ChangeHdl, weld::ComboBox&, rControl, void)
|
||||
if (eOldState != m_eEditedAndValid)
|
||||
{
|
||||
if (m_eEditedAndValid == EditedAndValid::Invalid)
|
||||
rControl.set_entry_error(true);
|
||||
rControl.set_entry_message_type(weld::EntryMessageType::Error);
|
||||
else
|
||||
rControl.set_entry_error(false);
|
||||
rControl.set_entry_message_type(weld::EntryMessageType::Normal);
|
||||
}
|
||||
}
|
||||
m_aChangeHdl.Call(rControl);
|
||||
|
||||
@@ -549,7 +549,7 @@ void SvxSearchDialog::SetSearchLabel(const OUString& rStr)
|
||||
m_xSearchLabel->set_label(rStr);
|
||||
|
||||
if (rStr == SvxResId(RID_SVXSTR_SEARCH_NOT_FOUND))
|
||||
m_xSearchLB->set_entry_error(true);
|
||||
m_xSearchLB->set_entry_message_type(weld::EntryMessageType::Error);
|
||||
}
|
||||
|
||||
void SvxSearchDialog::ApplyTransliterationFlags_Impl( TransliterationFlags nSettings )
|
||||
@@ -2184,7 +2184,7 @@ void SvxSearchDialog::SetModifyFlag_Impl( const weld::Widget* pCtrl )
|
||||
if (m_xSearchLB.get() == pCtrl)
|
||||
{
|
||||
nModifyFlag |= ModifyFlags::Search;
|
||||
m_xSearchLB->set_entry_error(false);
|
||||
m_xSearchLB->set_entry_message_type(weld::EntryMessageType::Normal);
|
||||
SvxSearchDialogWrapper::SetSearchLabel("");
|
||||
}
|
||||
else if ( m_xReplaceLB.get() == pCtrl )
|
||||
|
||||
@@ -245,11 +245,13 @@ protected:
|
||||
private:
|
||||
DECL_LINK(EventListener, VclWindowEvent&, void);
|
||||
DECL_LINK(KeyEventListener, VclWindowEvent&, bool);
|
||||
DECL_LINK(MouseEventListener, VclSimpleEvent&, void);
|
||||
DECL_LINK(MnemonicActivateHdl, vcl::Window&, bool);
|
||||
|
||||
const bool m_bTakeOwnership;
|
||||
bool m_bEventListener;
|
||||
bool m_bKeyEventListener;
|
||||
bool m_bMouseEventListener;
|
||||
int m_nBlockNotify;
|
||||
|
||||
protected:
|
||||
@@ -274,8 +276,20 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
// we want the ability to know about mouse events that happen in our children
|
||||
// so use this variant, we will need to filter them later
|
||||
void ensure_mouse_listener()
|
||||
{
|
||||
if (!m_bMouseEventListener)
|
||||
{
|
||||
Application::AddEventListener(LINK(this, SalInstanceWidget, MouseEventListener));
|
||||
m_bMouseEventListener = true;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void HandleEventListener(VclWindowEvent& rEvent);
|
||||
virtual bool HandleKeyEventListener(VclWindowEvent& rEvent);
|
||||
virtual void HandleMouseEventListener(VclSimpleEvent& rEvent);
|
||||
|
||||
public:
|
||||
SalInstanceWidget(vcl::Window* pWidget, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
|
||||
@@ -283,7 +297,7 @@ public:
|
||||
, m_pBuilder(pBuilder)
|
||||
, m_bTakeOwnership(bTakeOwnership)
|
||||
, m_bEventListener(false)
|
||||
, m_bKeyEventListener(false)
|
||||
, m_bMouseEventListener(false)
|
||||
, m_nBlockNotify(0)
|
||||
{
|
||||
}
|
||||
@@ -529,19 +543,19 @@ public:
|
||||
|
||||
virtual void connect_mouse_press(const Link<const MouseEvent&, bool>& rLink) override
|
||||
{
|
||||
ensure_event_listener();
|
||||
ensure_mouse_listener();
|
||||
weld::Widget::connect_mouse_press(rLink);
|
||||
}
|
||||
|
||||
virtual void connect_mouse_move(const Link<const MouseEvent&, bool>& rLink) override
|
||||
{
|
||||
ensure_event_listener();
|
||||
ensure_mouse_listener();
|
||||
weld::Widget::connect_mouse_move(rLink);
|
||||
}
|
||||
|
||||
virtual void connect_mouse_release(const Link<const MouseEvent&, bool>& rLink) override
|
||||
{
|
||||
ensure_event_listener();
|
||||
ensure_mouse_listener();
|
||||
weld::Widget::connect_mouse_release(rLink);
|
||||
}
|
||||
|
||||
@@ -608,6 +622,8 @@ public:
|
||||
{
|
||||
if (m_aMnemonicActivateHdl.IsSet())
|
||||
m_xWidget->SetMnemonicActivateHdl(Link<vcl::Window&,bool>());
|
||||
if (m_bMouseEventListener)
|
||||
Application::RemoveEventListener(LINK(this, SalInstanceWidget, MouseEventListener));
|
||||
if (m_bKeyEventListener)
|
||||
Application::RemoveKeyListener(LINK(this, SalInstanceWidget, KeyEventListener));
|
||||
if (m_bEventListener)
|
||||
@@ -654,6 +670,15 @@ public:
|
||||
return m_xWidget->GetDropTarget();
|
||||
}
|
||||
|
||||
virtual void set_stack_background() override
|
||||
{
|
||||
m_xWidget->SetControlBackground(m_xWidget->GetSettings().GetStyleSettings().GetWindowColor());
|
||||
m_xWidget->SetBackground(m_xWidget->GetControlBackground());
|
||||
// turn off WB_CLIPCHILDREN otherwise the bg won't extend "under"
|
||||
// transparent children of the widget
|
||||
m_xWidget->SetStyle(m_xWidget->GetStyle() & ~WB_CLIPCHILDREN);
|
||||
}
|
||||
|
||||
SystemWindow* getSystemWindow()
|
||||
{
|
||||
return m_xWidget->GetSystemWindow();
|
||||
@@ -668,20 +693,36 @@ void SalInstanceWidget::HandleEventListener(VclWindowEvent& rEvent)
|
||||
m_aFocusOutHdl.Call(*this);
|
||||
else if (rEvent.GetId() == VclEventId::WindowResize)
|
||||
m_aSizeAllocateHdl.Call(m_xWidget->GetSizePixel());
|
||||
else if (rEvent.GetId() == VclEventId::WindowMouseButtonDown)
|
||||
}
|
||||
|
||||
void SalInstanceWidget::HandleMouseEventListener(VclSimpleEvent& rEvent)
|
||||
{
|
||||
if (rEvent.GetId() == VclEventId::WindowMouseButtonDown)
|
||||
{
|
||||
const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rEvent.GetData());
|
||||
m_aMousePressHdl.Call(*pMouseEvent);
|
||||
auto& rWinEvent = static_cast<VclWindowEvent&>(rEvent);
|
||||
if (m_xWidget->IsWindowOrChild(rWinEvent.GetWindow()))
|
||||
{
|
||||
const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rWinEvent.GetData());
|
||||
m_aMousePressHdl.Call(*pMouseEvent);
|
||||
}
|
||||
}
|
||||
else if (rEvent.GetId() == VclEventId::WindowMouseButtonUp)
|
||||
{
|
||||
const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rEvent.GetData());
|
||||
m_aMouseReleaseHdl.Call(*pMouseEvent);
|
||||
auto& rWinEvent = static_cast<VclWindowEvent&>(rEvent);
|
||||
if (m_xWidget->IsWindowOrChild(rWinEvent.GetWindow()))
|
||||
{
|
||||
const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rWinEvent.GetData());
|
||||
m_aMouseReleaseHdl.Call(*pMouseEvent);
|
||||
}
|
||||
}
|
||||
else if (rEvent.GetId() == VclEventId::WindowMouseMove)
|
||||
{
|
||||
const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rEvent.GetData());
|
||||
m_aMouseMotionHdl.Call(*pMouseEvent);
|
||||
auto& rWinEvent = static_cast<VclWindowEvent&>(rEvent);
|
||||
if (m_xWidget->IsWindowOrChild(rWinEvent.GetWindow()))
|
||||
{
|
||||
const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rWinEvent.GetData());
|
||||
m_aMouseMotionHdl.Call(*pMouseEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -713,6 +754,11 @@ IMPL_LINK(SalInstanceWidget, KeyEventListener, VclWindowEvent&, rEvent, bool)
|
||||
return HandleKeyEventListener(rEvent);
|
||||
}
|
||||
|
||||
IMPL_LINK(SalInstanceWidget, MouseEventListener, VclSimpleEvent&, rEvent, void)
|
||||
{
|
||||
HandleMouseEventListener(rEvent);
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG(SalInstanceWidget, MnemonicActivateHdl, vcl::Window&, bool)
|
||||
{
|
||||
return m_aMnemonicActivateHdl.Call(*this);
|
||||
@@ -2331,15 +2377,24 @@ public:
|
||||
return !m_xEntry->IsReadOnly();
|
||||
}
|
||||
|
||||
virtual void set_error(bool bError) override
|
||||
virtual void set_message_type(weld::EntryMessageType eType) override
|
||||
{
|
||||
if (bError)
|
||||
if (eType == weld::EntryMessageType::Error)
|
||||
{
|
||||
// #i75179# enable setting the background to a different color
|
||||
// tdf#114603: enable setting the background to a different color;
|
||||
// relevant for GTK; see also #i75179#
|
||||
m_xEntry->SetForceControlBackground(true);
|
||||
m_xEntry->SetControlForeground(COL_WHITE);
|
||||
m_xEntry->SetControlBackground(0xff6563);
|
||||
}
|
||||
else if (eType == weld::EntryMessageType::Warning)
|
||||
{
|
||||
// tdf#114603: enable setting the background to a different color;
|
||||
// relevant for GTK; see also #i75179#
|
||||
m_xEntry->SetForceControlBackground(true);
|
||||
m_xEntry->SetControlForeground();
|
||||
m_xEntry->SetControlBackground(COL_YELLOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_xEntry->SetForceControlBackground(false);
|
||||
@@ -3904,10 +3959,12 @@ public:
|
||||
pLabel->set_mnemonic_widget(pTargetWidget ? pTargetWidget->getWidget() : nullptr);
|
||||
}
|
||||
|
||||
virtual void set_error(bool bShowError) override
|
||||
virtual void set_message_type(weld::EntryMessageType eType) override
|
||||
{
|
||||
if (bShowError)
|
||||
if (eType == weld::EntryMessageType::Error)
|
||||
m_xLabel->SetControlBackground(m_xLabel->GetSettings().GetStyleSettings().GetHighlightColor());
|
||||
else if (eType == weld::EntryMessageType::Warning)
|
||||
m_xLabel->SetControlBackground(COL_YELLOW);
|
||||
else
|
||||
m_xLabel->SetControlBackground();
|
||||
}
|
||||
@@ -4127,16 +4184,23 @@ private:
|
||||
// in VclDrawingArea
|
||||
virtual void HandleEventListener(VclWindowEvent& rEvent) override
|
||||
{
|
||||
if (rEvent.GetId() == VclEventId::WindowResize ||
|
||||
rEvent.GetId() == VclEventId::WindowMouseButtonDown ||
|
||||
if (rEvent.GetId() == VclEventId::WindowResize)
|
||||
return;
|
||||
SalInstanceWidget::HandleEventListener(rEvent);
|
||||
}
|
||||
|
||||
virtual void HandleMouseEventListener(VclSimpleEvent& rEvent) override
|
||||
{
|
||||
if (rEvent.GetId() == VclEventId::WindowMouseButtonDown ||
|
||||
rEvent.GetId() == VclEventId::WindowMouseButtonUp ||
|
||||
rEvent.GetId() == VclEventId::WindowMouseMove)
|
||||
{
|
||||
return;
|
||||
}
|
||||
SalInstanceWidget::HandleEventListener(rEvent);
|
||||
SalInstanceWidget::HandleMouseEventListener(rEvent);
|
||||
}
|
||||
|
||||
|
||||
virtual bool HandleKeyEventListener(VclWindowEvent& /*rEvent*/) override
|
||||
{
|
||||
return false;
|
||||
@@ -4520,7 +4584,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void set_entry_error(bool /*bError*/) override
|
||||
virtual void set_entry_message_type(weld::EntryMessageType /*eType*/) override
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
@@ -4588,10 +4652,12 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void set_entry_error(bool bError) override
|
||||
virtual void set_entry_message_type(weld::EntryMessageType eType) override
|
||||
{
|
||||
if (bError)
|
||||
if (eType == weld::EntryMessageType::Error)
|
||||
m_xComboBox->SetControlForeground(Color(0xf0, 0, 0));
|
||||
else if (eType == weld::EntryMessageType::Warning)
|
||||
m_xComboBox->SetControlForeground(COL_YELLOW);
|
||||
else
|
||||
m_xComboBox->SetControlForeground();
|
||||
}
|
||||
|
||||
@@ -838,7 +838,7 @@ static SystemWindow *ImplGetLastSystemWindow( vcl::Window *pWin )
|
||||
|
||||
void Window::SetParent( vcl::Window* pNewParent )
|
||||
{
|
||||
SAL_WARN_IF( !pNewParent, "vcl", "Window::SetParent(): pParent == NULL" );
|
||||
SAL_INFO_IF( !pNewParent, "vcl", "Window::SetParent(): pParent == NULL" );
|
||||
SAL_WARN_IF( pNewParent == this, "vcl", "someone tried to reparent a window to itself" );
|
||||
|
||||
if( !pNewParent || pNewParent == this )
|
||||
|
||||
+130
-30
@@ -1254,6 +1254,7 @@ class GtkInstanceWidget : public virtual weld::Widget
|
||||
{
|
||||
protected:
|
||||
GtkWidget* m_pWidget;
|
||||
GtkWidget* m_pMouseEventBox;
|
||||
GtkInstanceBuilder* m_pBuilder;
|
||||
|
||||
DECL_LINK(async_signal_focus_in, void*, void);
|
||||
@@ -1298,10 +1299,69 @@ protected:
|
||||
m_aFocusOutHdl.Call(*this);
|
||||
}
|
||||
|
||||
void ensureEventWidget()
|
||||
{
|
||||
// not every widget has a GdkWindow and can get any event, so if we
|
||||
// want an event it doesn't have, insert a GtkEventBox so we can get
|
||||
// those
|
||||
if (!m_pMouseEventBox)
|
||||
{
|
||||
if (gtk_widget_get_has_window(m_pWidget))
|
||||
m_pMouseEventBox = m_pWidget;
|
||||
else
|
||||
{
|
||||
// remove the widget and replace it with an eventbox and put the old
|
||||
// widget into it
|
||||
GtkWidget* pParent = gtk_widget_get_parent(m_pWidget);
|
||||
|
||||
g_object_ref(m_pWidget);
|
||||
|
||||
gint nTopAttach(0), nLeftAttach(0), nHeight(1), nWidth(1);
|
||||
if (GTK_IS_GRID(pParent))
|
||||
{
|
||||
gtk_container_child_get(GTK_CONTAINER(pParent), m_pWidget,
|
||||
"left-attach", &nTopAttach,
|
||||
"top-attach", &nLeftAttach,
|
||||
"width", &nWidth,
|
||||
"height", &nHeight,
|
||||
nullptr);
|
||||
}
|
||||
|
||||
gtk_container_remove(GTK_CONTAINER(pParent), m_pWidget);
|
||||
|
||||
m_pMouseEventBox = gtk_event_box_new();
|
||||
gtk_event_box_set_above_child(GTK_EVENT_BOX(m_pMouseEventBox), false);
|
||||
gtk_event_box_set_visible_window(GTK_EVENT_BOX(m_pMouseEventBox), false);
|
||||
gtk_widget_show(m_pMouseEventBox);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(pParent), m_pMouseEventBox);
|
||||
|
||||
if (GTK_IS_GRID(pParent))
|
||||
{
|
||||
gtk_container_child_set(GTK_CONTAINER(pParent), m_pMouseEventBox,
|
||||
"left-attach", nTopAttach,
|
||||
"top-attach", nLeftAttach,
|
||||
"width", nWidth,
|
||||
"height", nHeight,
|
||||
nullptr);
|
||||
}
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(m_pMouseEventBox), m_pWidget);
|
||||
g_object_unref(m_pWidget);
|
||||
|
||||
gtk_widget_set_hexpand(m_pMouseEventBox, gtk_widget_get_hexpand(m_pWidget));
|
||||
gtk_widget_set_vexpand(m_pMouseEventBox, gtk_widget_get_vexpand(m_pWidget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ensureButtonPressSignal()
|
||||
{
|
||||
if (!m_nButtonPressSignalId)
|
||||
m_nButtonPressSignalId = g_signal_connect(m_pWidget, "button-press-event", G_CALLBACK(signalButton), this);
|
||||
{
|
||||
ensureEventWidget();
|
||||
m_nButtonPressSignalId = g_signal_connect(m_pMouseEventBox, "button-press-event", G_CALLBACK(signalButton), this);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean signalPopupMenu(GtkWidget* pWidget, gpointer widget)
|
||||
@@ -1515,6 +1575,7 @@ private:
|
||||
public:
|
||||
GtkInstanceWidget(GtkWidget* pWidget, GtkInstanceBuilder* pBuilder, bool bTakeOwnership)
|
||||
: m_pWidget(pWidget)
|
||||
, m_pMouseEventBox(nullptr)
|
||||
, m_pBuilder(pBuilder)
|
||||
, m_bTakeOwnership(bTakeOwnership)
|
||||
, m_bFrozen(false)
|
||||
@@ -1556,13 +1617,15 @@ public:
|
||||
|
||||
virtual void connect_mouse_move(const Link<const MouseEvent&, bool>& rLink) override
|
||||
{
|
||||
m_nMotionSignalId = g_signal_connect(m_pWidget, "motion-notify-event", G_CALLBACK(signalMotion), this);
|
||||
ensureEventWidget();
|
||||
m_nMotionSignalId = g_signal_connect(m_pMouseEventBox, "motion-notify-event", G_CALLBACK(signalMotion), this);
|
||||
weld::Widget::connect_mouse_move(rLink);
|
||||
}
|
||||
|
||||
virtual void connect_mouse_release(const Link<const MouseEvent&, bool>& rLink) override
|
||||
{
|
||||
m_nButtonReleaseSignalId = g_signal_connect(m_pWidget, "button-release-event", G_CALLBACK(signalButton), this);
|
||||
ensureEventWidget();
|
||||
m_nButtonReleaseSignalId = g_signal_connect(m_pMouseEventBox, "button-release-event", G_CALLBACK(signalButton), this);
|
||||
weld::Widget::connect_mouse_release(rLink);
|
||||
}
|
||||
|
||||
@@ -1993,6 +2056,17 @@ public:
|
||||
return m_xDropTarget.get();
|
||||
}
|
||||
|
||||
virtual void set_stack_background() override
|
||||
{
|
||||
GtkStyleContext *pWidgetContext = gtk_widget_get_style_context(GTK_WIDGET(m_pWidget));
|
||||
GtkCssProvider *pProvider = gtk_css_provider_new();
|
||||
OUString aBuffer = "* { background-color: #" + Application::GetSettings().GetStyleSettings().GetWindowColor().AsRGBHexString() + "; }";
|
||||
OString aResult = OUStringToOString(aBuffer, RTL_TEXTENCODING_UTF8);
|
||||
gtk_css_provider_load_from_data(pProvider, aResult.getStr(), aResult.getLength(), nullptr);
|
||||
gtk_style_context_add_provider(pWidgetContext, GTK_STYLE_PROVIDER(pProvider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
}
|
||||
|
||||
virtual ~GtkInstanceWidget() override
|
||||
{
|
||||
if (m_nDragMotionSignalId)
|
||||
@@ -2008,11 +2082,11 @@ public:
|
||||
if (m_nKeyReleaseSignalId)
|
||||
g_signal_handler_disconnect(m_pWidget, m_nKeyReleaseSignalId);
|
||||
if (m_nButtonPressSignalId)
|
||||
g_signal_handler_disconnect(m_pWidget, m_nButtonPressSignalId);
|
||||
g_signal_handler_disconnect(m_pMouseEventBox, m_nButtonPressSignalId);
|
||||
if (m_nMotionSignalId)
|
||||
g_signal_handler_disconnect(m_pWidget, m_nMotionSignalId);
|
||||
g_signal_handler_disconnect(m_pMouseEventBox, m_nMotionSignalId);
|
||||
if (m_nButtonReleaseSignalId)
|
||||
g_signal_handler_disconnect(m_pWidget, m_nButtonReleaseSignalId);
|
||||
g_signal_handler_disconnect(m_pMouseEventBox, m_nButtonReleaseSignalId);
|
||||
if (m_nFocusInSignalId)
|
||||
g_signal_handler_disconnect(m_pWidget, m_nFocusInSignalId);
|
||||
if (m_nMnemonicActivateSignalId)
|
||||
@@ -2021,6 +2095,21 @@ public:
|
||||
g_signal_handler_disconnect(m_pWidget, m_nFocusOutSignalId);
|
||||
if (m_nSizeAllocateSignalId)
|
||||
g_signal_handler_disconnect(m_pWidget, m_nSizeAllocateSignalId);
|
||||
|
||||
if (m_pMouseEventBox && m_pMouseEventBox != m_pWidget)
|
||||
{
|
||||
// put things back they way we found them
|
||||
GtkWidget* pParent = gtk_widget_get_parent(m_pMouseEventBox);
|
||||
|
||||
g_object_ref(m_pWidget);
|
||||
gtk_container_remove(GTK_CONTAINER(m_pMouseEventBox), m_pWidget);
|
||||
|
||||
gtk_widget_destroy(m_pMouseEventBox);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(pParent), m_pWidget);
|
||||
g_object_unref(m_pWidget);
|
||||
}
|
||||
|
||||
if (m_bTakeOwnership)
|
||||
gtk_widget_destroy(m_pWidget);
|
||||
}
|
||||
@@ -5564,6 +5653,19 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
void set_entry_message_type(GtkEntry* pEntry, weld::EntryMessageType eType)
|
||||
{
|
||||
if (eType == weld::EntryMessageType::Error)
|
||||
gtk_entry_set_icon_from_icon_name(pEntry, GTK_ENTRY_ICON_SECONDARY, "dialog-error");
|
||||
else if (eType == weld::EntryMessageType::Warning)
|
||||
gtk_entry_set_icon_from_icon_name(pEntry, GTK_ENTRY_ICON_SECONDARY, "dialog-warning");
|
||||
else
|
||||
gtk_entry_set_icon_from_icon_name(pEntry, GTK_ENTRY_ICON_SECONDARY, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
class GtkInstanceEntry : public GtkInstanceWidget, public virtual weld::Entry
|
||||
{
|
||||
private:
|
||||
@@ -5716,12 +5818,9 @@ public:
|
||||
return gtk_editable_get_editable(GTK_EDITABLE(m_pEntry));
|
||||
}
|
||||
|
||||
virtual void set_error(bool bError) override
|
||||
virtual void set_message_type(weld::EntryMessageType eType) override
|
||||
{
|
||||
if (bError)
|
||||
gtk_entry_set_icon_from_icon_name(m_pEntry, GTK_ENTRY_ICON_SECONDARY, "dialog-error");
|
||||
else
|
||||
gtk_entry_set_icon_from_icon_name(m_pEntry, GTK_ENTRY_ICON_SECONDARY, nullptr);
|
||||
::set_entry_message_type(m_pEntry, eType);
|
||||
}
|
||||
|
||||
virtual void disable_notify_events() override
|
||||
@@ -7917,6 +8016,19 @@ class GtkInstanceLabel : public GtkInstanceWidget, public virtual weld::Label
|
||||
{
|
||||
private:
|
||||
GtkLabel* m_pLabel;
|
||||
|
||||
void set_text_color(const Color& rColor)
|
||||
{
|
||||
guint16 nRed = rColor.GetRed() << 8;
|
||||
guint16 nGreen = rColor.GetRed() << 8;
|
||||
guint16 nBlue = rColor.GetBlue() << 8;
|
||||
|
||||
PangoAttrList* pAttrs = pango_attr_list_new();
|
||||
pango_attr_list_insert(pAttrs, pango_attr_background_new(nRed, nGreen, nBlue));
|
||||
gtk_label_set_attributes(m_pLabel, pAttrs);
|
||||
pango_attr_list_unref(pAttrs);
|
||||
}
|
||||
|
||||
public:
|
||||
GtkInstanceLabel(GtkLabel* pLabel, GtkInstanceBuilder* pBuilder, bool bTakeOwnership)
|
||||
: GtkInstanceWidget(GTK_WIDGET(pLabel), pBuilder, bTakeOwnership)
|
||||
@@ -7941,21 +8053,12 @@ public:
|
||||
gtk_label_set_mnemonic_widget(m_pLabel, pTargetWidget ? pTargetWidget->getWidget() : nullptr);
|
||||
}
|
||||
|
||||
virtual void set_error(bool bShowError) override
|
||||
virtual void set_message_type(weld::EntryMessageType eType) override
|
||||
{
|
||||
if (bShowError)
|
||||
{
|
||||
Color aColor(Application::GetSettings().GetStyleSettings().GetHighlightColor());
|
||||
|
||||
guint16 nRed = aColor.GetRed() << 8;
|
||||
guint16 nGreen = aColor.GetRed() << 8;
|
||||
guint16 nBlue = aColor.GetBlue() << 8;
|
||||
|
||||
PangoAttrList* pAttrs = pango_attr_list_new();
|
||||
pango_attr_list_insert(pAttrs, pango_attr_background_new(nRed, nGreen, nBlue));
|
||||
gtk_label_set_attributes(m_pLabel, pAttrs);
|
||||
pango_attr_list_unref(pAttrs);
|
||||
}
|
||||
if (eType == weld::EntryMessageType::Error)
|
||||
set_text_color(Application::GetSettings().GetStyleSettings().GetHighlightColor());
|
||||
else if (eType == weld::EntryMessageType::Warning)
|
||||
set_text_color(COL_YELLOW);
|
||||
else
|
||||
gtk_label_set_attributes(m_pLabel, nullptr);
|
||||
}
|
||||
@@ -9032,15 +9135,12 @@ public:
|
||||
return gtk_combo_box_get_has_entry(m_pComboBox);
|
||||
}
|
||||
|
||||
virtual void set_entry_error(bool bError) override
|
||||
virtual void set_entry_message_type(weld::EntryMessageType eType) override
|
||||
{
|
||||
GtkWidget* pChild = gtk_bin_get_child(GTK_BIN(m_pComboBox));
|
||||
assert(GTK_IS_ENTRY(pChild));
|
||||
GtkEntry* pEntry = GTK_ENTRY(pChild);
|
||||
if (bError)
|
||||
gtk_entry_set_icon_from_icon_name(pEntry, GTK_ENTRY_ICON_SECONDARY, "dialog-error");
|
||||
else
|
||||
gtk_entry_set_icon_from_icon_name(pEntry, GTK_ENTRY_ICON_SECONDARY, nullptr);
|
||||
::set_entry_message_type(pEntry, eType);
|
||||
}
|
||||
|
||||
virtual void set_entry_text(const OUString& rText) override
|
||||
|
||||
Reference in New Issue
Block a user