Editing a property

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi all,

    Could someone point me in the right direction on this?
    My extension has a file selector property in the properties panel (a PropData_Filename() ), which shows the chosen file name in an edit box.
    I can detect when a file is selected via SetPropValue(), but once my property has been handled, I want to change its value to something like "Processed".

    The idea is for the user to browse to a file, select one, and then as soon as it's selected the extension does something with it and then the filename is no longer needed, so should be replaced with some generic string telling the user it's been handled (or whether some error occurred).

    Is that possible?

    Alternatively, I could use just a Button property, but I wouldn't know where to begin with getting it to pop up a file selector. Any pointers in either direction would be appreciated :)

    Thanks,

    Chris

  • You can have two versions of the properties, one with the file selector, another with the 'processed' property. When the file property is set the first time you would have to manually RemoveProps the normal properties and InsertProps the processed properties. You may want to make a way for the user to select a new file, though...

    Alternatively you could just have GetPropValue return "Processed" for the file property without changing whatever internal stuff you have stored for the file.

    Working as fast as I can on Fusion 3

  • Thanks guys - I'm considering just using a button and calling GetOpenFilename when it's clicked, but we'll see how that pans out... :/

    In either case I have a combobox which is supposed to list each file you've selected, but of course I don't know how to tell it to change the list either XD

    What I'd love is to do something like:

    Code
    EditPropValue(...){
       select ( propid ) {
       case PROPID_MYBUTTON:
          // Open the dialog and get the file path back
          ...
          // Access PROPID_COMBOBOX and add my new file path
          ...
       }
    }

    Presumably I could store a list of files in editData and just keep removing the property and creating a new one with the altered list as its default?

  • Dines, I'd recommend the SDK help, DarkEDIF has the best support for properties but is still in the making. I'd be interested to see code should you work around this problem, so I can implement it to DarkEDIF. :)

    Darkwire Software Lead Programmer (C++ & C#)
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Thanks guys - I'm considering just using a button and calling GetOpenFilename when it's clicked, but we'll see how that pans out... :/

    Why not use the actual filename property!? O_O

    In either case I have a combobox which is supposed to list each file you've selected, but of course I don't know how to tell it to change the list either XD

    Ah, I see what you are doing now. You're going about it entirely the wrong way, though. I'm going to write an example for you because it's easier than explaining ;)

    EDIT: Here it is: Please login to see this link.

    Working as fast as I can on Fusion 3

    Edited once, last by LB (May 9, 2012 at 11:24 PM).

  • Thanks LB! :D
    I was considering a button with GetOpenFilename because from comments above it was beginning to sound like overwriting the display of the filename property was gonna be a pain. I may still favour it though because it just seems slicker to have a button you click to add the file to the list rather than an edit field and a tiny browse button. The edit field part of it seems to be surplus to requirements, and using GetOpenFilename doesn't seem to add that much more work (famous last words!).

    But I really appreciate seeing it all in motion, especially your example of serialising it into EditData :)

    What I'm actually trying to achieve is an update to Font Embed Object, whereby the user can browse to a font file from a 'Browse' button in the properties and literally embed it into the EditData structure along with the font's filename. When they want to see the fonts currently embedded, they click the combo list. When they want to remove a font, they click an item in the combo list and a MessageBox asks them to confirm.

    It's supposed to make it easier to distribute *.mfa files that contain embedded fonts, rather than relying on MMF's Binary Data feature, and it should also allow the developer to access his embedded fonts from within MMF itself. Presently, the extension only attaches the font to the runtime process, not at edit time.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!