Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
16 user(s) are online (16 user(s) are browsing Forum)

Members: 0
Guests: 16

more...


Browsing this Thread:   1 Anonymous Users






Re: Need example how use cGuiGroupPage in std/cGUI module
#9
Home away from home
Home away from home


See User information
@mrdarek
Yes, that is the best way to do it

Posted on: 2011/6/5 19:00
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Need example how use cGuiGroupPage in std/cGUI module
#8
Just can't stay away
Just can't stay away


See User information
My program should display second page on start. How modify code from 3 post to do it???

-------------------------
OK - I found it!! CODE:

win.build(TRUE)
guiPages.setStateItem(guiPage1)
win.open()

Posted on: 2011/6/5 13:37

Edited by mrdarek on 2011/6/5 15:55:36
Edited by mrdarek on 2011/6/5 15:57:46
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Need example how use cGuiGroupPage in std/cGUI module
#7
Just can't stay away
Just can't stay away


See User information
Thanks for nice example - it work for me. I can calling menu using menu name like in example - it's good idea.

Posted on: 2011/5/8 6:53
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Need example how use cGuiGroupPage in std/cGUI module
#6
Home away from home
Home away from home


See User information
Ok.

I only had a raw MUI 3.8 install on my hardfile but I'll have to update it soon anyway.

Posted on: 2011/5/4 19:01
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Need example how use cGuiGroupPage in std/cGUI module
#5
Home away from home
Home away from home


See User information
@SamuraiCrow
Outputting AmigaE code (instead of C++) is no-longer heavily tested, and in fact I haven't tested it YET for the r6 beta/preview release, so I would not be surprised if it did not work properly. With luck it may be easy to fix any problems that have been added by recent updates.

To be honest, I didn't think there was any interest in this output mode, so I had been considering (ONLY considering) getting rid of it entirely. PLEASE speak out if you think it should be kept!

Rest assured that the above example will work on AmigaOS3, when generating C++ code (as it does by default).

Quote:
Does the textbox require the TextEdit.mcc file?

The StringBox (not used in this example) requires the TextEditor MCC. But this is such a common MUI add-on that I didn't think it'd be a problem (no other MCCs are required).

Posted on: 2011/5/2 9:09

Edited by PortablE on 2011/6/5 18:59:36
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Need example how use cGuiGroupPage in std/cGUI module
#4
Home away from home
Home away from home


See User information
I tried copying and pasting that example into my E-UAE hardfile and compiling it. Does the textbox require the TextEdit.mcc file? It wouldn't compile without it. I used the output language set to AmigaE. There were a few warnings about rebracketing not being completely successful.

Posted on: 2011/5/1 22:20
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Need example how use cGuiGroupPage in std/cGUI module
#3
Home away from home
Home away from home


See User information
@mrdarek
Here is an example of how to use the Page group, but please make sure you update to the latest (just released) version of PortablE which fixes several bad GUI bugs:

<pre>MODULE 'std/cGui'

PROC main()
DEF quit:BOOL
DEF win:PTR TO cGuiWindow, item:PTR TO cGuiItem
DEF guiPages:PTR TO cGuiGroupPage
DEF guiPage0:PTR TO cGuiItem, guiButtonGo:PTR TO cGuiButton
DEF guiPage1:PTR TO cGuiItem, guiButtonReturn:PTR TO cGuiButton

CreateApp().build() ->equivalent to IsDesktopApp()

->create the GUI
win := CreateGuiWindow('example')
guiPages := win.beginGroupPage()
guiPage0 := win.beginGroupVertical()
win.addTextBox('').setState('Hello world!')
guiButtonGo := win.addButton('Go')
win.endGroup()

guiPage1 := win.beginGroupVertical()
win.addTextBox('').setState('Goodbye cruel world!')
guiButtonReturn := win.addButton('Return')
win.endGroup()
win.endGroup()
win.build()

->handle GUI events
quit := FALSE
REPEAT
item := WaitForChangedGuiItem()
SELECT item
CASE NIL
->(a non-item event occured) so check if user tried to close the window
IF win.getCloseRequest() THEN quit := TRUE

CASE guiButtonGo
->Print('Go button was pressed\n')

->this is one way of changing the visible page
guiPages.setState(1)

->but we could have used:
->guiPages.setStateItem(guiPage1)

CASE guiButtonReturn
->Print('Return button was pressed\n')

->this is another way of changing the visible page
guiPages.setStateItem(guiPage0)

->but we could have used:
->guiPages.setState(0)
ENDSELECT
UNTIL quit

win.close()
FINALLY
PrintException()
ENDPROC</pre>

Posted on: 2011/4/28 21:56
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Need example how use cGuiGroupPage in std/cGUI module
#2
Home away from home
Home away from home


See User information
I was going to post an example, but I've run into a bug which seems to stop buttons from responding, so I will need to look into that...

EDIT: I have found two bugs so far that prevent my example from working. I am working on fixing both of them...

Posted on: 2011/4/25 20:29

Edited by PortablE on 2011/4/28 14:19:55
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Need example how use cGuiGroupPage in std/cGUI module
#1
Just can't stay away
Just can't stay away


See User information
I resign coding game menu in graphics mode because calculating text size is slow and not flexible. I start coding my game menu using std/cGUI. My menu has some submenus so I want use Group page feature to display only one menu at current time.
I need simple example:
Menu with button (newpage) - after clicking on this button I expect display second page with button(return) - after click on this button program should return to first page with button(newpage).
How code it and handle it using GroupPage feature - please someone help me???

Posted on: 2011/4/24 9:16
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project