cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Starting August 6, 2024, TLS 1.2 will be the minimum required protocol version for Graphisoft products and services that require an online connection. Learn more…
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

UI Page Nav

Anonymous
Not applicable
Hello,
I'm getting fairly desperate trying to create page navigation for a UI!
I'm using Acad 15.

I have tried a number of different methods I have found around the net, but I cannot get any of them working and it is driving me up the wall!

The code below is the closest I could get it to work, where manually changing the gs_ui_current_page parameter will display the desired page. Clicking the button related to changing page DOES update the gs_ui_current_page parameter, but it doesn't change the page.
In fact clicking ANY UI_BUTTON object clears the page!!!

here is a small piece of stand alone code that I'm trying to get working.
Please note i have also tried the ui_next and ui_prev methods with no luck.

values "gs_ui_current_page", 1, 2

! parameter script
if GLOB_UI_BUTTON_ID = 1 then
        parameters gs_ui_current_page = 1
endif
if GLOB_UI_BUTTON_ID = 2 then
        parameters gs_ui_current_page = 2
endif

UI_CURRENT_PAGE gs_ui_current_page

ui_page 1
	UI_BUTTON UI_FUNCTION, "2", 0,50, 70,20, 2
	UI_BUTTON UI_LINK, "Visit", 200,180, 100,20, 0,
        "http://www.graphisoft.com"

ui_page 2
	UI_BUTTON UI_FUNCTION, "1", 0,50, 70,20, 1
	UI_BUTTON UI_LINK, "website", 200,180, 100,20, 0,
        "http://www.graphisoft.com"
Help would be appreciated
5 REPLIES 5
Anonymous
Not applicable
Try to use
....... Gosub "page_2"
....... Gosub "page_1"

!Page 1
"page_1":
.......
return

!Page 2
"page_2":
........
Anonymous
Not applicable
Hi johnau,
take a look at the "Interface" script in the object "Material Legend 15.gsm" in the Archicad 15 Library... 1.7 2D Elements 15 / Graphic Symbols 15 /;
and its respective macro "ui_tabcontrol.gsm" (you must first EXTRACT the "ArchiCAD Library 15.lcf" container)
sinceV6
Advocate
Hi.

EDIT

Was too fast to respond without completely looking into the problem.
You'll need the gs_ui_current_page integer parameter
and
VALUES "gs_ui_current_page" 1,2,3
in the parameter script.


Check this code and modify to your needs in the interface script. Is a basic interface script I created for a library globals object some time ago:


!===PAGES==========
DIM pages[]
pages[1] = 'Some settings'
pages[2] = '2D Representation'
pages[3] = '3D options'
!================================================================================

UI_DIALOG "TITLE", 444, 296
UI_CURRENT_PAGE gs_ui_current_page

UI_PAGE gs_ui_current_page

UI_INFIELD{3} "gs_ui_current_page", 0,0, 300, 25,
	2, "",
	0, 0,
	1, 1, 1, 1,
	"",	pages[1], 1,
	"",	pages[2], 2,
	"", pages[3], 3

UI_BUTTON UI_PREV, "<<", 310, 2, 30, 20, 1	! Previous
UI_BUTTON UI_NEXT, ">>", 340, 2, 30, 20, 2	! Next

UI_STYLE 0,0


!*********************
UI_PAGE 1
!*********************
UI_OUTFIELD "SOME PARAMETERS", 0, 30, 0, 1,4

!*********************
UI_PAGE 2
!*********************
UI_OUTFIELD "OTHER", 0, 30, 0, 1,4

!*********************
UI_PAGE 3
!*********************
UI_OUTFIELD "SOME MORE PARAMETERS", 0, 30, 0, 1,4

It should work.
Best regards.
sinceV6
Advocate
johnau wrote:
Hello,
I'm getting fairly desperate trying to create page navigation for a UI!
I'm using Acad 15.

I have tried a number of different methods I have found around the net, but I cannot get any of them working and it is driving me up the wall!

The code below is the closest I could get it to work, where manually changing the gs_ui_current_page parameter will display the desired page. Clicking the button related to changing page DOES update the gs_ui_current_page parameter, but it doesn't change the page.
In fact clicking ANY UI_BUTTON object clears the page!!!

here is a small piece of stand alone code that I'm trying to get working.
Please note i have also tried the ui_next and ui_prev methods with no luck.

values "gs_ui_current_page", 1, 2

! parameter script
if GLOB_UI_BUTTON_ID = 1 then
        parameters gs_ui_current_page = 1
endif
if GLOB_UI_BUTTON_ID = 2 then
        parameters gs_ui_current_page = 2
endif

UI_CURRENT_PAGE gs_ui_current_page

ui_page 1
	UI_BUTTON UI_FUNCTION, "2", 0,50, 70,20, 2
	UI_BUTTON UI_LINK, "Visit", 200,180, 100,20, 0,
        "http://www.graphisoft.com"

ui_page 2
	UI_BUTTON UI_FUNCTION, "1", 0,50, 70,20, 1
	UI_BUTTON UI_LINK, "website", 200,180, 100,20, 0,
        "http://www.graphisoft.com"
Help would be appreciated
As for your code, it works; provided you have the gs_ui_current_page integer parameter and put the bits of code in the corresponding scripts:

PARAMETER SCRIPT

values "gs_ui_current_page" 1, 2 !You had an extra comma here

if GLOB_UI_BUTTON_ID = 1 then
        parameters gs_ui_current_page = 1
endif
if GLOB_UI_BUTTON_ID = 2 then
        parameters gs_ui_current_page = 2
endif
INTERFACE SCRIPT

UI_CURRENT_PAGE gs_ui_current_page

ui_page 1
	UI_BUTTON UI_FUNCTION, "2", 0,50, 70,20, 2
	UI_BUTTON UI_LINK, "Visit", 200,180, 100,20, 0,
        "http://www.graphisoft.com"

ui_page 2
	UI_BUTTON UI_FUNCTION, "1", 0,50, 70,20, 1
	UI_BUTTON UI_LINK, "website", 200,180, 100,20, 0,
        "http://www.graphisoft.com"
Best regards
Anonymous
Not applicable
Thank you nGhost, andro55 and sinceV6.
As some of you mentioned, some refactoring was required (moved the UI to the interface area, and also added the values to the gs_ui_current_page param (thanks sinceV6).

It turned out for some reason I could not do:
PAGE_ONE = 1
PAGE_TWO = 2

UI_PAGE PAGE_ONE

! // code here

UI_PAGE PAGE_TWO

! // code here
but instead had to just use
UI_PAGE 1
! // code here

UI_PAGE 2
! // code here
To get it working successfully.
Anyway, thanks for your tips, it is now working enough to use, I will see if I can get things working a bit better by further breaking down your responses.

Thanks again.


edit: you guys are legends btw, this GDL stuff is doing my head in I'm used to PHP and Python