Max2011x64 throw these message:">> MAXScript dotNet event handler Exception: -- Runtime error: dotNet runtime exception: String <<" when click on "Option" label in line 924 file:WhatsMyName_gui.ms
I think Max2011x64 don't support :DevExpress.XtraEditors.CheckedListBoxControl but maybe i'm wrong. In max2012 work perfectly.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ERROR MESSAGE IN MAX2012X64:
-- Error occurred in fn_createObject(); filename: C:\Users\CodeBox\AppData\Local\Autodesk\3dsMax\2012 - 64bit\enu\scripts\KlaasTools\WMN\whatsMyName_preferences.ms; position: 3263; line: 77
-- Frame:
-- theObject: (WMNpreferences id:1 name:"mypreferences" dictionaryID:3 applycolor:true appendname:false increment:false managedictionaries:false formlocation:[68,113] formHeight:550 whichlibrary:"public" publiclibrarypath:"" privatelibrarypath:"" firstrun:true)
-- xmlDoc: dotNetObject:System.Xml.XmlDocument
-- theElement: dotNetObject:System.Xml.XmlElement
-- called in fn_findByID(); filename: C:\Users\CodeBox\AppData\Local\Autodesk\3dsMax\2012 - 64bit\enu\scripts\KlaasTools\WMN\whatsMyName_genericObject.ms; position: 4606; line: 123
-- Frame:
-- mySpecs: (WMNgeneric theObject:(WMNpreferences id:0 name:"" dictionaryID:0 applycolor:true appendname:false increment:false managedictionaries:false formlocation:[0,0] formHeight:550 whichlibrary:"public" publiclibrarypath:"" privatelibrarypath:"" firstrun:true) theType:"preference" theXmlDoc:dotNetObject:System.Xml.XmlDocument parentXpath:#("//preferences"))
-- myObject: undefined
-- theID: 1
-- xmlDoc: dotNetObject:System.Xml.XmlDocument
-- type: "preference"
-- theElement: dotNetObject:System.Xml.XmlElement
-- called in fn_loadXml(); filename: C:\Users\CodeBox\AppData\Local\Autodesk\3dsMax\2012 - 64bit\enu\scripts\KlaasTools\WMN\whatsMyName_scriptcore.ms; position: 3451; line: 89
-- Frame:
-- myPref: undefined
-- called in anonymous codeblock; filename: C:\Users\CodeBox\AppData\Local\Autodesk\3dsMax\2012 - 64bit\enu\scripts\KlaasTools\WMN\whatsMyName_RUN.ms; position: 2917; line: 77
-- Frame:
-- Error occurred during fileIn in #C:\Users\CodeBox\AppData\Local\Autodesk\3dsMax\2012 - 64bit\enu\scripts\KlaasTools\WMN\whatsMyName_preferences.ms; line number: 77
-- called in anonymous codeblock; filename: C:\Users\CodeBox\AppData\Local\Autodesk\3dsMax\2012 - 64bit\enu\scripts\KlaasTools\WMN\whatsMyName_RUN.ms; position: 982; line: 28
-- Frame:
>> MAXScript MacroScript Error Exception:
-- Unknown property: "innerText" in undefined <<
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is only change a look of the buttons in the PopupContainerControl,
but has a better appearance then default settings.
The Context menu also has a professional look
--line 60 file: WhatsMyName_gui.ms
function fn_createButton strButtonText strButtonImg: =
(
/*
Description:
create a button from a string, optionally add an image.
Arguments:
strButtonText: the text for the button
strButtonImg: the path to an image for the button
Return:
a button
*/
local theButton = dotNetObject "DevExpress.XtraEditors.SimpleButton"
local LGMv = (dotNetClass "System.Drawing.Drawing2D.LinearGradientMode").Vertical
theButton.text = theButton.name = strButtonText ; theButton.AllowFocus = false
theButton.size = (dotnetobject "System.Drawing.Size" 194 20)
theButton.appearance.backcolor = theButton.appearance.backcolor.FromArgb 70 70 70
theButton.appearance.backcolor2 = theButton.appearance.backcolor2.FromArgb 50 50 50
theButton.appearance.forecolor = theButton.appearance.forecolor.FromArgb 220 220 220
theButton.appearance.bordercolor = theButton.appearance.bordercolor.FromArgb 220 220 220
theButton.appearance.GradientMode = LGMv
theButton.BorderStyle = theButton.BorderStyle.HotFlat --Flat,HotFlat,NoBorder,Office2003,Simple,Style3D,UltraFlat
theButton.visible = true
theButton
)
--line 160 file: WhatsMyName_gui.ms
function fn_createPopupWithButtons arrButton thePopup useFlow:true=
(
/*
Description:
Creates a popupcontainer to add to a popupEditor with a set of buttons.
Arguments:
arrButton: An array of buttons to put in the popup.
thePopup: the popup to add the container to
useFlow: use teh flow-layout or not. Ignore the flow when adding a single dockable control
Return:
the popup is populated with a set of buttons
*/
local thePanel = dotNetObject "DevExpress.XtraEditors.PopupContainerControl" --the panel holds the buttons
thePanel.AutoSizeMode = thePanel.AutoSizeMode.GrowAndShrink
thePanel.MaximumSize = dotNetObject "System.Drawing.Size" 220 78
local theFlow = dotNetObject "flowLayoutPanel"
theFlow.dock = theFlow.dock.fill
theFlow.backcolor = theFlow.backcolor.FromArgb 50 50 50
theFlow.WrapContents = true
if useFlow then
(
theFlow.controls.addRange arrButton
thePanel.controls.add theFlow
)else
(
thePanel.controls.add arrButton[1]
)
thePopup.Properties.PopupControl = thePanel --add the panel as editor
)
----line 576 file: WhatsMyName_gui.ms
function event_cmsEnginesOpening control arg =
(
/*
Description:
This method is called when the cms opens up. That's the moment you can populate the cms with the relevant items.
Arguments:
arg_a: A description of the argument.
Return:
the cms is populated
*/
--First get the treelistnode under the mouse
local p2Mouse = control.sourcecontrol.pointToClient control.sourcecontrol.mouseposition
local hitInfo = control.sourcecontrol.calcHitInfo p2Mouse
local theNode = if hitInfo.node != undefined do hitInfo.node.tag.value--item[0]
WMNcms.theSelectedNode = theNode --store this node somewhere global, needs to be done because the following stuff can't work with outer local variables
WMNcms.cms.RenderMode = WMNcms.cms.RenderMode.Professional ; WMNcms.cms.Opacity = 0.9d0
WMNcms.cms.ShowCheckMargin = false ; WMNcms.cms.ShowImageMargin = false
WMNcms.cms.BackColor = (dotNetClass "System.Drawing.Color").FromArgb 70 70 70
WMNcms.cms.ForeColor = (dotNetClass "System.Drawing.Color").FromArgb 0 0 0
WMNcms.cms.MaximumSize = dotNetObject "System.Drawing.Size" 180 80
WMNcms.cms.GripStyle = WMNcms.cms.GripStyle.Visible
WMNcms.cms.items.clear()
case of
(
(classof theNode == WMNword):
(
WMNcms.cms.items.addRange #(WMNcms.itmSelectObjectsWithWord)
WMNcms.cms.items.addRange #(WMNcms.itmIsolateObjectsWithWord)
WMNcms.cms.items.addRange #(WMNcms.itmHideObjectsWithWord)
)
default: WMNcms.cms.items.addRange #(WMNcms.itmEmpty)
)
)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
And lest if you can as an option to put something like this.
My English is not so good but i hope this function could explain what i wanted to say.
fn RenameAndStoreInLayer nameFromList: colorFromList: cleanEmpty:true =
(
local selObjArr = (selection as array), newLayer = LayerManager.getLayerFromName nameFromList
if selObjArr.count != 0 then
(
if newLayer == undefined then
(
newLayer = LayerManager.newLayerFromName nameFromList ; newLayer.current = true ; newLayer.wireColor = colorFromList
) else (newLayer.current = true)
for i = 1 to selObjArr.count do (selObjArr[i].name = (uniquename nameFromList) ; selObjArr[i].wirecolor = colorFromList ; newLayer.addNode selObjArr[i]) --Rename obj and put in layer
if cleanEmpty == true do
(
local getLayer = (LayerManager.getLayer), delLayer = (LayerManager.deleteLayerByName), layerCount = (LayerManager.count-1)
(getLayer 0).current = true ; for lay in layerCount to 1 by -1 do ( delLayer (getLayer lay).name )
)
) else "Select some objects first!"
)
RenameAndStoreInLayer nameFromList:"Bonus" colorFromList:blue cleanEmpty:true
---------------------------------------------------------------------------------------