Jump to content
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted

paint.net SetPropertyControlValue.pdfSetPropertyControlValue(object propertyName, object controlPropertyName, object propertyValue)

allows to change some values of PropertyBasedControls which can not be set in the constructor.

This method should be called in OnCreateConfigUI().

 

I compiled a table to summarize the effect of SetPropertyControlValue() to all the PropertyBase controls. T

The forum sw does not support rotated text so the column headers are a little bit difficult to read. 😉

Please tell if there are errors or if you miss something in the table.

 

Link to the latest version of the table as pdf: paint.net SetPropertyControlValue.pdf

 

SetPropertyControlValue Property Type,
ProperyControlType
  Boolean,
CheckBox, Default
Double,
Slider, Default
Double,
AngleChooser (11)
DoubleVector,
Slider
DoubleVector,
PanAndSlider, Default
DoubleVector3,
Slider, Default
DoubleVector3,
RollBallAndSliders
Int32,
Slider, Default
Int32,
ColorWheel
Int32,
IncrementButton
StaticListChoice,
DropDown, Default
StaticListChoice,
RadioButton
String,
TextBox, Default
String,
FileChooser
Uri,
LinkLabel, Default
ControlInfoPropertyNames Value Type Id                                  
                                       
DisplayName String 0     YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES
Description String 1     no (1) YES YES YES YES YES YES YES YES YES YES YES YES YES no (2)
ControlType PropertyControlType (3) 2                                  
ButtonText String 3     no no no no no no no no no YES no no no no no
UseExponentialScale bool 4     no YES no YES no no no no no no no no no no no
DecimalPlaces Int32 5     no YES no YES no no no no no no no no no no no
SliderSmallChange double 6     no YES no no no no no YES no no no no no no no
SliderSmallChangeX double 7     no no no YES YES YES YES no no no no no no no no
SliderSmallChangeY double 8     no no no YES YES YES YES no no no no no no no no
SliderLargeChange double 9     no YES no no no no no YES no no no no no no no
SliderLargeChangeX double 10     no no no YES YES YES YES no no no no no no no no
SliderLargeChangeY double 11     no no no YES YES YES YES no no no no no no no no
UpDownIncrement double 12     no YES YES no no no no YES no no no no no no no
UpDownIncrementX double 13     no no no YES YES YES YES no no no no no no no no
UpDownIncrementY double 14     no no no YES YES YES YES no no no no no no no no
StaticImageUnderlay ImageResource 15     no no no no YES no no no no no no no no no no
Multiline bool (4) 16     no no no no no no no no no no no no YES no no
ShowResetButton bool 17     no YES YES YES YES YES YES YES YES no no no no no no
SliderShowTickMarks bool 18     no no (5) no no no no no YES no no no no no no no
SliderShowTickMarksX bool 19     no no no YES YES YES YES no no no no no no no no
SliderShowTickMarksY bool 20     no no no YES YES YES YES no no no no no no no no
WindowTitle String (6) 21                                  
WindowWidthScale Double (6) 22                                  
WindowIsSizable Bool (6) 23                                  
SliderSmallChangeZ double 24     no no no no no YES YES no no no no no no no no
SliderLargeChangeZ double 25     no no no no no YES YES no no no no no no no no
UpDownIncrementZ double 26     no no no no no YES YES no no no no no no no no
SliderShowTickMarksZ bool 27     no no no no no YES YES no no no no no no no no
Footnote String 28     YES (7) no no no no no no no no no no no no no no
RangeWraps bool 29     no YES No (8) no no no no YES no no no no no no no
ControlStyle SliderControlStyle 30     no YES no no no no no YES no no no no no no no
ControlColors ColorBgra[] 31     no YES no no no no no YES no no no no no no no
WindowHelpContentType WindowHelpContentType (6) 32                                  
WindowHelpContent String (6) 33                                  
AllowAllFiles Bool (9) 34     no no no no no no no no no no no no no YES no
FileTypes String[] (10) 35     no no no no no no no no no no no no no YES no
                                       
Notes   (1)     Footnote must be used for Description. Description sets the CheckBox text.
    (2)     Footnote must be used for Description but is not implemented. Description sets the link text (not the link).
    (3)     Not sure if the type is correct. But using SetPropertyControlValue with this type has no effect
    (4)     False: 1 line, True: 4 lines
    (5)     Not implemented. I’m not sure why this is missing.
    (6)     Not available for controls
    (7)     Sets Description for the cases where Description is used to set an other text.
    (8)     Always wraps around
    (9)     If no FileTypes are provided the ‚All Files (*.*)‘ will still appear in the ‘Select File‘ dialog
    (10)     Provide an array of file extensions. I.e. new string[]{"exe“, "txt“}
    (11)     AngleChooser has no slider. I would prefer one plus a new ControlInfoPropertyNames.SliderShow setting.

 

 

 

I collected this during my refactoring of OptionBasedLibrary to make sure that OptionBasedControls support the functionality of PropertyBasedControls.

Hope this info is also useful for you.

 

OK, the table looks different while you are editing the topic...

18.4.2021: I copied @Ego Eram Reputotable, fixed the error mentioned by @toe_head2001, and fixed the Value Type of all SliderSmallChange, SliderLargeChange, and UpDownIncrement variants to double (a simple int raises an exception).

Copy of the table removed again the formatting of the table, but the other fixes are in.

 

  • Like 3
  • Upvote 1

midoras signature.gif

Posted

Excellent table @midora. Thank you!

 

Let's see if we can fiddle with the table styling...

 

<snipped>

 

It's not brilliant :mrgreen:. As you noticed, the editing window is different from the forum view.

 

Posted

Second attempt....

SetPropertyControlValue   Property Type,
ProperyControlType
Boolean,
CheckBox, Default
Double,
Slider, Default
Double,
AngleChooser (11)
DoubleVector,
Slider
DoubleVector,
PanAndSlider, Default
DoubleVector3,
Slider, Default
DoubleVector3,
RollBallAndSliders
Int32,
Slider, Default
Int32,
ColorWheel
Int32,
IncrementButton
StaticListChoice,
DropDown, Default
StaticListChoice,
RadioButton
String,
TextBox, Default
String,
FileChooser
Uri,
LinkLabel, Default
ControlInfoPropertyNames Value Type Id                              
DisplayName String 0 YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES
Description String 1 no (1) YES YES YES YES YES YES YES YES YES YES YES YES YES no (2)
ControlType PropertyControlType (3) 2                              
ButtonText String 3 no no no no no no no no no YES no no no no no
UseExponentialScale bool 4 no YES no YES no no no no no no no no no no no
DecimalPlaces Int32 5 no YES no YES no no no no no no no no no no no
SliderSmallChange Int32 6 no YES no no no no no YES no no no no no no no
SliderSmallChangeX Int32 7 no no no YES YES YES YES no no no no no no no no
SliderSmallChangeY Int32 8 no no no YES YES YES YES no no no no no no no no
SliderLargeChange Int32 9 no YES no no no no no YES no no no no no no no
SliderLargeChangeX Int32 10 no no no YES YES YES YES no no no no no no no no
SliderLargeChangeY Int32 11 no no no YES YES YES YES no no no no no no no no
UpDownIncrement Int32 12 no YES no no no no no YES no no no no no no no
UpDownIncrementX Int32 13 no no no YES YES YES YES no no no no no no no no
UpDownIncrementY Int32 14 no no no YES YES YES YES no no no no no no no no
StaticImageUnderlay ImageResource 15 no no no no YES no no no no no no no no no no
Multiline bool (4) 16 no no no no no no no no no no no no YES no no
ShowResetButton bool 17 no YES YES YES YES YES YES YES YES no no no no no no
SliderShowTickMarks bool 18 no no (5) no no no no no YES no no no no no no no
SliderShowTickMarksX bool 19 no no no YES YES YES YES no no no no no no no no
SliderShowTickMarksY bool 20 no no no YES YES YES YES no no no no no no no no
WindowTitle String (6) 21                              
WindowWidthScale Double (6) 22                              
WindowIsSizable Bool (6) 23                              
SliderSmallChangeZ Int32 24 no no no no no YES YES no no no no no no no no
SliderLargeChangeZ Int32 25 no no no no no YES YES no no no no no no no no
UpDownIncrementZ Int32 26 no no no no no YES YES no no no no no no no no
SliderShowTickMarksZ bool 27 no no no no no YES YES no no no no no no no no
Footnote String 28 YES (7) no no no no no no no no no no no no no no
RangeWraps bool 29 no YES No (8) no no no no YES no no no no no no no
ControlStyle SliderControlStyle 30 no YES no no no no no YES no no no no no no no
ControlColors ColorBgra[] 31 no YES no no no no no YES no no no no no no no
WindowHelpContentType WindowHelpContentType (6) 32                              
WindowHelpContent String (6) 33                              
AllowAllFiles Bool (9) 34 no no no no no no no no no no no no no YES no
FileTypes String[] (10) 35 no no no no no no no no no no no no no YES no

 

...that'll do pig. That'll do.

  • Upvote 1
Posted
6 hours ago, toe_head2001 said:

You actually can use UpDownIncrement with the AngleChooser. It applies to the numBox on the control.

You are right. Also the value type of all SliderSmallChange, SliderLargeChange, and UpDownIncrement variants must be double to avoid a cast exception.

 

@Ego Eram ReputoThanks for adapting the table view, looks much better now. I don't know how to do it in the editor. But as always the text is rotated in the wrong direction (like on your English book spines) 😉

midoras signature.gif

Posted

No problem. I did the styling by editing the HTML & CSS. Its a Mod thing :)

 

Changing the writing direction in the vertical aligned cells is more trouble than it is worth. You'll have to get used to it :mrviolet:

 

Do you want me to port the styling into your origial post?

Posted

@Ego Eram Reputo"that'll do pig. That'll do." 😉  If there is some spare time...

 

I exported the latest version of the table from LibreOffice to pdf and added it to the first post.

 

But how can we avoid that everytime I'm editing the first post the formatting of the table will be destroyed?

Next time I will add a second post just containig tables.

 

I detected the dark mode theme at the bottom of the forum page. The table looks more ugly. Some texts are not showing in white but I'm not able to detect a rule why this is the case...

 

midoras signature.gif

Posted

Thanks for the tip. I will check this out. In the moment I think it is better to replace the table with an image to avoid the issues. The pdf can be used for copy/paste.

midoras signature.gif

Posted
20 hours ago, Ego Eram Reputo said:

Another option is to publish it as a Google Sheet.

 

I still prefer local solutions. No problem to share and publish. But Google closed so many tools over the years...

midoras signature.gif

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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