For j = 0 To Starter.TodoList.Size-1
'Log("...")
'Log("*TodoList counter = "&j)
Private TempTodo As Todo
TempTodo.Initialize
TempTodo = Starter.TodoList.Get(j)
I got that code from line 41 of the ExcelExample which I downloaded from here:1. You are adding the Table in the Designer, but then in the LoadTable routine you remove it and add a new one by code. Why ?
You should keep it and select the needed properties directly in the Designer.
2 reasons:2. You have 7 columns but you display only 2, why ?
I don't understand what you mean by "the last lines are executed".3. I do not understand what you want to do in the Table1_CellClick event routine.
When pressing any button, the last lines are executed, do you really want to do this.
For me, the Cancel button should do nothing. And what do you want to do when the No button is clicked ?
No problem. I will address those.I have changed some lines to make it work on my computer.
These lines have this comment at the end: 'klaus
No problem. I will uncomment it.I commented the Tracker start.
No problem. I will put that back to how it was.I changed the the file dir to File.DirAssets
I assume that is because of the No or Cancel on the Msgbox2Async as mentioned above.I commented the call to TableSave_Click.
That is nice since I can now scroll left and right.I set the number of columns to 7 in the Designer.
I see your changes. Looks good to me.I changed the code of the LoadTable routine.
Again that is nice.I changed the column width to show all columns, the Table version allows horizontal scrolling.
'This changes the file name for the active spreadsheet throughout the whole program:
Starter.FileName = "todo list.xls"
LoadTable
' TableSave_Click 'klaus
Else
End If
' 'This changes the file name for the active spreadsheet throughout the whole program:
' Starter.FileName = "todo list.xls"
'
' LoadTable
' TableSave_Click 'klaus
End Sub
What do you mean with 'is left alone' ?I did what you said about moving the last line into the If / Then.
The table is left alone if no or cancel is clicked.
'add the headers to the sheet
' For Each lbl As Label In table1.Header
For i = 0 To table1.NumberOfColumns - 1
Private cell As WritableCell
' cell.InitializeText(col, 0, lbl.Text)
cell.InitializeText(col, 0, table1.HeaderNames.Get(i))
cell.SetCellFormat(cellFormat)
sheet1.AddCell(cell)
sheet1.SetColumnWidth(col, 15)
col = col + 1
Next
I don't understand I watched it and everything was fine. There were no errors at allI had a look at your project.
Some questions:
1. You are adding the Table in the Designer, but then in the LoadTable routine you remove it and add a new one by code. Why ?
You should keep it and select the needed properties directly in the Designer.
2. You have 7 columns but you display only 2, why ?
3. I do not understand what you want to do in the Table1_CellClick event routine.
When pressing any button, the last lines are executed, do you really want to do this.
For me, the Cancel button should do nothing. And what do you want to do when the No button is clicked ?
Attached you find your project modified.
I have changed some lines to make it work on my computer.
These lines have this comment at the end: 'klaus
I commented the Tracker start.
I changed the the file dir to File.DirAssets
I commented the call to TableSave_Click.
If you want to find free games and applications on mobile platforms, you can refer to the Techongame website, which is safe so you can feel secure in the experience.
I set the number of columns to 7 in the Designer.
I changed the code of the LoadTable routine.
I changed the column width to show all columns, the Table version allows horizontal scrolling.
Sub Process_Globals
Log("********Process_Globals sub start")
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Type Todo(ID As Short, Name As String, Status As Byte, Context As String, Category As Byte, Priority As Int, Note As String)
Public Contexts(40,7) As String
Public LastContext As Byte
Public ExitFlag As Byte
Public Close As Boolean
Public NotificationAllowed As Boolean = True
Public MenuBuilt As Boolean = False
Public rp As RuntimePermissions
Public myMap As Map
Public WhichTodosToShow As String = "All" 'This will set the value only at the beginning of the program.
Public TodoList As List
Public Dir As String
Public FileName As String
End Sub
Sub Globals
Log("Globals sub start")
'These global variables will be redeclared each time the activity is created.
Public table1 As Table
Private Statuses(12,2) As String
Private Categories(40,2) As String
Private HeaderRow(7) As String
Private n As Notification = CreateNotification("Tap to Proceed.") 'This immediately calls the CreateNotification sub.
Public Table1Header(7) As String
' Private lblPleaseWait As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Log("Activity_Create sub started FIRST TIME")
Activity.LoadLayout("Main")
'AddMenuItems must be at the beginning of Activity_Create or they won't show
Activity.AddMenuItem("Show Close Todos", "ShowCloseTodos")
Activity.AddMenuItem("Leave Here", "LeaveHere")
'Activity.AddMenuItem("Load Table", "LoadTable")
Activity.AddMenuItem("Save Table", "TableSave")
Activity.AddMenuItem("Allow Context Notification", "AllowContextNotification")
Activity.AddMenuItem("Clear Context Notification", "ClearContextNotification")
Activity.AddMenuItem("Exit Program", "ExitProgram")
If FirstTime Then
myMap.Initialize
'Get access to downloads
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
Log("Finished getting permission")
If Result = False Then
Log("No external permissions")
Return
End If
Dir = File.Combine(File.DirRootExternal,"Download")
FileName = "todo list.xls"
LoadArrays
End If
End Sub
Sub Activity_Resume
Log("Activity_Resume sub start")
'Any call to Sleep() or Wait For will cause a return to the parent sub.
Wait For (CheckAndRequestNotificationPermission) Complete (HasPermission As Boolean)
Log("Check and Requestion Notification Permission should be complete")
If HasPermission = False Then
Log("no permission")
ToastMessageShow("no permission", True)
Return
End If
'Get access to fine location
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
StartService(Tracker) 'klaus
Else
ToastMessageShow("No permission...", True)
End If
'Get access to downloads
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
Log("Finished getting permission")
If Result = False Then
Log("No external permissions")
Return
End If
'Log("WhichTodosToShow = "&WhichTodosToShow)
Log("Calling LoadTable from Activity_Resume")
LoadTable
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?