Bug 120697 - Calc: Drop-down on 'Sum' button
Summary: Calc: Drop-down on 'Sum' button
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Sumit Chauhan
URL:
Whiteboard:
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2018-10-19 07:42 UTC by Michael Meeks
Modified: 2019-01-21 11:03 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2018-10-19 07:42:55 UTC
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.
Comment 1 Michael Meeks 2018-10-19 07:52:47 UTC
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.
Comment 2 Sumit Chauhan 2018-12-20 14:58:09 UTC
(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 ?
Comment 3 ranjan.purbey 2018-12-20 18:39:54 UTC
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.
Comment 4 Michael Meeks 2018-12-20 20:37:33 UTC
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.
Comment 5 Sumit Chauhan 2018-12-21 06:59:05 UTC
(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 
                           - include/vcl/toolbox.hxx

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.
Comment 6 Michael Meeks 2018-12-21 10:25:32 UTC
Hi Sumit - nice work systematically building notes on code pointers! =) that's the way to solve ~any tough problem; good stuff.
Comment 7 Sumit Chauhan 2018-12-21 11:32:28 UTC
Hey mmeeks , can you assign this bug to me. So ,that no two people are working on the same bug.
Comment 8 Xisco Faulí 2018-12-21 11:36:02 UTC
(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!
Comment 9 Xisco Faulí 2019-01-21 03:38:13 UTC Comment hidden (obsolete)
Comment 10 Sumit Chauhan 2019-01-21 11:03:15 UTC
(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.