Home › Forums › Problems and solutions in GDL › Informations from the environment › Requesting platform, mac or windows
- This topic has 10 replies, 3 voices, and was last updated 6 years, 4 months ago by shaun coomber.
-
AuthorPosts
-
-
July 6, 2018 at 11:58 #4163shaun coomberParticipant
Hi,
Is it possible to request whether the user is on Windows or OS?
I am looking to customise some parts of the UI where some of the UI_INFIELD options display differently depending on the platform.
Thanks
Shaun -
July 6, 2018 at 12:25 #4164Dominika BobályKeymaster
Hi Shaun,
officially any library part is considered platform-independent, so there is no built-in way within GDL to “know” about the platform.
Could you upload here a win-mac comparison image of the issue you are experiencing with ui_infield? With example code, if possible.
As far as I know, there should be only very small differences, mostly in connection with the control layouts “borrowed” from the platform’s op. system itself. If you see something very different, maybe it’s a bug so I would like to check.
Or maybe we can suggest a workaround:).
Thanks!Dominika Bobály
Product Manager
GRAPHISOFT SE -
July 6, 2018 at 15:56 #4165shaun coomberParticipant
I’ve tried two different methods.
With ui_infield method 1, the interface leaves more of a space between each option on Windows. Even if I increase the size of the field to accommodate the scroll bar etc. it doesn’t display well. On Mac, it looks fine.
With ui_infield method 6, I have created a separate ui_infield command for each option. On windows it displays nicely, but on Mac it doesn’t show which is selected.
Method 1 images are attached…
Attachments:
-
July 6, 2018 at 15:57 #4168shaun coomberParticipant
And here are the method 6 images…
Attachments:
-
July 6, 2018 at 16:01 #4171shaun coomberParticipant
Here is the code for method 1:
UI_INFIELD{3} SelectField, xpos, ypos+yspc, useWidth*4+20, useHeight*2,
1, 25,
8, 2,
useWidth, useHeight, useWidth, useHeight,
1, “”, 1,
2, “”, 2,
3, “”, 3,
4, “”, 4,
5, “”, 5,
6, “”, 6,
7, “”, 7,
8, “”, 8And here is the code for method 6:
FOR k = 1 TO 4
UI_INFIELD{3} SelectField, xpos+useWidth*(k-1), ypos+yspc, useWidth, useHeight,
6, 25,
8, 2,
useWidth, useHeight, useWidth, useHeight,
k, “”, k+10,
k, “”, kNEXT k
FOR k = 5 TO 8
UI_INFIELD{3} SelectField, xpos+useWidth*(k-5), ypos+yspc+useHeight, useWidth, useHeight,
6, 25,
8, 2,
useWidth, useHeight, useWidth, useHeight,
k, “”, k+10,
k, “”, kNEXT k
With the following trick in the parameter script:
IF SelectField > 10 THEN
SelectField = SelectField – 10
PARAMETERS SelectField = SelectField
ENDIF-
July 11, 2018 at 13:15 #4184Dominika BobályKeymaster
Pressed the wrong reply, see some info below Joachim’s post:)
Dominika Bobály
Product Manager
GRAPHISOFT SE
-
-
July 7, 2018 at 16:20 #4172Joachim SühloParticipant
Hi,
there a really a lot of differences, how the UI Elements are shown on Windows and MAC.
E.G. length and size of text, points of linebrakes, UI_Styles.We use in our office the following REQUEST to distinguish between both platforms.
! Parameters for ArchiCAD version and Platform
Dose = 0
sts = REQUEST(“Name_of_program”, “”,TeX)
IF STRSTR(TeX,”.EXE”) OR STRSTR(TeX,”.exe”) THEN Dose = 1And we always check the UI on both platforms.
GDL Object Developer
b-prisma
MAC OSx 10.14-
July 11, 2018 at 13:06 #4181Dominika BobályKeymaster
Shaun,
thanks for the uploads. We are aware of the issue with ui_infield: before AC 22, there was no correct way to set up a multi-row image control for the same parameter. Viable workaround does not really exist (not even with method 4): ui_infield does not tolerate well if parts of the valid parameter value range are omitted from the UI control.
Since we also had issues with this, for AC 22 new interface commands were introduced to make the layout possible: UI_PICT_RADIOBUTTON.
You can create a mosaic-image with pushable parts (note, only one part can be selected in this case).
If you want multiple parts of the mosaic to be pushable at the same time (booleans), you can use the UI_PICT_PUSHCHECKBUTTON the same way.
Just ignore the preview overlap warnings if you want to have a continuous mosaic image:).
Enclosed are the resulting controls on both platforms.
Is this what you want it to look like? I used this cross image to check on the image edges.Attachments:
Dominika Bobály
Product Manager
GRAPHISOFT SE
-
-
July 9, 2018 at 12:59 #4173shaun coomberParticipant
! Parameters for ArchiCAD version and Platform
Dose = 0
sts = REQUEST(“Name_of_program”, “”,TeX)
IF STRSTR(TeX,”.EXE”) OR STRSTR(TeX,”.exe”) THEN Dose = 1That is brilliant, it works perfectly! Thank you
-
July 9, 2018 at 19:33 #4174Joachim SühloParticipant
That is brilliant, it works perfectly! Thank you
Thanks to Frank Beister, who had published this on openegdl.org.
GDL Object Developer
b-prisma
MAC OSx 10.14 -
July 12, 2018 at 14:44 #4189shaun coomberParticipant
Hi Dominika,
Thank you, I will try that too.
I’ve just found another difference between Mac and Windows interfaces… UI_INFIELD with method 8 can be set with different heights on Windows, but on Mac this setting is ignored and the drop-down list is also displayed with the same height.
UI_INFIELD{3} “editField”, 75, ypos-3, 313, 22,
8, “”, 0, 0, 0, 0, 0, 0,
“”, editType[1], editType[1],
“”, editType[2], editType[2],
“”, editType[3], editType[3],
“”, editType[4], editType[4]
-
-
AuthorPosts
- The forum ‘Informations from the environment’ is closed to new topics and replies.