Re: [PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc, part 2
HI Marcus, Sorry for not replying until now. Forgot to CC the list again... On Tue, Jun 5, 2012 at 3:13 AM, Markus Mohrhard markus.mohrh...@googlemail.com wrote: Hey Albert, I already had a quick look at the closing problem and it seems it is not a crash. It looks more like a missing close handler which results in the parent window being closed which is in this case the LibO window but I need to spend some more time on it. I will spend next week on your patch and make sure that it is ready for 3-6. I finally had time to fix the issue with your patch and pushed it to master. The problem has been that vcl's window class destructor checks that all child windows are destroyed in dbgutil builds and your design did not ensure this. The changes that I did to your patch are in http://cgit.freedesktop.org/libreoffice/core/commit/?id=57e35b0ed54a2e74c107493869e72ab7eb86222a. I also fixed a crash that I noticed when using more than 3 sort entries. I checked and the dialog looks good now. Thanks for fixing this and getting it into 3.6! Also thanks for your support during this work, I could not have done this without your help. I'm very happy to see this being finished, although not so happy about how long it took me to do this, but at least I learned a lot along the way. Thanks a lot for this amazing work. I added it to the 3.6 release notes page. I added a reference to the bug and a screenshot to the release notes. Regards, Markus I have a few things lined up which I want to do next. For instance, do you mind if I take a stab at this one: https://bugs.freedesktop.org/show_bug.cgi?id=43937 I guess to fix this bug the best would be to implement the same UI-magic here, as what I just did for the sort dialog. /Albert ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc, part 2
Hey Albert, Thanks a lot for this amazing work. I added it to the 3.6 release notes page. I added a reference to the bug and a screenshot to the release notes. Great. The screenshot looks really good. I have a few things lined up which I want to do next. For instance, do you mind if I take a stab at this one: https://bugs.freedesktop.org/show_bug.cgi?id=43937 I guess to fix this bug the best would be to implement the same UI-magic here, as what I just did for the sort dialog. Oh this one is already implemented just not yet pushed. If you're interested in this area there are many more dialogs that would benefit from a rework. Please let me know if this is something you want to do. Then we could discuss with the UX guys which dialog they would prefer to convert. Regards, Markus ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc, part 2
Hey Albert, I already had a quick look at the closing problem and it seems it is not a crash. It looks more like a missing close handler which results in the parent window being closed which is in this case the LibO window but I need to spend some more time on it. I will spend next week on your patch and make sure that it is ready for 3-6. I finally had time to fix the issue with your patch and pushed it to master. The problem has been that vcl's window class destructor checks that all child windows are destroyed in dbgutil builds and your design did not ensure this. The changes that I did to your patch are in http://cgit.freedesktop.org/libreoffice/core/commit/?id=57e35b0ed54a2e74c107493869e72ab7eb86222a. I also fixed a crash that I noticed when using more than 3 sort entries. I checked and the dialog looks good now. Thanks a lot for this amazing work. I added it to the 3.6 release notes page. Regards, Markus ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc, part 2
Hey Albert, 2012/5/24 Albert Thuswaldner albert.thuswald...@gmail.com: Hi Andras, Thanks for taking your time to reply. On Tue, May 22, 2012 at 5:50 PM, Andras Timar tima...@gmail.com wrote: Hi Albert, 2012/5/18 Markus Mohrhard markus.mohrh...@googlemail.com: This one is quite simple. we need to move the identifiers out of the 0 to 255 range. Andras, do you have an idea what range is useable in sc for this? I think most of the 256 to 999 range is already used but I have no idea where to check this. Sorry, I did not notice this mail. I hope it's not too late. Please find attached a Perl script. You can move this script and scen-US.res in a folder, run 'perl ./index.pl scen-US.res | sort -n' and you will see the used global identifiers in sc module. I ran your script and it worked as expected. I've updated the global ids accordingly. Thanks for your help. :) However, I find peculiar that you put a Listbox and and Fixedline outside a dialog context, on their own. If it works, why not, it just looks strange to me. :) Well I'm only copying an existing design based on Marcus advice. So it is not my crazy idea. ;) I've looked at your patch and it looks really nice. Just one minor question: Is there an add and a remove button? I already had a quick look at the closing problem and it seems it is not a crash. It looks more like a missing close handler which results in the parent window being closed which is in this case the LibO window but I need to spend some more time on it. I will spend next week on your patch and make sure that it is ready for 3-6. Regards, Markus ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc, part 2
Hi Andras, Thanks for taking your time to reply. On Tue, May 22, 2012 at 5:50 PM, Andras Timar tima...@gmail.com wrote: Hi Albert, 2012/5/18 Markus Mohrhard markus.mohrh...@googlemail.com: This one is quite simple. we need to move the identifiers out of the 0 to 255 range. Andras, do you have an idea what range is useable in sc for this? I think most of the 256 to 999 range is already used but I have no idea where to check this. Sorry, I did not notice this mail. I hope it's not too late. Please find attached a Perl script. You can move this script and scen-US.res in a folder, run 'perl ./index.pl scen-US.res | sort -n' and you will see the used global identifiers in sc module. I ran your script and it worked as expected. I've updated the global ids accordingly. Thanks for your help. :) However, I find peculiar that you put a Listbox and and Fixedline outside a dialog context, on their own. If it works, why not, it just looks strange to me. :) Well I'm only copying an existing design based on Marcus advice. So it is not my crazy idea. ;) /Albert From d5b4a11f9e271cacf61a5e191bb98e364f0c3ca4 Mon Sep 17 00:00:00 2001 From: Albert Thuswaldner albert.thuswald...@gmail.com Date: Mon, 21 May 2012 23:04:12 +0200 Subject: [PATCH] fdo#45747 remove the limitation to 3 sort entries in calc part2 Change-Id: I699c424f536b0096b35d3db3aee371793e9e56c4 --- sc/Library_scui.mk|1 + sc/inc/helpids.h |1 + sc/inc/sc.hrc |4 +- sc/source/ui/dbgui/sortkeydlg.cxx | 196 sc/source/ui/dbgui/tpsort.cxx | 255 - sc/source/ui/inc/sortdlg.hrc | 21 ++-- sc/source/ui/inc/sortkeydlg.hxx | 107 sc/source/ui/inc/tpsort.hxx | 28 + sc/source/ui/src/sortdlg.src | 142 +++-- 9 files changed, 483 insertions(+), 272 deletions(-) create mode 100644 sc/source/ui/dbgui/sortkeydlg.cxx create mode 100644 sc/source/ui/inc/sortkeydlg.hxx diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk index 9af5a63..37478a2 100644 --- a/sc/Library_scui.mk +++ b/sc/Library_scui.mk @@ -72,6 +72,7 @@ $(eval $(call gb_Library_add_exception_objects,scui,\ sc/source/ui/dbgui/scuiasciiopt \ sc/source/ui/dbgui/scuiimoptdlg \ sc/source/ui/dbgui/sortdlg \ +sc/source/ui/dbgui/sortkeydlg \ sc/source/ui/dbgui/subtdlg \ sc/source/ui/dbgui/textimportoptions \ sc/source/ui/dbgui/tpsort \ diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h index 8d41ab7..7c5955c 100644 --- a/sc/inc/helpids.h +++ b/sc/inc/helpids.h @@ -88,6 +88,7 @@ #define HID_SC_FORM_ARGSSC_HID_SC_FORM_ARGS #define HID_SCPAGE_SORT_FIELDS SC_HID_SCPAGE_SORT_FIELDS #define HID_SCPAGE_SORT_OPTIONS SC_HID_SCPAGE_SORT_OPTIONS +#define HID_SCPAGE_SORTKEY_FIELDS SC_HID_SCPAGE_SORTKEY_FIELDS #define HID_SCPAGE_SUBT_OPTIONS SC_HID_SCPAGE_SUBT_OPTIONS #define HID_SCPAGE_SUBT_GROUP SC_HID_SCPAGE_SUBT_GROUP #define HID_SCPAGE_PROTECTION SC_HID_SCPAGE_PROTECTION diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 59b6564..ee8c042 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1225,7 +1225,9 @@ #define RID_POPUP_FILTER(SC_DIALOGS_START + 153) #define RID_SCDLG_TAB_BG_COLOR (SC_DIALOGS_START + 154) -#define SC_DIALOGS_END (SC_DIALOGS_START + 155) +#define RID_SCPAGE_SORTKEY_FIELDS (SC_DIALOGS_START + 155) +#define RID_SCDLG_SORTKEY (SC_DIALOGS_START + 156) +#define SC_DIALOGS_END (SC_DIALOGS_START + 157) #ifndef STD_MASKCOLOR #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x; Blue = 0xFF00; } diff --git a/sc/source/ui/dbgui/sortkeydlg.cxx b/sc/source/ui/dbgui/sortkeydlg.cxx new file mode 100644 index 000..0801b8d --- /dev/null +++ b/sc/source/ui/dbgui/sortkeydlg.cxx @@ -0,0 +1,196 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the License); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Albert Thuswaldner albert.thuswald...@gmail.com (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + *
Re: [PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc, part 2
Hi Albert, 2012/5/18 Markus Mohrhard markus.mohrh...@googlemail.com: This one is quite simple. we need to move the identifiers out of the 0 to 255 range. Andras, do you have an idea what range is useable in sc for this? I think most of the 256 to 999 range is already used but I have no idea where to check this. Sorry, I did not notice this mail. I hope it's not too late. Please find attached a Perl script. You can move this script and scen-US.res in a folder, run 'perl ./index.pl scen-US.res | sort -n' and you will see the used global identifiers in sc module. However, I find peculiar that you put a Listbox and and Fixedline outside a dialog context, on their own. If it works, why not, it just looks strange to me. :) Good luck! Andras index.pl Description: Perl program ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc, part 2
Hi Markus, Forgot to CC the list in my previous mail, sorry for the noise. The patch in the last mail was also wrong. On Fri, May 18, 2012 at 12:10 PM, Markus Mohrhard markus.mohrh...@googlemail.com wrote: Hello Albert, Sorry that it took me a bit to review your patch but my master trees are totally screwed for my own feature. I now checked your patch and solved the conflicts that were related to my last fix for sort dialogs. Attached you'll find a patch that applies cleanly on master. Thanks. I checked the dialog and it looks like we need to move some items a bit. Yea, that's related to different themes/widget set, I guess. It looks great on my computer running LO under KDE. I had a fixed offset which dictated the spacing between two sort key items, in the new patch I now calculate the spacing based on position and height of the widgets. Still not perfect, needs some wiggling. It would be great if someone could help out with this :) I've attached a simple patch showing how to do this. The patch will not compile but shows already the basic ideas. The idea is to move the ScSortKeyItems variable into tpsort and only pass a reference. I think a good final step is to use a boost::ptr_vector which will control the lifetime of the contained objects. Thanks for the code pointer regarding the reference, It was along the line what I was thinking. I've now implemented this using boost::ptr_vector in the new patch. It seems to work, however strangely enough LO now segfaults on exit of the sort dialog. The stack trace suggest the problem to be in the Window class, however boost::ptr_vector should take care of the deletion of its members, so no dedicated destructor should be necessary. I'm confused... Could you have a look at this problem. Thanks. I'm feeling the heat of the feature freeze... /Albert From 1237b47bd646285deebc792a469e509640233b79 Mon Sep 17 00:00:00 2001 From: Albert Thuswaldner albert.thuswald...@gmail.com Date: Mon, 21 May 2012 23:04:12 +0200 Subject: [PATCH] fdo#45747 remove the limitation to 3 sort entries in calc part2 Change-Id: I699c424f536b0096b35d3db3aee371793e9e56c4 --- sc/Library_scui.mk|1 + sc/inc/helpids.h |1 + sc/inc/sc.hrc |4 +- sc/source/ui/dbgui/sortkeydlg.cxx | 196 sc/source/ui/dbgui/tpsort.cxx | 255 - sc/source/ui/inc/sortdlg.hrc | 23 ++-- sc/source/ui/inc/sortkeydlg.hxx | 107 sc/source/ui/inc/tpsort.hxx | 28 + sc/source/ui/src/sortdlg.src | 142 +++-- 9 files changed, 485 insertions(+), 272 deletions(-) create mode 100644 sc/source/ui/dbgui/sortkeydlg.cxx create mode 100644 sc/source/ui/inc/sortkeydlg.hxx diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk index 9af5a63..37478a2 100644 --- a/sc/Library_scui.mk +++ b/sc/Library_scui.mk @@ -72,6 +72,7 @@ $(eval $(call gb_Library_add_exception_objects,scui,\ sc/source/ui/dbgui/scuiasciiopt \ sc/source/ui/dbgui/scuiimoptdlg \ sc/source/ui/dbgui/sortdlg \ +sc/source/ui/dbgui/sortkeydlg \ sc/source/ui/dbgui/subtdlg \ sc/source/ui/dbgui/textimportoptions \ sc/source/ui/dbgui/tpsort \ diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h index 8d41ab7..7c5955c 100644 --- a/sc/inc/helpids.h +++ b/sc/inc/helpids.h @@ -88,6 +88,7 @@ #define HID_SC_FORM_ARGSSC_HID_SC_FORM_ARGS #define HID_SCPAGE_SORT_FIELDS SC_HID_SCPAGE_SORT_FIELDS #define HID_SCPAGE_SORT_OPTIONS SC_HID_SCPAGE_SORT_OPTIONS +#define HID_SCPAGE_SORTKEY_FIELDS SC_HID_SCPAGE_SORTKEY_FIELDS #define HID_SCPAGE_SUBT_OPTIONS SC_HID_SCPAGE_SUBT_OPTIONS #define HID_SCPAGE_SUBT_GROUP SC_HID_SCPAGE_SUBT_GROUP #define HID_SCPAGE_PROTECTION SC_HID_SCPAGE_PROTECTION diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 59b6564..ee8c042 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1225,7 +1225,9 @@ #define RID_POPUP_FILTER(SC_DIALOGS_START + 153) #define RID_SCDLG_TAB_BG_COLOR (SC_DIALOGS_START + 154) -#define SC_DIALOGS_END (SC_DIALOGS_START + 155) +#define RID_SCPAGE_SORTKEY_FIELDS (SC_DIALOGS_START + 155) +#define RID_SCDLG_SORTKEY (SC_DIALOGS_START + 156) +#define SC_DIALOGS_END (SC_DIALOGS_START + 157) #ifndef STD_MASKCOLOR #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x; Blue = 0xFF00; } diff --git a/sc/source/ui/dbgui/sortkeydlg.cxx b/sc/source/ui/dbgui/sortkeydlg.cxx new file mode 100644 index 000..0801b8d --- /dev/null +++ b/sc/source/ui/dbgui/sortkeydlg.cxx @@ -0,0 +1,196 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+
Re: [PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc, part 2
Hi Marcus, Here is an updated patch which I hope you have time to review. I'm sure that there are things that can be done differently, but basically the patch works. I have found two problems myself that I need help resolving: 1.) Compile time waring about resources ids. There is probably a simple fix for this, I think I understand the problem but not what to do about it. f4099: /home/thuswa/work/libo2/sc/source/ui/src/sortdlg.src, line 60: Warning in the object (Type: ListBox, 15): Global resources should have an identifier = 256. Pos = MAP_APPFONT ( 172 , 11 ) ; ^ f4099: /home/thuswa/work/libo2/sc/source/ui/src/sortdlg.src, line 68: Warning in the object (Type: RadioButton, 16): Global resources should have an identifier = 256. Pos = MAP_APPFONT ( 172 , 25 ) ; ^ f4099: /home/thuswa/work/libo2/sc/source/ui/src/sortdlg.src, line 75: Warning in the object (Type: RadioButton, 17): Global resources should have an identifier = 256. Pos = MAP_APPFONT ( 6 , 0 ) ; ^ f4099: /home/thuswa/work/libo2/sc/source/ui/src/sortdlg.src, line 82: Warning in the object (Type: FixedLine, 14): Global resources should have an identifier = 256. [ build DEP ] SRS:sc/res 2.) to return a pointer to the vector containing the ui widgets is of course not ideal, see below: ScSortKeyItems* ScSortKeyWindow::AddSortKey( sal_uInt16 nItem ) ScSortKeyItems* ScSortKeyCtrl::AddSortKey( sal_uInt16 nItem ) Instead I probably should create a reference when I initialize ScSortKeyCtrl and ScSortKeyWindow, but I'm not exactly sure how to do this. Thanks for your help. /Albert From 19c965f654ec408b6a7ad4b44d390033ef5729d0 Mon Sep 17 00:00:00 2001 From: Albert Thuswaldner albert.thuswald...@gmail.com Date: Thu, 26 Apr 2012 23:35:46 +0200 Subject: [PATCH] fdo#45747 - remove the limitation to 3 sort entries in calc, part 2 --- sc/Library_scui.mk|1 + sc/inc/helpids.h |1 + sc/inc/sc.hrc |4 +- sc/source/ui/dbgui/sortkeydlg.cxx | 213 + sc/source/ui/dbgui/tpsort.cxx | 186 ++-- sc/source/ui/inc/sortdlg.hrc | 23 ++-- sc/source/ui/inc/sortkeydlg.hxx | 110 +++ sc/source/ui/inc/tpsort.hxx | 24 + sc/source/ui/src/sortdlg.src | 141 + 9 files changed, 473 insertions(+), 230 deletions(-) create mode 100644 sc/source/ui/dbgui/sortkeydlg.cxx create mode 100644 sc/source/ui/inc/sortkeydlg.hxx diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk index 9af5a63..37478a2 100644 --- a/sc/Library_scui.mk +++ b/sc/Library_scui.mk @@ -72,6 +72,7 @@ $(eval $(call gb_Library_add_exception_objects,scui,\ sc/source/ui/dbgui/scuiasciiopt \ sc/source/ui/dbgui/scuiimoptdlg \ sc/source/ui/dbgui/sortdlg \ +sc/source/ui/dbgui/sortkeydlg \ sc/source/ui/dbgui/subtdlg \ sc/source/ui/dbgui/textimportoptions \ sc/source/ui/dbgui/tpsort \ diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h index 5eec0d1..03b9f40 100644 --- a/sc/inc/helpids.h +++ b/sc/inc/helpids.h @@ -88,6 +88,7 @@ #define HID_SC_FORM_ARGSSC_HID_SC_FORM_ARGS #define HID_SCPAGE_SORT_FIELDS SC_HID_SCPAGE_SORT_FIELDS #define HID_SCPAGE_SORT_OPTIONS SC_HID_SCPAGE_SORT_OPTIONS +#define HID_SCPAGE_SORTKEY_FIELDS SC_HID_SCPAGE_SORTKEY_FIELDS #define HID_SCPAGE_SUBT_OPTIONS SC_HID_SCPAGE_SUBT_OPTIONS #define HID_SCPAGE_SUBT_GROUP SC_HID_SCPAGE_SUBT_GROUP #define HID_SCPAGE_PROTECTION SC_HID_SCPAGE_PROTECTION diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index f8b1875..25b90fe 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1221,7 +1221,9 @@ #define RID_POPUP_FILTER(SC_DIALOGS_START + 153) #define RID_SCDLG_TAB_BG_COLOR (SC_DIALOGS_START + 154) -#define SC_DIALOGS_END (SC_DIALOGS_START + 155) +#define RID_SCPAGE_SORTKEY_FIELDS (SC_DIALOGS_START + 155) +#define RID_SCDLG_SORTKEY (SC_DIALOGS_START + 156) +#define SC_DIALOGS_END (SC_DIALOGS_START + 157) #ifndef STD_MASKCOLOR #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x; Blue = 0xFF00; } diff --git a/sc/source/ui/dbgui/sortkeydlg.cxx b/sc/source/ui/dbgui/sortkeydlg.cxx new file mode 100644 index 000..747f886 --- /dev/null +++ b/sc/source/ui/dbgui/sortkeydlg.cxx @@ -0,0 +1,213 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the License); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software
Re: [PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc, part 2
Servus Markus, Just an update on what I've been doing on this. On Sun, Apr 29, 2012 at 4:37 PM, Markus Mohrhard markus.mohrh...@googlemail.com wrote: So far so good I think, then comes the ugly bits: 1.) Obviously I'm using the wrong widget class for ScSortKeyDlg since each dialog opens in a separate window and are not embedded in the main dialog. Which widget should I use here? Yeap. You need to derive from a Control and not from a Window. A good example for such a concept is SfxDocumentInfoDialog with the CustomProperties* classes. They already implement something similar and we can copy most of the ideas from there. I've solved this part like this: Tab page class - Controller class - Window class - Struct {FixedLine, ListBox, RadioBtnUp, RadiobtnDown } Basically copying the set-up of SfxDocumentInfoDialog, I've tested this part and it works like a charm! 2.) Related to the above is the question about how to position the sort key dialogs relative to each other. We need to write the code that calculates the position of sort entries. We will position them inside another control so the positioning has to be done only relative to the control. I've implemented the scroll handler but I haven't tested it yet. 3.) The Listbox handler. The handler is used to enable/disable the widigets of the subsequent sort key(s). Now that each sort key is an instance of its own I'm not sure how to get the signal across form one instance to the other. Can I catch this event in the control class? There are at least two solutions to this. First one is to give the sort entry a reference to the class that needs to know about it or implement the handler already in that class. This part was simple, It is basically the same handler as before, only slightly modifed. For now i put this implementation in the Window class, but I'm thinking of moving it back were it was before i.e in the tabpage class. I've tested this as it is now and it works! Overall I'm still contemplating a bit where to put the code containing all the the logic behind the dialog. My second attempt here was to move everything from the tab page class to the window class, but I this turned out to create more messy code than I had anticipated. So now I'm opting to keep much of the code intact in the tab page class. I need to re-wind a bit here, before I have a working patch to submit. /Albert ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc, part 2
Hey Albert, So I have hacked a bit on the UI for the new sort dialog in calc. I'm posting my work-in-progress patch hoping to get confirmation that I'm on the right track and also help with the specific issues below. As you suggested I've used the same concept for as in namedlg, where I created ScSortKeyDlg class which defines the dialog for a single sort key entry. this class is then instantiated via a control class. It is a bit more complex in this case. We have the Dialog class that contains the window. In the dialog class we will have some buttons and a control that provides the list functionality. This control will then contain all sort entries which are itself new controls. We have at least one dialog which is already working like that: So what we need to do right now is to first create the control for a sort entry. That should be quite straight forward and will mostly be copying the existing elements into an own control. Then create a control that provides a list functionality (we already have such controls, we just need to adapt some methods) and write the scroll handler for this control. Then we should be nearly ready to include it into the Dialog. So far so good I think, then comes the ugly bits: 1.) Obviously I'm using the wrong widget class for ScSortKeyDlg since each dialog opens in a separate window and are not embedded in the main dialog. Which widget should I use here? Yeap. You need to derive from a Control and not from a Window. A good example for such a concept is SfxDocumentInfoDialog with the CustomProperties* classes. They already implement something similar and we can copy most of the ideas from there. 2.) Related to the above is the question about how to position the sort key dialogs relative to each other. We need to write the code that calculates the position of sort entries. We will position them inside another control so the positioning has to be done only relative to the control. 3.) The Listbox handler. The handler is used to enable/disable the widigets of the subsequent sort key(s). Now that each sort key is an instance of its own I'm not sure how to get the signal across form one instance to the other. Can I catch this event in the control class? There are at least two solutions to this. First one is to give the sort entry a reference to the class that needs to know about it or implement the handler already in that class. Regards, Markus ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice