Due to a scheduled maintenance, a maximum 20 minutes license delivery outage may be expected on July 6 2024 (Saturday) between 6PM to 8PM (CEST).
GDL
About building parametric objects with GDL.
SOLVED!

ui_infield{3} Picture Buttons

Jarrod Phillips
Enthusiast

Hi All,

 

This has probably been asked before, however, I am trying to create some picture buttons in a custom UI for Bold, Italics and Underscore text style settings and can't quite work out how to set the pictures for each individual button using ui_infield{3}? I am trying to use the 18x18 text style pictures in the default Archicad library. I have attached the actual UI as it currently stands with no pictures appearing on the buttons and the proposed UI with how I want the buttons to appear. Hope this helps!

 

ui_infield{3} may not be the right approach, happy for someone to tell me otherwise.

 

Regards,

 

Jarrod

 

Actual Object UI.png

 

Proposed Object UI.png

  

 

 

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Don't do that by hand anymore.

Use UI_TEXTSTYLE_INFIELD instead.

This is a built-in function since AC 22 and it renders everything nicely (the buttons are even localized! So while you might get "B" for "bold" I as a german will get "F" for "fett").

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

«Furthermore, I consider that Carth... yearly releases must be destroyed»

View solution in original post

6 REPLIES 6
MF BIM
Booster

Hello @Jarrod Phillips ,

 

Can you show the code ? It seems that the picture isn't being found.

https://mfbim.fr | https://youtube.com/@mfbim
AC21 FRA 3005 - AC24 FRA 7600 - AC26 FRA 4027 | MacBook M1 Pro
Hi MF BIM! Thanks for your response. This is most likely very wrong but here it is!
 
ui_infield{3} "fontEffects", rightHalf + 70, 48, 54, 18,
6, "", 0, 0,
0, 0, 0, 0,
0, "ui_bold_hl(1)", "Bold",
0, "ui_italic_hl(1)", "Italics",
0, "ui_underline_hl(1)", "Underscore"
BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27
Solution

Don't do that by hand anymore.

Use UI_TEXTSTYLE_INFIELD instead.

This is a built-in function since AC 22 and it renders everything nicely (the buttons are even localized! So while you might get "B" for "bold" I as a german will get "F" for "fett").

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

«Furthermore, I consider that Carth... yearly releases must be destroyed»

Hi runxel, Thanks for your comment, however, I am after a push button in this instance.

 

Proposed Object UI.png

 

Cheers!

 

Jarrod

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27

Apologies @runxel, I was swamped with work and completely mis-read your message. I thought you were suggesting that I use ui_listitem haha. Sorry, what you have suggested is exactly what I wanted. Thanks! I am however having an issue with the Underline option not working correctly. Do you mind taking a look at my code? (pasted below).

Parameter script:

values "fontEffects", 0, 1, 2, 3

Interface Script:	

ui_textstyle_infield{2} 'fontEffects', 1+2+4+0+0+0, rightHalf + 70, 48,
		18, 18

 

Cheers,

 

Jarrod

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27

@Jarrod Phillips wrote:

 I was swamped with work

Aren't we all? 😅 No worries Jarod.

 

There is no need to have a values command for that in the param script imho.

What could be set as values is already defined in the UI script.

But if you would do it: you'd need the right values!

There is misconception here. The buttons are not exclusive, but additive! So you could say a text is bold, italic, and underlined at the same time!

Which would result in a value of  '1+2+4' = 7. And that one is not in your "values" list. Heck, not even number '4' is in there! (That's why it CAN'T work right now.)

Better to leave out the "values" command alltogether.

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

«Furthermore, I consider that Carth... yearly releases must be destroyed»