The calc formula toolbar bar has a 'Sigma' button on it - this inserts a sum - which is all well and good, however - it would be nice to have a drop-down with a selection of other formulae to insert in there: SUM, AVERAGE, COUNT, etc. - similar to the selection available in the status bar for selections.
The code that inserts this item into a toolbar is here:
sc/source/ui/app/inputwin.cxx- InsertItem (SID_INPUT_SUM, Image(BitmapEx(RID_BMP_INPUT_SUM)), ToolBoxItemBits::NONE, 3);
We could insert a more complex toolbar item containing a drop-down instead.
Also a good idea to read the:
$ git grep -5 ToolBoxItemBits::DROPDOWN # output
and also checkout vcl/source/window/toolbox2.cxx to see how this can be populated.
(In reply to Michael Meeks from comment #1)
(In reply to Michael Meeks from comment #0)
> The calc formula toolbar bar has a 'Sigma' button on it - this inserts a sum
> - which is all well and good, however - it would be nice to have a drop-down
> with a selection of other formulae to insert in there: SUM, AVERAGE, COUNT,
> etc. - similar to the selection available in the status bar for selections.
Is it selection available in sidebar bar ?
I have 2 mockups one is the currency dropdown menu (https://drive.google.com/file/d/1y9pUVYLlQlDGcJE09oZZYwo-hsIYN5Tt/view?usp=sharing ) and other is conditional formatting dropdown menu ( https://drive.google.com/open?id=1OEk03NWWVTlRJoyJcSE3_9_Ao896jO7t ).
We can use any of them depending on the number of functions to be added in the drop-down menu.
Would you please let me know how you want the drop-down menu to be ?
I guess Michael wants it to be similar to Microsoft Excel's AutoSum feature, and that in my opinion will be a nice and handy tool to have. I can start working on it.
Sure - so I think people get the idea generally - I hoped it was fairly clear from the description ;-) The key is digging another drop-down toolbar button out of the code to see how it is done I guess.
(In reply to ranjan.purbey from comment #3)
> I guess Michael wants it to be similar to Microsoft Excel's AutoSum feature,
> and that in my opinion will be a nice and handy tool to have. I can start
> working on it.
I was working on this issue but if you have already started, Here are my findings and code pointers.
toolBoxItemBits::DROPDOWN - vcl/source/window/toolbox.cxx
Related forumla and sigma button files
: sc/source/ui/view/tabvwshc.cxx line :736
: sc/source/ui/view/viewfunc.cxx line :673
: sc/source/ui/app/inputwin.cxx line :372
Also , similar patch https://gerrit.libreoffice.org/#/c/22958/ .
Please let me know @ranjan.purbey.
Hi Sumit - nice work systematically building notes on code pointers! =) that's the way to solve ~any tough problem; good stuff.
Hey mmeeks , can you assign this bug to me. So ,that no two people are working on the same bug.
(In reply to Sumit Chauhan from comment #7)
> Hey mmeeks , can you assign this bug to me. So ,that no two people are
> working on the same bug.
Done, you have rights to do it yourself as well!
A polite ping, still working on this bug?
(In reply to Xisco Faulí from comment #9)
> A polite ping, still working on this bug?
Yes , I am working but facing difficulty with UI. I will try to finish it as soon as possible.
Hi Sumit - thanks for persisting with this one =) the patch in:
Seems unlikely to work to me. The InputWindow in calc doesn't appear to be handled by the framework it seems (the framework code handles all this XML / config item stuff).
Instead it would be better to focus on adding the drop-down items to the toolbar item around the line that I identified. This requires reading the toolbox headers and un-winding how the API works in this regard I think.
Possibly it means inserting a control into the toolbar that has the drop-down; may be best to try re-using the SfxCurrencyToolboxControl in this location initially.
Otherwise - what Eike said =)
I'd love to see more code reading notes and/or bits of test code you've tried for inserting custom items into the toolbar - and any success you've had there.
Sumit, are you still working on this bug? There is another GSoC hopeful that wants to work on it.
(In reply to Tor Lillqvist from comment #12)
> Sumit, are you still working on this bug? There is another GSoC hopeful that
> wants to work on it.
The formula bar is not build using glade or .ui file but using some predefined functions.This makes it much more difficult to complete.
Currently , I am not working on this bug. Someone else can do it.
Hi, I have been looking at the files for sometime now and I found one more patch that has been used to modify the code in some way
As I am new to libreoffice, I don't know why the code modification was required other than to fix wayland issue.
So, can anyone confirm that I should implement the drop down using the current currency drop down code (changed by the above mentioned patch) or the one that was merged with the first patch:
Thanks in advance
Hi, I think there could be a better way to handle this. There exists an implementation of formula toolbar in writer where a dropdown is avaliable for autosum button.
Hi, I have submitted the patch at :
Please review the same
Gagandeep Singh committed a patch related to this issue.
It has been pushed to "master":
It will be available in 6.3.0.
The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.