TheRealMatze Active Member Licensed User Feb 8, 2021 #1 Hi, next step on my lerning-agenda was "pages". Looks pretty much straight forward, and it´s the first time it works without exception. Only three 1/2 things are missing for me. When i start the b4j-version the new page opens in a new window. So far so good, but the other window is not locked. in vb i would open it as modal dialog, how can i simulate this? How can i control the window-startup-position? How can i control the "control-bar" (minimize, maximize, close) How can i remove the <- Arrow in the b4a-version Thanks Matthias
Hi, next step on my lerning-agenda was "pages". Looks pretty much straight forward, and it´s the first time it works without exception. Only three 1/2 things are missing for me. When i start the b4j-version the new page opens in a new window. So far so good, but the other window is not locked. in vb i would open it as modal dialog, how can i simulate this? How can i control the window-startup-position? How can i control the "control-bar" (minimize, maximize, close) How can i remove the <- Arrow in the b4a-version Thanks Matthias
Erel B4X founder Staff member Licensed User Longtime User Feb 8, 2021 #2 Better to start a new thread for each question. I recommend you to use B4XDialog for a dialog. TheRealMatze said: How can i control the window-startup-position? Click to expand... Code: Dim form As Form = B4XPages.GetNativeParent(Me) form.WindowsLeft = ... TheRealMatze said: How can i control the "control-bar" (minimize, maximize, close) Click to expand... MainForm.SetFormStyle in Main module. TheRealMatze said: How can i remove the <- Arrow in the b4a-version Click to expand... B4XPages.ShowPageAndRemovePreviousPages. Upvote 0
Better to start a new thread for each question. I recommend you to use B4XDialog for a dialog. TheRealMatze said: How can i control the window-startup-position? Click to expand... Code: Dim form As Form = B4XPages.GetNativeParent(Me) form.WindowsLeft = ... TheRealMatze said: How can i control the "control-bar" (minimize, maximize, close) Click to expand... MainForm.SetFormStyle in Main module. TheRealMatze said: How can i remove the <- Arrow in the b4a-version Click to expand... B4XPages.ShowPageAndRemovePreviousPages.
TheRealMatze Active Member Licensed User Feb 8, 2021 #3 Ok B4X: B4XPages.GetNativeParent(Me).SetFormStyle("UNDECORATED") Dim form As Form = B4XPages.GetNativeParent(Me) form.WindowLeft =200 form.Windowtop =200 works pretty well, but B4X: B4XPages.ShowPageAndRemovePreviousPages is not exact what i search for. I want to go back to the last page, but automaticly with B4XPages.ClosePage(Me) or with the hardware-button. i only want to remove the icon in the top... Normaly i split questions, but these are all related to the b4xpage... Upvote 0
Ok B4X: B4XPages.GetNativeParent(Me).SetFormStyle("UNDECORATED") Dim form As Form = B4XPages.GetNativeParent(Me) form.WindowLeft =200 form.Windowtop =200 works pretty well, but B4X: B4XPages.ShowPageAndRemovePreviousPages is not exact what i search for. I want to go back to the last page, but automaticly with B4XPages.ClosePage(Me) or with the hardware-button. i only want to remove the icon in the top... Normaly i split questions, but these are all related to the b4xpage...
Erel B4X founder Staff member Licensed User Longtime User Feb 9, 2021 #4 TheRealMatze said: Normaly i split questions, but these are all related to the b4xpage... Click to expand... No. There are millions of questions that can be asked about B4XPages and they are not related. It will be simpler to: 1. Call B4XPages.ShowPageAndClosePrevious instead of ClosePage. 2. Handle the CloseRequested event, cancel it and follow step #1. Upvote 0
TheRealMatze said: Normaly i split questions, but these are all related to the b4xpage... Click to expand... No. There are millions of questions that can be asked about B4XPages and they are not related. It will be simpler to: 1. Call B4XPages.ShowPageAndClosePrevious instead of ClosePage. 2. Handle the CloseRequested event, cancel it and follow step #1.
TheRealMatze Active Member Licensed User Feb 9, 2021 #5 Maybe i understand it wrong, but you mean the simplest way is to close the caller-window und open it again inside the closerequest-event? In this case the back button opens a new blank caller-window, so i have to log from which page the call comes and what data is entered in this page. Possible in 2 layers, but when the third comes... That's too much just to fulfill my view of aesthetics, so i let the arrow where it is... Upvote 0
Maybe i understand it wrong, but you mean the simplest way is to close the caller-window und open it again inside the closerequest-event? In this case the back button opens a new blank caller-window, so i have to log from which page the call comes and what data is entered in this page. Possible in 2 layers, but when the third comes... That's too much just to fulfill my view of aesthetics, so i let the arrow where it is...
TheRealMatze Active Member Licensed User Feb 10, 2021 #6 I found a demo for setOwner which look like the equivalent to a modalForm. It looks like B4XPages.GetNativeParent(Me) has also this function. Maybe this works, but i don´t know how to refer to the parent and the owner... Can anybody give me a hint how to use it? Upvote 0
I found a demo for setOwner which look like the equivalent to a modalForm. It looks like B4XPages.GetNativeParent(Me) has also this function. Maybe this works, but i don´t know how to refer to the parent and the owner... Can anybody give me a hint how to use it?
William Lancee Well-Known Member Licensed User Longtime User Feb 10, 2021 #7 Based on a solution by @Cableguy, you can hide the title icon as follows: B4X: Private Sub hideTitleIcon Dim bc As BitmapCreator bc.Initialize(32, 32) For i = 0 To 31 For j = 0 To 31 bc.SetColor(i, j, xui.Color_Transparent) Next Next bc.SetColor(0, 0, xui.Color_White) B4XPages.GetNativeParent(Me).icon = bc.bitmap End Sub You can set the title text by in Page2 class: B4X: Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 'load the layout to Root hideTitleIcon B4XPages.SetTitle(Me, "This is page 2 and note that there is no Icon") End Sub If you put the following in B4XMainpage (make sure to have B4XPages V1.08), page 2 will show first. B4X: Public Sub Initialize Dim p2 As page2 p2.Initialize B4XPages.AddPage("p2", p2) B4XPages.showPage("p2") End Sub To go back to the Mainpage, use: B4XPages.showPage("MainPage") whenever you want. Last edited: Feb 10, 2021 Upvote 0
Based on a solution by @Cableguy, you can hide the title icon as follows: B4X: Private Sub hideTitleIcon Dim bc As BitmapCreator bc.Initialize(32, 32) For i = 0 To 31 For j = 0 To 31 bc.SetColor(i, j, xui.Color_Transparent) Next Next bc.SetColor(0, 0, xui.Color_White) B4XPages.GetNativeParent(Me).icon = bc.bitmap End Sub You can set the title text by in Page2 class: B4X: Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 'load the layout to Root hideTitleIcon B4XPages.SetTitle(Me, "This is page 2 and note that there is no Icon") End Sub If you put the following in B4XMainpage (make sure to have B4XPages V1.08), page 2 will show first. B4X: Public Sub Initialize Dim p2 As page2 p2.Initialize B4XPages.AddPage("p2", p2) B4XPages.showPage("p2") End Sub To go back to the Mainpage, use: B4XPages.showPage("MainPage") whenever you want.
William Lancee Well-Known Member Licensed User Longtime User Feb 10, 2021 #8 You can also block the close event: B4X: Private Sub B4XPage_CloseRequest As ResumableSub Return False End Sub EDIT NOTE: This block is so effective that you can't close the app if this is the only window visible, and you haven't provided for other closure. I had to use Task Manager. Last edited: Feb 10, 2021 Upvote 0
You can also block the close event: B4X: Private Sub B4XPage_CloseRequest As ResumableSub Return False End Sub EDIT NOTE: This block is so effective that you can't close the app if this is the only window visible, and you haven't provided for other closure. I had to use Task Manager.
TILogistic Expert Licensed User Longtime User Feb 11, 2021 #9 Here is a demo (B4A, B4J), which has helped me understand the use of B4Xpages. which has helped me understand the use of B4Xpages in certain functionalities. It is a simple login to a modal sale that accesses the main window. But if you close the main window, you go back to the login page. from where you can only exit applications. P.S: It is tested on B4J and B4A I hope this helps.. Attachments Project.zip Project.zip 17.9 KB · Views: 702 Last edited: Feb 11, 2021 Upvote 0
Here is a demo (B4A, B4J), which has helped me understand the use of B4Xpages. which has helped me understand the use of B4Xpages in certain functionalities. It is a simple login to a modal sale that accesses the main window. But if you close the main window, you go back to the login page. from where you can only exit applications. P.S: It is tested on B4J and B4A I hope this helps..
William Lancee Well-Known Member Licensed User Longtime User Feb 11, 2021 #10 @oparra Your example is very useful, but it took me a while to realize that you commented out a line in the standard B4XPages template B4X: Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 ' MainForm.Show Dim PagesManager As B4XPagesManager PagesManager.Initialize(MainForm) End Sub This is needed for the setting to "UTILITY" to work. Thanks for discovering that. Upvote 0
@oparra Your example is very useful, but it took me a while to realize that you commented out a line in the standard B4XPages template B4X: Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 ' MainForm.Show Dim PagesManager As B4XPagesManager PagesManager.Initialize(MainForm) End Sub This is needed for the setting to "UTILITY" to work. Thanks for discovering that.
TILogistic Expert Licensed User Longtime User Feb 11, 2021 #11 William Lancee said: @oparra Your example is very useful, but it took me a while to realize that you commented out a line in the standard B4XPages template B4X: Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 ' MainForm.Show Dim PagesManager As B4XPagesManager PagesManager.Initialize(MainForm) End Sub This is needed for the setting to "UTILITY" to work. Thanks for discovering that. Click to expand... ' MainForm.Show (The problem is that in B4J it was throwing an error. ) My original intention was to create a splash and I saw that other things could be done, like a login. Dim PagesManager As B4XPagesManager PagesManager.Initialize(MainForm) Click to expand... if you see that the Parameter of PagesManager is the form to later control the display of the form in B4XmainPage Regards, Last edited: Feb 11, 2021 Upvote 0
William Lancee said: @oparra Your example is very useful, but it took me a while to realize that you commented out a line in the standard B4XPages template B4X: Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 ' MainForm.Show Dim PagesManager As B4XPagesManager PagesManager.Initialize(MainForm) End Sub This is needed for the setting to "UTILITY" to work. Thanks for discovering that. Click to expand... ' MainForm.Show (The problem is that in B4J it was throwing an error. ) My original intention was to create a splash and I saw that other things could be done, like a login. Dim PagesManager As B4XPagesManager PagesManager.Initialize(MainForm) Click to expand... if you see that the Parameter of PagesManager is the form to later control the display of the form in B4XmainPage Regards,