Jump to content
Developer Wiki and Function Reference Links ×

CreatePullDownSearch function


sstanelle

Recommended Posts

I would like to utilize the CreatePullDownSearch function in VW 2021. The API documentation is currently very limited, and it is unclear to me how to use this function in a dialog layout. Could anyone out there provide me with a simple Python script example regarding how to use this function? Much appreciated.

 

Thanks,

Scott

Link to comment

JBenghiat,

 

Thanks for your reply! I was looking for some Python code that I could include in a script. I initially tried the following but I think I somehow need to associate the item with a drop down list. I'm not sure how to do this. Hence, I was hoping someone could provide an example.

 

def DialogHandler(item, data):
    return None
    
dialog = vs.CreateLayout("Search", False, "Ok", "Cancel")

vs.CreatePullDownSearch(dialog, 1, 50)

 

 

vs.SetFirstLayoutItem(dialog, 1)

 

if (vs.RunLayoutDialog(dialog, DialogHandler) == 1):
    pass
 

 

A related question is whether there is a way to bypass CreatePullDownSearch and to have a text box and a list box where as the user types in the text box, the list is filtered with each key stroke.

 

Thanks for any help!

 

Scott

 

Link to comment

Take a look at Dialog Builder: https://developer.vectorworks.net/index.php/SDK:Dialog_Builder

 

The interface is a little rough (it's a pre-cursor to Marionette), but you can easily build and test dialog layouts without writing code. VW will then export the code file for you.

 

Go to the python forum if you need help with the dialog event handler. The process is fairly different with the SDK.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...