gui/wxpython/modules/colorrules.py, providing inteface for setting colortable for raster and vector.
As I reported on trac[1] several weeks ago there is a bug in the code which happens if no. color rules for raster map is big (eg: 32763 This for nc_spm_08/landsat 4,3,2 color composite) . This will result in crashing the whole wxGUI!
The problem is for each rule colorrules.py create a checkbox,textCtrl and ColorSelect.
Creating these widgets will hangup the UI.
A solution is to use a list control agw provides one such thing called ultimatelistCtrl.
I had updated the colorrules.py and made a patch for it. Anyone Please review and update the file
On Wed, Dec 19, 2012 at 4:39 PM, Mohammed Rashad
<mohammedrashadkm@gmail.com> wrote:
Hi All,
gui/wxpython/modules/colorrules.py, providing inteface for setting
colortable for raster and vector.
As I reported on trac[1] several weeks ago there is a bug in the code which
happens if no. color rules for raster map is big (eg: 32763 This for
nc_spm_08/landsat 4,3,2 color composite) . This will result in crashing the
whole wxGUI!
The problem is for each rule colorrules.py create a checkbox,textCtrl and
ColorSelect.
Creating these widgets will hangup the UI.
A solution is to use a list control agw provides one such thing called
ultimatelistCtrl.
I had updated the colorrules.py and made a patch for it. Anyone Please
review and update the file
Hi Rashad,
I can't even test your patch at the moment because UltimateListCtrl is
not supported in wxPython 2.8.10.1 (which is installed on my
computer). It seems that it is available from 2.8.11, however in the
grass requirements, there is wxPython >= 2.8.1.1. I agree that this
one is pretty old but still we must decide if it is worth changing the
requirements. I think that the version I have is still used a lot so
we should support it. You are using this widget to show the color I
suppose. I am not aware of any other good solution. Maybe you can a
condition on wxPython version and if it is high enough use this
widget, otherwise use the current implementation?
gui/wxpython/modules/colorrules.py, providing inteface for setting
colortable for raster and vector.
As I reported on trac[1] several weeks ago there is a bug in the code which
happens if no. color rules for raster map is big (eg: 32763 This for
nc_spm_08/landsat 4,3,2 color composite) . This will result in crashing the
whole wxGUI!
The problem is for each rule colorrules.py create a checkbox,textCtrl and
ColorSelect.
Creating these widgets will hangup the UI.
A solution is to use a list control agw provides one such thing called
ultimatelistCtrl.
I had updated the colorrules.py and made a patch for it. Anyone Please
review and update the file
Hi Rashad,
I can’t even test your patch at the moment because UltimateListCtrl is
not supported in wxPython 2.8.10.1 (which is installed on my
computer). It seems that it is available from 2.8.11, however in the
grass requirements, there is wxPython >= 2.8.1.1. I agree that this
one is pretty old but still we must decide if it is worth changing the
requirements. I think that the version I have is still used a lot so
we should support it. You are using this widget to show the color I
suppose. I am not aware of any other good solution. Maybe you can a
condition on wxPython version and if it is high enough use this
widget, otherwise use the current implementation?
gui/wxpython/modules/colorrules.py, providing inteface for setting
colortable for raster and vector.
As I reported on trac[1] several weeks ago there is a bug in the code which
happens if no. color rules for raster map is big (eg: 32763 This for
nc_spm_08/landsat 4,3,2 color composite) . This will result in crashing the
whole wxGUI!
The problem is for each rule colorrules.py create a checkbox,textCtrl and
ColorSelect.
Creating these widgets will hangup the UI.
A solution is to use a list control agw provides one such thing called
ultimatelistCtrl.
I had updated the colorrules.py and made a patch for it. Anyone Please
review and update the file
Hi Rashad,
I can’t even test your patch at the moment because UltimateListCtrl is
not supported in wxPython 2.8.10.1 (which is installed on my
computer). It seems that it is available from 2.8.11, however in the
grass requirements, there is wxPython >= 2.8.1.1. I agree that this
one is pretty old but still we must decide if it is worth changing the
requirements. I think that the version I have is still used a lot so
we should support it. You are using this widget to show the color I
suppose. I am not aware of any other good solution. Maybe you can a
condition on wxPython version and if it is high enough use this
widget, otherwise use the current implementation?
On Thu, Dec 20, 2012 at 11:45 AM, Mohammed Rashad
<mohammedrashadkm@gmail.com> wrote:
updated the patch. PFA
I've tested it on Ubuntu 12.04 (running in virtaul machine) with
wxPython 2.8.12.1 and there are some bugs. I've attached a screenshot.
As you can see I have a problem with strange background of
checkboxes. I tried wxPython demo and this problem is there too so
probably we cannot do much about it. Do you have the same problem or
it's just me?
Then, when you change the color table (above the rules, there is 'Load
color table'; e.g. from rainbow to aspect) the original numbers in the
list ctrl are still there below the new ones.
I also had sometimes problems to uncheck the items but I am not sure
under which conditions (maybe after changing colortable).
In the beginning when there is no map loaded there are the two
original wx.TextCtrl widgtes
Have you tried to avoid the dialog for setting values? Ideally, user
could edit the rule's value directly in the listctrl and click (or
double click) on the color would launch the wx color dialog.
I think that this solution with ultimatelistctrl looks much better
than the original, however we must first make it work properly.
On Sat, Dec 22, 2012 at 5:46 PM, Anna Kratochvílová
<kratochanna@gmail.com>wrote:
> On Thu, Dec 20, 2012 at 11:45 AM, Mohammed Rashad
> <mohammedrashadkm@gmail.com> wrote:
>> updated the patch. PFA
I've tested it on Ubuntu 12.04 (running in virtaul machine) with
wxPython 2.8.12.1 and there are some bugs. I've attached a screenshot.
As you can see I have a problem with strange background of
checkboxes. I tried wxPython demo and this problem is there too so
probably we cannot do much about it. Do you have the same problem or
it's just me?
Same happens for me. But sometimes only !. see the screenshot
Then, when you change the color table (above the rules, there is 'Load
color table'; e.g. from rainbow to aspect) the original numbers in the
list ctrl are still there below the new ones.
I also had sometimes problems to uncheck the items but I am not sure
under which conditions (maybe after changing colortable).
Fixed in the new version
In the beginning when there is no map loaded there are the two
original wx.TextCtrl widgtes
Have you tried to avoid the dialog for setting values? Ideally, user
could edit the rule's value directly in the listctrl and click (or
double click) on the color would launch the wx color dialog.
I sincerly tried a lot for this but ultimatelistctrl has no such provision
or there is a bug in my version
I think that this solution with ultimatelistctrl looks much better
than the original, however we must first make it work properly.
Anna
PFA colorrules.py. If things are looking good. I will provide a patch