summaryrefslogtreecommitdiff
path: root/vcl/jsdialog
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-01-15 11:38:50 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2021-01-22 11:30:42 +0100
commita6f45c525226e858ccca5078a6a41e8b07a78b86 (patch)
treea2817eb4d8ebb41376a67f2a95a2fbd641ea1186 /vcl/jsdialog
parentfbafc005e8beafa62a44ced467b342233caf746e (diff)
jsdialog: partial updates for more widgets
+ DrawingArea + Combobox + Listbox + RadioButton + Expander + IconView + Entry + TextView + SpinField Change-Id: Ic1fdc8ae37216089d0ba18191ff12895c1f5e84e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109367 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl/jsdialog')
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx45
1 files changed, 24 insertions, 21 deletions
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 658ee5ae18d6..9fd33ae26b3a 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -182,8 +182,11 @@ void JSDialogSender::sendClose()
flush();
}
-void JSDialogSender::sendUpdate(VclPtr<vcl::Window> pWindow)
+void JSDialogSender::sendUpdate(VclPtr<vcl::Window> pWindow, bool bForce)
{
+ if (bForce)
+ mpIdleNotify->forceUpdate();
+
mpIdleNotify->sendMessage(jsdialog::MessageType::WidgetUpdate, pWindow);
mpIdleNotify->Start();
}
@@ -772,7 +775,7 @@ JSEntry::JSEntry(JSDialogSender* pSender, ::Edit* pEntry, SalInstanceBuilder* pB
void JSEntry::set_text(const OUString& rText)
{
SalInstanceEntry::set_text(rText);
- sendFullUpdate();
+ sendUpdate();
}
void JSEntry::set_text_without_notify(const OUString& rText) { SalInstanceEntry::set_text(rText); }
@@ -788,19 +791,19 @@ void JSListBox::insert(int pos, const OUString& rStr, const OUString* pId,
const OUString* pIconName, VirtualDevice* pImageSurface)
{
SalInstanceComboBoxWithoutEdit::insert(pos, rStr, pId, pIconName, pImageSurface);
- sendFullUpdate();
+ sendUpdate();
}
void JSListBox::remove(int pos)
{
SalInstanceComboBoxWithoutEdit::remove(pos);
- sendFullUpdate();
+ sendUpdate();
}
void JSListBox::set_active(int pos)
{
SalInstanceComboBoxWithoutEdit::set_active(pos);
- sendFullUpdate();
+ sendUpdate();
}
JSComboBox::JSComboBox(JSDialogSender* pSender, ::ComboBox* pComboBox, SalInstanceBuilder* pBuilder,
@@ -814,25 +817,25 @@ void JSComboBox::insert(int pos, const OUString& rStr, const OUString* pId,
const OUString* pIconName, VirtualDevice* pImageSurface)
{
SalInstanceComboBoxWithEdit::insert(pos, rStr, pId, pIconName, pImageSurface);
- sendFullUpdate();
+ sendUpdate();
}
void JSComboBox::remove(int pos)
{
SalInstanceComboBoxWithEdit::remove(pos);
- sendFullUpdate();
+ sendUpdate();
}
void JSComboBox::set_entry_text(const OUString& rText)
{
SalInstanceComboBoxWithEdit::set_entry_text(rText);
- sendFullUpdate();
+ sendUpdate();
}
void JSComboBox::set_active(int pos)
{
SalInstanceComboBoxWithEdit::set_active(pos);
- sendFullUpdate();
+ sendUpdate();
}
JSNotebook::JSNotebook(JSDialogSender* pSender, ::TabControl* pControl,
@@ -884,7 +887,7 @@ JSSpinButton::JSSpinButton(JSDialogSender* pSender, ::FormattedField* pSpin,
void JSSpinButton::set_value(int value)
{
SalInstanceSpinButton::set_value(value);
- sendFullUpdate(true); // if input is limited we can receive the same JSON
+ sendUpdate(true); // if input is limited we can receive the same JSON
}
JSMessageDialog::JSMessageDialog(JSDialogSender* pSender, ::MessageDialog* pDialog,
@@ -924,7 +927,7 @@ JSCheckButton::JSCheckButton(JSDialogSender* pSender, ::CheckBox* pCheckBox,
void JSCheckButton::set_active(bool active)
{
SalInstanceCheckButton::set_active(active);
- sendFullUpdate();
+ sendUpdate();
}
JSDrawingArea::JSDrawingArea(JSDialogSender* pSender, VclDrawingArea* pDrawingArea,
@@ -938,13 +941,13 @@ JSDrawingArea::JSDrawingArea(JSDialogSender* pSender, VclDrawingArea* pDrawingAr
void JSDrawingArea::queue_draw()
{
SalInstanceDrawingArea::queue_draw();
- sendFullUpdate();
+ sendUpdate();
}
void JSDrawingArea::queue_draw_area(int x, int y, int width, int height)
{
SalInstanceDrawingArea::queue_draw_area(x, y, width, height);
- sendFullUpdate();
+ sendUpdate();
}
JSToolbar::JSToolbar(JSDialogSender* pSender, ::ToolBox* pToolbox, SalInstanceBuilder* pBuilder,
@@ -963,7 +966,7 @@ JSTextView::JSTextView(JSDialogSender* pSender, ::VclMultiLineEdit* pTextView,
void JSTextView::set_text(const OUString& rText)
{
SalInstanceTextView::set_text(rText);
- sendFullUpdate();
+ sendUpdate();
}
JSTreeView::JSTreeView(JSDialogSender* pSender, ::SvTabListBox* pTreeView,
@@ -1081,7 +1084,7 @@ JSExpander::JSExpander(JSDialogSender* pSender, ::VclExpander* pExpander,
void JSExpander::set_expanded(bool bExpand)
{
SalInstanceExpander::set_expanded(bExpand);
- sendFullUpdate();
+ sendUpdate();
}
JSIconView::JSIconView(JSDialogSender* pSender, ::IconView* pIconView, SalInstanceBuilder* pBuilder,
@@ -1094,32 +1097,32 @@ void JSIconView::insert(int pos, const OUString* pStr, const OUString* pId,
const OUString* pIconName, weld::TreeIter* pRet)
{
SalInstanceIconView::insert(pos, pStr, pId, pIconName, pRet);
- sendFullUpdate();
+ sendUpdate();
}
void JSIconView::insert(int pos, const OUString* pStr, const OUString* pId,
const VirtualDevice* pIcon, weld::TreeIter* pRet)
{
SalInstanceIconView::insert(pos, pStr, pId, pIcon, pRet);
- sendFullUpdate();
+ sendUpdate();
}
void JSIconView::clear()
{
SalInstanceIconView::clear();
- sendFullUpdate();
+ sendUpdate();
}
void JSIconView::select(int pos)
{
SalInstanceIconView::select(pos);
- sendFullUpdate();
+ sendUpdate();
}
void JSIconView::unselect(int pos)
{
SalInstanceIconView::unselect(pos);
- sendFullUpdate();
+ sendUpdate();
}
JSRadioButton::JSRadioButton(JSDialogSender* pSender, ::RadioButton* pRadioButton,
@@ -1132,7 +1135,7 @@ JSRadioButton::JSRadioButton(JSDialogSender* pSender, ::RadioButton* pRadioButto
void JSRadioButton::set_active(bool active)
{
SalInstanceRadioButton::set_active(active);
- sendFullUpdate();
+ sendUpdate();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */