W wheretheidivides Active Member Licensed User Longtime User May 10, 2011 #1 OK, after spending 2 days looking for this on the forem, I'll just ask. The info I see doesn't really help much. I want to use the hardware menu key. The menu key would display a help screen (or several help screens) (or 1 long scrolling menu with the instructions). The options in the menu would then show a full screen panel with instructions. Sense the layout would be different, I would use a diferent module. So module 2 would have several different panels I could make visible to show the instructions pages. That's it. Nothing fancy. Could someone post example code of this? i could just modify the code. I found this to be a lot easier. "Remember, the B in BASIC stands for Beginners"
OK, after spending 2 days looking for this on the forem, I'll just ask. The info I see doesn't really help much. I want to use the hardware menu key. The menu key would display a help screen (or several help screens) (or 1 long scrolling menu with the instructions). The options in the menu would then show a full screen panel with instructions. Sense the layout would be different, I would use a diferent module. So module 2 would have several different panels I could make visible to show the instructions pages. That's it. Nothing fancy. Could someone post example code of this? i could just modify the code. I found this to be a lot easier. "Remember, the B in BASIC stands for Beginners"
klaus Expert Licensed User Longtime User May 10, 2011 #2 Attached a small example that will let you begin with. Instead of having the panels in the activity you can also create one layout file for each panel and add the panels by code and load their respective layout files. Best regards. Attachments MenuPanels.zip MenuPanels.zip 5.9 KB · Views: 725 Upvote 0
Attached a small example that will let you begin with. Instead of having the panels in the activity you can also create one layout file for each panel and add the panels by code and load their respective layout files. Best regards.
W wheretheidivides Active Member Licensed User Longtime User May 10, 2011 #3 Would doing it this way mess up the layout already in the module main? I am just trying to have a menu pop up after pressing the menu button. 'Activity module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. End Sub Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim Panel0, Panel1, Panel2, Panel3 As Panel End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("MenuPanels") Activity.AddMenuItem("Help1","Help") Activity.AddMenuItem("Help2","Help") Activity.AddMenuItem("Help3","Help") Panel1.Top = 0 Panel1.Left = 0 Panel2.Top = 0 Panel2.Left = 0 Panel3.Top = 0 Panel3.Left = 0 End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub Help_Click Select Sender Case "Help1" Panel1.Visible=True Case "Help2" Panel2.Visible=True Case "Help3" Panel3.Visible=True End Select End Sub Sub Button_Click Dim Send As Button Send = Sender Select Send.Tag Case "1" Panel1.Visible=False Case "2" Panel2.Visible=False Case "3" Panel3.Visible=False End Select End Sub Last edited: May 10, 2011 Upvote 0
Would doing it this way mess up the layout already in the module main? I am just trying to have a menu pop up after pressing the menu button. 'Activity module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. End Sub Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim Panel0, Panel1, Panel2, Panel3 As Panel End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("MenuPanels") Activity.AddMenuItem("Help1","Help") Activity.AddMenuItem("Help2","Help") Activity.AddMenuItem("Help3","Help") Panel1.Top = 0 Panel1.Left = 0 Panel2.Top = 0 Panel2.Left = 0 Panel3.Top = 0 Panel3.Left = 0 End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub Help_Click Select Sender Case "Help1" Panel1.Visible=True Case "Help2" Panel2.Visible=True Case "Help3" Panel3.Visible=True End Select End Sub Sub Button_Click Dim Send As Button Send = Sender Select Send.Tag Case "1" Panel1.Visible=False Case "2" Panel2.Visible=False Case "3" Panel3.Visible=False End Select End Sub
S SarahWard Banned Aug 31, 2011 #4 klaus said: Attached a small example that will let you begin with. Instead of having the panels in the activity you can also create one layout file for each panel and add the panels by code and load their respective layout files. Best regards. Click to expand... Klaus I don't understand how I would use your program to give the 3 help buttons names like: Options, Settings, etc. If you change the TITLE 'help1' and 'help2' value the help buttons don't work. For instance... Your code works... Activity.AddMenuItem("Help1","Help") Activity.AddMenuItem("Help2","Help") Changing the titles of each help button doesn't work... Activity.AddMenuItem("OPTIONS","Help") Activity.AddMenuItem("SETTINGS","Help") Upvote 0
klaus said: Attached a small example that will let you begin with. Instead of having the panels in the activity you can also create one layout file for each panel and add the panels by code and load their respective layout files. Best regards. Click to expand... Klaus I don't understand how I would use your program to give the 3 help buttons names like: Options, Settings, etc. If you change the TITLE 'help1' and 'help2' value the help buttons don't work. For instance... Your code works... Activity.AddMenuItem("Help1","Help") Activity.AddMenuItem("Help2","Help") Changing the titles of each help button doesn't work... Activity.AddMenuItem("OPTIONS","Help") Activity.AddMenuItem("SETTINGS","Help")
klaus Expert Licensed User Longtime User Aug 31, 2011 #5 Hi Sarah, When you change the Title of a menu item you must use this same name in the event routine. In our exapmle: Changing: Code: Copy Activity.AddMenuItem("Options","Help") Activity.AddMenuItem("Settings","Help") Activity.AddMenuItem("Help3","Help") You must also change this: Code: Copy Sub Help_Click Select Sender Case "Options" Panel1.Visible=True Case "Settings" Panel2.Visible=True Case "Help3" Panel3.Visible=True End Select End Sub Best regards. Last edited: Jun 21, 2012 Upvote 0
Hi Sarah, When you change the Title of a menu item you must use this same name in the event routine. In our exapmle: Changing: Code: Copy Activity.AddMenuItem("Options","Help") Activity.AddMenuItem("Settings","Help") Activity.AddMenuItem("Help3","Help") You must also change this: Code: Copy Sub Help_Click Select Sender Case "Options" Panel1.Visible=True Case "Settings" Panel2.Visible=True Case "Help3" Panel3.Visible=True End Select End Sub Best regards.
M Mikie Member Licensed User Longtime User Aug 31, 2011 #6 I am a newbie. Attaching a simple menu app. Keep in mind I am not in Klaus's league. Attachments BasicMenu1c.zip BasicMenu1c.zip 10.8 KB · Views: 529 Upvote 0
S SarahWard Banned Aug 31, 2011 #7 klaus said: Hi Sarah, When you change the Title of a menu item you must use this same name in the event routine. Best regards. Click to expand... Thanks Klaus, Now I understand. Upvote 0
klaus said: Hi Sarah, When you change the Title of a menu item you must use this same name in the event routine. Best regards. Click to expand... Thanks Klaus, Now I understand.
J JaunLukePicard Member Licensed User Longtime User Jun 21, 2012 #8 Klaus, This menu example is close to what I am looking for. Is it possible to use a layout file just for the menu I want as opposed to using AddMenuItem? Or are Layout files used soley for full screens on the device? If a Layout file cannot be used can we use a Panel and add buttons to that panel and achieve the same effect? I like the menu feature, but prefer to use the Button view as I can size and color the button as I like. Upvote 0
Klaus, This menu example is close to what I am looking for. Is it possible to use a layout file just for the menu I want as opposed to using AddMenuItem? Or are Layout files used soley for full screens on the device? If a Layout file cannot be used can we use a Panel and add buttons to that panel and achieve the same effect? I like the menu feature, but prefer to use the Button view as I can size and color the button as I like.
klaus Expert Licensed User Longtime User Jun 21, 2012 #9 No you can't use a layout file for the menu. You could have a look at chapter 12.1 Example programs / User interfaces page 144 in the Beginner's Guide. There are three examples: Menu, TabHost and Buttons. I have been a Button fan for a long time already in Windows programs. Best regards. Upvote 0
No you can't use a layout file for the menu. You could have a look at chapter 12.1 Example programs / User interfaces page 144 in the Beginner's Guide. There are three examples: Menu, TabHost and Buttons. I have been a Button fan for a long time already in Windows programs. Best regards.
J johnaaronrose Active Member Licensed User Longtime User Jul 19, 2012 #10 Row height Is there a fixed value for the height of a row in the menu? Can it be changed? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 20, 2012 #11 Please start a new thread for this question. Upvote 0