Re: [Class] LV_Colors - 1.1.04.01 (2016-05-03)
Posted: 25 Apr 2021, 10:57
Hi just me,
As you know, I've been using your LV_Colors class with great success for many years in an output-only LV that I call the "Processing Console"...thanks again for this terrific class!
I'm now trying to use it in an LV on the input side, where the user selects a color (or multiple colors) from a list with a large number of choices (will probably wind up in the 20-30 range). When clicking the checkbox, it looks fine. The issue I'm having is that when clicking the row, the text color changes to white and the background color changes to a shade of blue (0x0078D7). This happens regardless of the text color and background color that had been set (it also happens if the LV does not have a checkbox). Here's a simple example with three rows (yellow on red, black on green, pink on blue):
Clicking on any row (not the checkbox) turns the colors into white on 0x0078D7. Then clicking on another row or at the empty space under the rows brings back the correct colors. Screenshots:
I've tried with StaticMode both True and False...same behavior. Is there any way to keep this from happening? Thanks much, Joe
Edit: Possible work-around that I'm considering: Use AltSubmit when adding the LV and at the g-label look for A_GuiEvent="Normal" then do something like this:
That seems to solve the color problem. Regards, Joe
As you know, I've been using your LV_Colors class with great success for many years in an output-only LV that I call the "Processing Console"...thanks again for this terrific class!
I'm now trying to use it in an LV on the input side, where the user selects a color (or multiple colors) from a list with a large number of choices (will probably wind up in the 20-30 range). When clicking the checkbox, it looks fine. The issue I'm having is that when clicking the row, the text color changes to white and the background color changes to a shade of blue (0x0078D7). This happens regardless of the text color and background color that had been set (it also happens if the LV does not have a checkbox). Here's a simple example with three rows (yellow on red, black on green, pink on blue):
Code: Select all
#SingleInstance Force
Gui,Font,s12,Arial
Gui,Add,ListView,Checked xm r5 hwndSelectColorHandle,ColorLV
SelectColor:=New LV_Colors(SelectColorHandle,True,True,True)
ColorBack:="0xFF0000" ; Red
ColorText:="0xFFFF00" ; Yellow
RowNum:=LV_Add("","Red")
SelectColor.Row(RowNum,ColorBack,ColorText)
ColorBack:="0x00FF00" ; Green
ColorText:="0x000000" ; Black
RowNum:=LV_Add("","Green")
SelectColor.Row(RowNum,ColorBack,ColorText)
ColorBack:="0x0000FF" ; Blue
ColorText:="0xFFC0CB" ; Pink
RowNum:=LV_Add("","Blue")
SelectColor.Row(RowNum,ColorBack,ColorText)
Gui,Show
Return
GuiClose:
GuiEsc:
ExitApp
#Include Class_LV_Colors.ahk
I've tried with StaticMode both True and False...same behavior. Is there any way to keep this from happening? Thanks much, Joe
Edit: Possible work-around that I'm considering: Use AltSubmit when adding the LV and at the g-label look for A_GuiEvent="Normal" then do something like this:
Code: Select all
RowNum:=A_EventInfo
If (RowNum=0)
Return
LV_GetText(RowColor,RowNum)
NextChecked:=LV_GetNext(RowNum-1,"Checked")
If (RowNum=NextChecked)
CheckStatus:="Check"
Else
CheckStatus:="-Check"
LV_Delete(RowNum)
RowNum:=LV_Insert(RowNum,,RowColor)
LV_Modify(RowNum,CheckStatus)