Jump to content

How to make a PIO Styled?


Recommended Posts

Don't have much time but...

 

A1. Yes must be event enabled.

 

A2. You will need this:
gFlag := SetObjPropVS(kObjXSupportsStyles, TRUE); { 49 } { Controls whether a parametric type support plug-in styles }

and maybe these:

gFlag := SetObjPropVS(kObjXPropHideStyleSettingsButton, TRUE ); { 69 } { hide unwanted style editing buttons }
gFlag := SetObjPropTxtVS(kObjXPropSupportResourcePopup, 'Object Styles/MyStyledObject'); { 53 } { specified the default content folder }

 

A3. Depends if you are using dialogs to access parameters. If you you have a lot more work to do. If not, then you can let Vw handle it from memory.

 

A4. There are other events you may need too:

        60: BEGIN { Edit Plug-in Style }
            vsoSetEventResult( -10 ); {kObjectEventHandled} { using -10 here causes the object properties dialogue to open next }
        END;
        
        61: BEGIN { Create Plugin Style }
            vsoSetEventResult( 0 ); {kObjectEventHandled}
        END;
        
        62: BEGIN { Update Styled Plugin Object }
            vsoSetEventResult( 0 );
        END;
        
        63: BEGIN { Finalize Create Style }
            vsoGetPluginStyleSym(gh1);
            SetAllStyleParams(gh1, 0); { this sets all parameters to not use the style }
            vsoSetEventResult( 0 );
        END;
        
        64: BEGIN { Finalize Update Styled Object }
            vsoSetEventResult( -8 );
        END;
        
        65: BEGIN { Style Widget Chosen }
            vsoSetEventResult( 0 );
        END;
        { Create Style order of events: 61, 63, 60, 62, 64 }
        { Edit Style order of events: 60, 62, 64 }

Link to comment
On 2/16/2021 at 8:23 PM, Julian Carr said:

A3. Depends if you are using dialogs to access parameters. If you you have a lot more work to do. If not, then you can let Vw handle it from memory.

 

Julian -

 

IF/WHEN you have a few minutes, would you mind sharing any insight along these lines?  I've got Styles working beautifully for one of my PIOs - all except for parameters set by any of 3 dialogs.  I can get the handle to the PIO instance stored as part of the Style Symbol but am having a bear of a time  doing much of anything beyond that.  For example, "dialog" settings changed while editing Styled don't seem to be sticking.

 

Thanks for sharing any wisdom...

 

 

Link to comment

I'm not sure I can be of much assistance here Andy.

 

Because my dialogs are usually jamb packed full of controls, it has always been a bridge too far to fit those by style/instance widgets in. For example:

 

917209497_ScreenShot2021-02-24at4_32_29pm.thumb.png.bb432369ebc58840bea278d5414f6e4e.png

 

This dialog just fits on a 13" screen. For this PIO I do still use styles though, but only as a way to transfer hundreds of different styles from the library into the tool. Once placed, the instance is no longer styled and that works in this case because there are very few repetitions of any particular setup in the drawing, so not much benefit from being able to pick if controls are by style or instance . When you use a style with this object, it comes into the drawing as being unstyled. 

 

But if you have managed to get all the widgets into your dialog then I wouldn't have expected things to be too difficult. Maybe someone else has some clues?

Link to comment
9 hours ago, Julian Carr said:

Because my dialogs are usually jamb packed full of controls, it has always been a bridge too far to fit those by style/instance widgets in.

 

I'd actually be happy with an approach far simpler than giving individual Style functionality to every parameter in a given dialog.  For the time-being, I'd be quite content with applying Styles to settings en-masse for the dialog's settings.  For example, a dialog that controls embedded Class settings for a PIO's sub-parts.  I'm able to create a Styles List Control that toggles by-style and by-instance.  I'm also able to get Style settings to apply - but only as their state when the Style was created.  Settings that are changed when editing the Style do not pass in or out of the editing environment.  Make sense???

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...