Lakhtin_V Active Member Licensed User Longtime User Mar 30, 2018 #1 I want to have left and right buttons at the top of the window, in the middle part the title Code: Copy Dim bbt1, bbt2 As BarButton Page1.Title="GURU" bbt1.InitializeText("<Exit.","Exit") bbt2.InitializeText("Start>","Start") Page1.TopLeftButtons.Add(bbt1) Page1.TopRightButtons.Add(bbt2) The title appears and the buttons on the sides do not
I want to have left and right buttons at the top of the window, in the middle part the title Code: Copy Dim bbt1, bbt2 As BarButton Page1.Title="GURU" bbt1.InitializeText("<Exit.","Exit") bbt2.InitializeText("Start>","Start") Page1.TopLeftButtons.Add(bbt1) Page1.TopRightButtons.Add(bbt2) The title appears and the buttons on the sides do not
Erel B4X founder Staff member Licensed User Longtime User Mar 30, 2018 #2 It is a mistake to build the layout programmatically. Especially in B4J and B4i (see the B4i / B4J - Resize event video tutorial to understand why: https://www.b4x.com/etp.html). Take the time to learn to use the designer. It will be worth it. See TopLeftButtons documentation: https://www.b4x.com/b4i/help/views.html#page_toolbarbuttons You need to set a new list or array: Code: Copy Page1.TopLeftButtons = Array(bbt1) Upvote 0
It is a mistake to build the layout programmatically. Especially in B4J and B4i (see the B4i / B4J - Resize event video tutorial to understand why: https://www.b4x.com/etp.html). Take the time to learn to use the designer. It will be worth it. See TopLeftButtons documentation: https://www.b4x.com/b4i/help/views.html#page_toolbarbuttons You need to set a new list or array: Code: Copy Page1.TopLeftButtons = Array(bbt1)
Lakhtin_V Active Member Licensed User Longtime User Mar 31, 2018 #3 Thanks for the advice, I learned how to create Top Right Buttons on the topbar. I successfully created them with the help of the designer and in manual mode. But I do not understand how to set the code that will be executed when I press this button. In your video tutorial I did not find the answer. There is no such example in the user's Guide B4i. I tried to create a procedure like Sub bbt1_click but it does not work. Code: Copy Dim bbt1 as BarButton, bbt2 as BarButton bbt1.InitializeText("DO","TAGg") Page1.TopRightButtons=Array(bbt1) Private Sub TAGg_Click or Private Sub TAGg_BarButtonClick or Private Sub bbt1_BarButtonClick or Private Sub Page_BarButtonClick ->(from Guide) or ? In the design, it is possible. For simple Button I without problem generate Sub for Click event but for the barbaton this option is not found. Last edited: Mar 31, 2018 Upvote 0
Thanks for the advice, I learned how to create Top Right Buttons on the topbar. I successfully created them with the help of the designer and in manual mode. But I do not understand how to set the code that will be executed when I press this button. In your video tutorial I did not find the answer. There is no such example in the user's Guide B4i. I tried to create a procedure like Sub bbt1_click but it does not work. Code: Copy Dim bbt1 as BarButton, bbt2 as BarButton bbt1.InitializeText("DO","TAGg") Page1.TopRightButtons=Array(bbt1) Private Sub TAGg_Click or Private Sub TAGg_BarButtonClick or Private Sub bbt1_BarButtonClick or Private Sub Page_BarButtonClick ->(from Guide) or ? In the design, it is possible. For simple Button I without problem generate Sub for Click event but for the barbaton this option is not found.
klaus Expert Licensed User Longtime User Mar 31, 2018 #4 You need to use something like this: Code: Copy ' Page1 ToolBar buttons event routine Private Sub Page1_BarButtonClick (Tag As String) Select Tag Case "Exit" ' your code Case "Start" ' your code End Select End Sub Example extracted from the UINavBar example program in the B4i Beginner's Guide SourceCode. Upvote 0
You need to use something like this: Code: Copy ' Page1 ToolBar buttons event routine Private Sub Page1_BarButtonClick (Tag As String) Select Tag Case "Exit" ' your code Case "Start" ' your code End Select End Sub Example extracted from the UINavBar example program in the B4i Beginner's Guide SourceCode.
Lakhtin_V Active Member Licensed User Longtime User Mar 31, 2018 #5 The beginning word (Page1) of the name of the procedure must match the name of the page? Upvote 0
klaus Expert Licensed User Longtime User Mar 31, 2018 #6 Yes! Have a look at the UINavBar example program it contains three pages. Upvote 0