Forums » Community Projects
Drat, more how's.
Here is the issue. I am building a matrix that has both pre-defined values, and values I want the player the change.
I am using.
iup.pdasubsubmatrix and building a matrix, and updating it, and it all works fine.
However, when I build a matrix element out of a user update text field.
TargetControl.GroupMatrix[row].Key = iup.text { value = "" .. data.Key, size = TargetControl.UserInterfaceInfo.element.BindBoxSize}
TargetControl.UserInterfaceContent.matrix.Groups[row..':2'] = TargetControl.GroupMatrix[row].Key
and I try to alter the background colors.
iup.MatrixSetAttribute(TargetControl.UserInterfaceContent.matrix.Groups,'BGCOLOR',row,-1,TargetControl.grey)
The hard coded text fields show correctly
TargetControl.UserInterfaceContent.matrix.Groups[row..':4'] = "Target PlaceHolder"
But the iup.text values show white on white. Very ugly.
I havn't had to worry about iup.text color before, it all just seemed to work automatically.
Does anyone know how to set the color attributes for the on the iup.text fields?
Thanks
Oh, I did add the whole \127ff4300 RGB thing to the value field, and that just behaved .... oddly. Color worked until I selected it, then it added a 0 to the front of the other text. Very strange.
Here is the issue. I am building a matrix that has both pre-defined values, and values I want the player the change.
I am using.
iup.pdasubsubmatrix and building a matrix, and updating it, and it all works fine.
However, when I build a matrix element out of a user update text field.
TargetControl.GroupMatrix[row].Key = iup.text { value = "" .. data.Key, size = TargetControl.UserInterfaceInfo.element.BindBoxSize}
TargetControl.UserInterfaceContent.matrix.Groups[row..':2'] = TargetControl.GroupMatrix[row].Key
and I try to alter the background colors.
iup.MatrixSetAttribute(TargetControl.UserInterfaceContent.matrix.Groups,'BGCOLOR',row,-1,TargetControl.grey)
The hard coded text fields show correctly
TargetControl.UserInterfaceContent.matrix.Groups[row..':4'] = "Target PlaceHolder"
But the iup.text values show white on white. Very ugly.
I havn't had to worry about iup.text color before, it all just seemed to work automatically.
Does anyone know how to set the color attributes for the on the iup.text fields?
Thanks
Oh, I did add the whole \127ff4300 RGB thing to the value field, and that just behaved .... oddly. Color worked until I selected it, then it added a 0 to the front of the other text. Very strange.
Why put the iup.text in the matrix? Can't you just put it's value?
Less clicks for editing.
With it in the Matrix, all rows could be edited as well as displayed without having to add in an edit dialog. Since this is something that is intended for use in combat, that saves valuable seconds.
With it in the Matrix, all rows could be edited as well as displayed without having to add in an edit dialog. Since this is something that is intended for use in combat, that saves valuable seconds.
By default if you double click any cell it goes into edit mode. Isn't that enough? (tho i guess you know that already)
Also did you try adding BGCOLOR/FGCOLOR to the iup.text?
as in
TargetControl.GroupMatrix[row].Key = iup.text { value = "" .. data.Key, size = TargetControl.UserInterfaceInfo.element.BindBoxSize, BGCOLOR='1 1 1', FGCOLOR='1 1 1'}
?
nvm i can't even reproduce it reliably.
Also did you try adding BGCOLOR/FGCOLOR to the iup.text?
as in
TargetControl.GroupMatrix[row].Key = iup.text { value = "" .. data.Key, size = TargetControl.UserInterfaceInfo.element.BindBoxSize, BGCOLOR='1 1 1', FGCOLOR='1 1 1'}
?
nvm i can't even reproduce it reliably.
HAHAHAHA!!!
"By default if you double click any cell it goes into edit mode. Isn't that enough? (tho i guess you know that already)"
No I did not. That solves everything, and just about wastes 4 hours of fighting with iup.text code.
Thanks maq, thats a very big help.
"By default if you double click any cell it goes into edit mode. Isn't that enough? (tho i guess you know that already)"
No I did not. That solves everything, and just about wastes 4 hours of fighting with iup.text code.
Thanks maq, thats a very big help.
Well, glad i could help.
It's on the iup site. You do know about that one.... right? :)
but just in case: http://www.tecgraf.puc-rio.br/iup/
It's on the iup site. You do know about that one.... right? :)
but just in case: http://www.tecgraf.puc-rio.br/iup/
FYI do not put iup elements inside arrays. For starters they are not supported. Secondly you can/will get unexpected results and odd behavior and never the benefit.
the edition_cb happens when you double click on a cell. If you want the user to *NOT* edit the cell then return iup.IGNORE, else do your processing.
the edition_cb happens when you double click on a cell. If you want the user to *NOT* edit the cell then return iup.IGNORE, else do your processing.
Well, glad i could help.
It's on the iup site. You do know about that one.... right? :)
but just in case: http://www.tecgraf.puc-rio.br/iup/
Um, no again. I am soooo new to Lua, I just know other code. I thought that iup was a VO only construct. Site now bookmarked.
Thanks again.
It's on the iup site. You do know about that one.... right? :)
but just in case: http://www.tecgraf.puc-rio.br/iup/
Um, no again. I am soooo new to Lua, I just know other code. I thought that iup was a VO only construct. Site now bookmarked.
Thanks again.