Author Topic: User interface for project glob feature  (Read 149 times)

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1919
User interface for project glob feature
« on: Yesterday at 05:51:03 am »
Hi,
i implemented a user interface and scripting interface for the project glob api, that was introduced 7 years ago, but never used over UI:
http://forums.codeblocks.org/index.php/topic,16958.0.html

i think this is a nice feature specially if you use a custom make file.. .

The implementation is currently here https://github.com/bluehazzard/codeblocks_sf/tree/test/UnitsGlob/ui/1
i will provide a patch and a ticket on SF as soon as someone shows interest....

Attached is a screenshot of the UI

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10967
    • Travis build status
Re: User interface for project glob feature
« Reply #1 on: Yesterday at 10:20:19 am »
What is this control? It looks ugly. Also you need to provide an edit button.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1919
Re: User interface for project glob feature
« Reply #2 on: Yesterday at 11:56:25 am »
yes it is ugly... It is a wxGrid controll. I tried to use a wxListCtrl, but there you can not edit the second column. I did not wanted to add a second dialog, where you input the parameter and hit ok. With this control you can in place edit everything. Fast and easy...

Quote
Also you need to provide an edit button.
I will try to add an "search" button in the first column that opens the path control (that one used by the project search paths)... As far as i can see this is also more easily made with the wxGrid control then the wxListCtrl. A other possibility would be wxPropGrid, but i am annoyed by the different implementations in wx2.8 and wx3.0....

More suggestions welcome

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10967
    • Travis build status
Re: User interface for project glob feature
« Reply #3 on: Yesterday at 01:28:28 pm »
It is common for C::B's UI to open secondary dialogs where stuff is edited. I don't know why this bothers you.

wxPG isn't that different in wx28 and 3x from the calling code. The wx3.x is just more buggy. :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1919
Re: User interface for project glob feature
« Reply #4 on: Yesterday at 02:58:38 pm »
Quote
It is common for C::B's UI to open secondary dialogs where stuff is edited.
and i hate it... If you want to change one letter in 3 libraries (to add a debug "d" for example) you have to click 12 times  3x(select entry, open dialog, activate, close dialog), instead of 3 times (select entry and set cursor at correct position at the same time)... Quick copy and paste? Naaa forget it... you have open a dialog to get the value... Don't put design over usability, we have this crap everywhere in the new web and programing....


[Edit:] i have found wxDataViewCtrl  (http://docs.wxwidgets.org/trunk/classwx_data_view_ctrl.html) and will have a look into it. It look like the control we need
[Edit2:] This control is only available wx>2.9 ;(
« Last Edit: Yesterday at 03:21:57 pm by BlueHazzard »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10967
    • Travis build status
Re: User interface for project glob feature
« Reply #5 on: Yesterday at 05:43:13 pm »
I doubt it would be common to want to change all entries. What would be this situation?
And consistency is a good thing. It surprises users less.

wxDVC seems like the control with the most bugs and it is also ugly.

p.s. For the libs UI you can probably make a UI based on wxTextCtrl, but editable wxListCtrl would also work. I think this was possible to have editable wxListCtrls in wx. If you're interested to test it I'd be happy to review such patch.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1919
Re: User interface for project glob feature
« Reply #6 on: Yesterday at 06:52:44 pm »
Ok, i looked a bit into it:

*) wxListCtrl can not be changed, that other columns but the first can be edited (https://forums.wxwidgets.org/viewtopic.php?t=39593) The supposed way is to use the wxDataViewCtrl
*) in wx2.8 wxDataViewCtrl is implemented only rudimentary. You have to add a Data provider class ecc... It differs from the wx2.9 implementation. There is a nice interface to add columns and manage them with less code http://docs.wxwidgets.org/trunk/classwx_data_view_list_ctrl.html This class does not exist in wx2.8

Quote
I doubt it would be common to want to change all entries. What would be this situation?
I gave you an example:
Changing from release to debug libraries or for example wx2.8 to wx30.
Copy and paste many paths from one project to a other over a text file... From a make file to codeblocks...
I don't know, i had so many situations where a lot editing had to be done... Editing the cbp file directly is also no real alternative because of the xml file format...
I had this problems for the library setting and i see that coming for this settings, so i wanted to mitigate this with a ui where every field is editable in place...

So what is to do?
1) If we use the  wxDataViewCtrl  i am not really willing to implement it in wx2.8. So this UI would be only for cb wx3.0 and past (it is better as now, because now is no ui for no wx version)
2) Pimp the wxGrid so that it looks better? ( kicad uses this control a lot, so we could look if they have some nice changes)
3) Use property grid.
4) Use wxListCtrl and make a separate dialog for editing (not my favorite.... Adding a other dialog... Not being able to edit in place...)
[EDIT:]
5) Using wxListCtrl  but make the whole dialog bigger so there is a wxTextCtrl for every column. You select the entry in the ListCtrl on the left and the values from the textCtrls get updated on the right... Something like this http://wxdsgn.sourceforge.net/images/tutorials/Multicolumn_table_using_virtual_wxListCtrl_Tutorial.files/image046.jpg
« Last Edit: Yesterday at 06:56:59 pm by BlueHazzard »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10967
    • Travis build status
Re: User interface for project glob feature
« Reply #7 on: Yesterday at 07:13:17 pm »
Quote
I doubt it would be common to want to change all entries. What would be this situation?
I gave you an example:
Changing from release to debug libraries or for example wx2.8 to wx30.
Copy and paste many paths from one project to a other over a text file... From a make file to codeblocks...
I don't know, i had so many situations where a lot editing had to be done... Editing the cbp file directly is also no real alternative because of the xml file format...
I had this problems for the library setting and i see that coming for this settings, so i wanted to mitigate this with a ui where every field is editable in place...
I was talking about the glob feature. Changing libraries in bulk is more common I agree.

So what is to do?
1) If we use the  wxDataViewCtrl  i am not really willing to implement it in wx2.8. So this UI would be only for cb wx3.0 and past (it is better as now, because now is no ui for no wx version)
2) Pimp the wxGrid so that it looks better? ( kicad uses this control a lot, so we could look if they have some nice changes)
3) Use property grid.
4) Use wxListCtrl and make a separate dialog for editing (not my favorite.... Adding a other dialog... Not being able to edit in place...)
[EDIT:]
5) Using wxListCtrl  but make the whole dialog bigger so there is a wxTextCtrl for every column. You select the entry in the ListCtrl on the left and the values from the textCtrls get updated on the right... Something like this http://wxdsgn.sourceforge.net/images/tutorials/Multicolumn_table_using_virtual_wxListCtrl_Tutorial.files/image046.jpg
1. I don't think wxDVC it is an option until we're at 3.2. wxDVS is something that is always active on the wx's issue tracker.
2. I doubt this would work. If we use wxGrid we should accept that it will be ugly and a bit hard to use. Keep in mind that many people don't know that the last row of the watches window is editable and they are confused.
3. Could probably work, but you'll have max 3 columns and only the second is easily editable. Editing the label is annoying and hard to get right if I remember correctly.
5. It is one or two clicks better than 4, but the UI will be confusing, so I don't think this is a good option.

So, I guess you have to choose between 2 and 4...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]