User Tag List

Results 1 to 7 of 7

Thread: Editing a property

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Editing a property

    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

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    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

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    You also need to imlplement the condition in GetProperties. if(foo) mvInsertProps(...) else mvInsertProps(...).

  4. #4
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

    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?

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    2,091
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    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.

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dines View Post
    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
    Quote Originally Posted by Dines View Post
    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
    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: http://www.LB-Stuff.com/MMF2/Extensions/DinesProps.zip
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks LB!
    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.

Similar Threads

  1. Joint property demo
    By Francois in forum Fusion 2.5
    Replies: 13
    Last Post: 15th November 2013, 09:09 PM
  2. Add a linebreak in About property
    By septeven in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th February 2012, 11:00 PM
  3. Property options
    By Retriever2 in forum Extension Development
    Replies: 1
    Last Post: 25th May 2009, 08:47 AM
  4. Delete property bug?
    By Harvy in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 17th July 2006, 09:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •