BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

UI_INFIELD{3} method 4 -rows & columns

Richard Swann
Booster
Hi,
In the Interface script there appears to be a problem with the UI_INFIELD{3} command. I have searched the wiki and forum, but it has never been documented as far as I can tell, so this is a stake in the ground for other lost soles who encounter the same issue. If anyone knows how this can work or confirm that it doesn't, please reply..

I want to create image buttons. It works fine on macs to create an image over a UI_button, but on pcs they disappear when the curser moves over them. So I have tried to use the UI_INFIELD command as an alternative.
Using method 4 : quote from the user manual:
"
UI_INFIELD{3} name, x, y, width, height [, method, picture_name, images_number, rows_number, cell_x, cell_y, image_x, image_y, expression_image1, text1, value_definition1,...

method: the type of the thumbnail control
1: List view control
2: Popup menu control
3: Popup icon radio control
4: Push icon radio control
picture_name: name of the common image file containing a matrix of concatenated images, or empty string
images_number: number of images in the matrix
rows_number: number of rows of the matrix
In fact this is not correct as the "rows number" has no effect on the push icon display. It always displays 1 image per column.ie 1 row and ignores the image and cell width that I set.
I have tried subdividing one image and using multiple images but always with the same result. The same is also true of method 3.

I am writing a library part for AC11 but 12 and 13 show the same behavior.

My script is:
UI_INFIELD{3} "SAP", 0, 27, 110, 210, 4, "allbut.psd", 7,7, 110, 30, 110, 29,
1," ","2" ,
2," ","3",
3," ","7",
4," ","8" ,
5," ","6",
6," ","5",
7," ","9"

The result is as shown on the attached, should be 7 ROWS not 1 row.

Anyone with any experience of this?

Regards

screenshot1.png
Richard Swann
Mac OS X 10.11.4 , 27" Imac 4k ArchiCAD 4.5-20
6 REPLIES 6
Joachim Suehlo
Advisor
Yes, it seems you are right, that it is not possible to define separate rows.
An alternative is this:

UI_INFIELD{3} "Seite2", 111, 1, 50, 25,
5, "file.gif", 1,
1, 20, 20, 20, 20,
0, "Bestueck.", 0

and so on. One command for any row.

But additionally you have to adjust the parameters by every click on a button.

IF GLOB_MODPAR_NAME = "Seite1" THEN
PARAMETERS Seite1=1,Seite2=0,Seite3=0,Seite4=0
ENDIF
IF GLOB_MODPAR_NAME = "Seite2" THEN
PARAMETERS Seite1=0,Seite2=1,Seite3=0,Seite4=0
ENDIF
IF GLOB_MODPAR_NAME = "Seite3" THEN
PARAMETERS Seite1=0,Seite2=0,Seite3=1,Seite4=0
ENDIF
IF GLOB_MODPAR_NAME = "Seite4" THEN
PARAMETERS Seite1=0,Seite2=0,Seite3=0,Seite4=1
ENDIF

And it works with method 5, which was introduced with AC 12.
Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de
Richard Swann
Booster
Just checked the other versions of UI_INFIELD and they all behave the same way, each image is a column not a row, so at least they are consistently wrong!
I think the 'number rows' feature only works for list views.
If anyone at GS is reading this, it would be great to implement a version of UI_button with an optional field for an image..
Richard Swann
Mac OS X 10.11.4 , 27" Imac 4k ArchiCAD 4.5-20
Ben Cohen
Enthusiast
try this

UI_PICT_BUTTON type, text, picture_reference, x, y, width, height [, id [, url]]

using a .png it works for me in PC and Mac. Its in v12 and v13. Not so sure about v11
Ben Cohen
Mac and PC
Archicad (Latest Version) aus
www.4DLibrary.com.au
Ralph Wessel
Mentor
Richard wrote:
I want to create image buttons. It works fine on macs to create an image over a UI_button, but on pcs they disappear when the curser moves over them.
You can get the picture button to work if you use a combination of ui_pict_button and ui_pict. Unfortunately the GDL UI commands are quite buggy, but this combo works around it because:
  • 1. ui_pict_button looks right and works correctly on Windows, but only displays black & white on the Mac
    2. ui_pict works correctly when overlaid on a button on the Mac, but vanishes (as you noted) on Windows.
Therefore, the ui_pict_button provides the button functionality on the Mac (but remaining hidden) and the ui_pict provides the picture, while the ui_pict_button provide the button and picture functionality on Windows. Messy, but it gets you there.
Ralph Wessel BArch
Richard Swann
Booster
Thanks for the UI_PICT_BUTTON tip, that looks just the job as an alternative.
Thanks GS for fulfilling my wish before I had it!
I have been trying to keep all library parts AC11- compatible so I don't think this would work for that, but it looks easier than the UI_INFIELD.
I have got round the problem using a method 1 list view but with the frame size larger than the content it does away with the scroll bar slider, so it looks and acts pretty much like a method 4 version.
Richard Swann
Mac OS X 10.11.4 , 27" Imac 4k ArchiCAD 4.5-20
Richard Swann
Booster
Thanks Ralph, thats just saved me a few hours!
I'll give it a go.
Richard Swann
Mac OS X 10.11.4 , 27" Imac 4k ArchiCAD 4.5-20
Learn and get certified!