how do you think, is it possible to insert in listview inside a single line 2 entries like here? http://www.scriptspot.com/files/script_0.jpg
so that I could show text like in attached picture:
I didn't find any info about this here
http://docs.autodesk.com/3DSMAX/15/ENU/MAXScript-Help/index.html?url=fil…
Comments (11)
Comment policy
Thanks, Swordslayer, Now it's working even faster!
No need to make it faster!
I want to change point 3 - make the last row wider like in the picture bellow, and I would like aslo to make my datagrid window rescalebale like in ZOA_PATH_editor.(My script window is allready resizing at it remebers the last changes)
It has a function for listview like that:
in my script I have smth like that
Also, how can I detect texture status like in asset tracking?
Attachments
To make the automatic size adjustments work, I'd add
and also to make the first column autosize
As for the last line, you'd need a function called on control resize, something like
Minus some margins I guess, but I'm sure you will make it work.
Setting the right datagridview control size on dialog resize is pretty straightforward as you only have to care about its width and height. Resizing dialogs like this can become quite tiresome, though, if you want to resize more than just a few controls, save yourself some pain and use maxforms instead, things like anchors will certainly make you a happier person ;)
THANKS Swordslayer! You're idea is great!!!!
I've tried to put datagrid instead and it works!
But I want to change it a little:
1. remove left header like in the image bellow
2 select whole row (but to be able to select more then one row and to find out the selection, so that I could operate with it)
http://stackoverflow.com/questions/285829/datagridview-how-to-focus-the-…
and
give errors
3. make empty row till the end
4. make it faster if possible http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/14407d45… using VirtualMode
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridvie…
Attachments
The first two are simple: =
The first two are simple:
which is sort of a shorthand for
and
The rest.. I will look into it later when I have more than few minutes to spare, however VirtualMode should not really be needed, unless you do some pretty serious stuff.
Using datagridview might be even simpler:
Or you can turn grid off and select two lines at a time. For example, in the sample barigazy provided, you could add an event handler and a variable to achieve that:
2 entries in a single line in listview mean something like Entry1 Delimiter Entry2, but you expect multiline entries :) nm, to save width space you can populate ListView with 1st entry (Texture) and when item is selected to display corresponding (by index) value (Map Tree) into EditText ui control.
may be another idea
I see that in order to simplify the work with textures, there is a lot of time to waste for coding!
Interesting, how to display now path and map tree to be easy for reading and not to take all the monitor! I wanted this way to have a smaller window :(
can you image this info on a single line
I guess Better ListView is the only solution!
But prices scared me :) (if I make this script for other people too:)
http://www.componentowl.com/pricing-licensing/better-listview
Thx BOTH
Yes,
of course doesn't help unfortunately!
Unless you are on max 8 or lower, don't use ActiveX controls. To have multiline items like this in a standard .NET listview you would most probably have to write your own control using extended listviewitems - or use some 3rd party one like Better ListView. For a basic listview usage look for example at Scriptspot :: Working Checklist. Good luck.
To be sure what is the problem with .net LV
try(destroyDialog listview_rollout)catch()
rollout listview_rollout "ListView Selected"
(
local txtArr = #(
#("TextA\nTextB", "TextC", "TextD", "TextE"), \
#("TextA1\nTextB1", "TextC1", "TextD1", "TextE1"), \
#("TextA2\nTextB2", "TextC2", "TextD2", "TextE2"), \
#("TextA3\nTextB3", "TextC3", "TextD3", "TextE3")
)
fn initListView lv =
(
lv.gridLines = true
lv.View = (dotNetClass "View").Details
lv.fullRowSelect = true
layout_def = #("TEXT_1", "TEXT_2", "TEXT_3", "TEXT_4")
for i in layout_def do lv.Columns.add i 80 --add column with name and optional width
lv.TileSize = (dotNetObject "System.Drawing.Size" 80 40)
)
fn fillInSpreadSheet lv arr =
(
local theRange = #() --array to collect the list items
for i = 1 to arr.count do
(
li = dotNetObject "ListViewItem" arr[i][1]
sub_li = li.SubItems.add arr[i][2]
sub_li = li.SubItems.add arr[i][3]
sub_li = li.SubItems.add arr[i][4]
append theRange li --we add the list item to the array
)
lv.Items.AddRange theRange --when done, we populate the ListView
)
dotNetControl lv_objects "ListView" width:324 height:190 align:#center
on listview_rollout open do
(
initListView lv_objects
fillInSpreadSheet lv_objects txtArr
)
)
createDialog listview_rollout 334 200