BillW Posted December 28, 2023 Share Posted December 28, 2023 I have a button "Get Panel Style" in my plugin which I call vsoButtonGetResource for the user to select a panel style. I am using wall styles as panel styles. Folder "Panel Styles" contains the styles - see attached to see what I want to achieve (covering VW versions 2020 - 2024+). kWALLSTYLETYPE = 127; kPARAMNAME = 'panelstyle'; {param to store selection} kFOLDER = 'Panel Styles'; btest := vsoButtonGetResource(kPARAMNAME,kWALLSTYLETYPE,0,kFOLDER); {folder spec -113 = walls, 0 = Root} On clicking the button, I can't seem to open the browser into the "Panel Styles" folder showing only the contained styles. Currently, I get all the wallstyles in the file (0 = Root) Is there a particular syntax for "folderSpec" to open in a particular folder. Tried prepending with '/' to no avail. Even tried prepending the filename with '/' As an aside I am finding it tricky to workout if styles are renamed or deleted by the user. Thought of using (for first time): FUNCTION vsoStateGetNameChng(objH : HANDLE; VAR outOldName:STRING; VAR outNewName:STRING) :BOOLEAN ; but the current style is stored by name and if renamed by the user in the resouce browser I have no access via getobject(stylename). I cannot store style by handle as handles are dynamic. TIA Quote Link to comment
Vectorworks, Inc Employee klinzey Posted January 2 Vectorworks, Inc Employee Share Posted January 2 The pathing specified is not based on the folder structure in the file, it's based on the folder structure in the Operating system. There is no way to specify a folder within a Vectorworks document for this call. There is no mechanism setup for a VS plug-in to track changing and deleting wall styles like there is for Symbols and some other resources. The best suggestion is to create a small styles wall in the object's profile group. You will be able to check the wall in the profile group to determine if the style name has been changed or the style was deleted and take the necessary action. Quote Link to comment
BillW Posted January 2 Author Share Posted January 2 Thanks klinzey. I thought that was the case with pathing. It's a pity vsoButtonGetResource doesn't handle what I want. However it allows access to any library folder which is a bonus. I had already implemented your suggestion to "create a small styles wall in the object's profile group" and it works well. Incidentally, I found when the Object Info Panel was undocked (with auto hide set) and I called vsoButtonGetResource via a PIO "vsoAddWidget" button, VW 2020-2023 would hang/crash. I need to investigate further. Is there any way I can disable auto hide? There are SetPref calls: Palette Docking = 41 TRUE/FALSE Allow Docking to Drawing = 6752 TRUE/FALSE Allow Internal Palette Docking = 6753 TRUE/FALSE Show Docked Document Tabs = 6754 TRUE/FALSE Controls the state in which docked palettes automatically hides based on mouse proximity = 6776 TRUE/FALSE I guess the last one is the one I need (I think). I found an interesting SetPref Turns screen redraws on/off = 6799 TRUE/FALSE which I assume Redrawall in code would update objects without performing a screen redraw (if FALSE). Quote Link to comment
BillW Posted January 3 Author Share Posted January 3 Haven't been successfull in finding a way to disable auto hide on the Object Info Palette. Not even a way to find out auto hide status which would be helpfull. Or even if pallete is undocked. Even tried Get/SetPaletteVisibility with names 'Object Info', 'Object Info - Shape', 'Resource Manager' to no avail. Only handles Tool palettes. Made a mistake - Palette Docking = 43 TRUE/FALSE Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.