Skip to content

Commit b90bb4e

Browse files
committed
Initial commit
1 parent ebd9a16 commit b90bb4e

File tree

11 files changed

+289
-0
lines changed

11 files changed

+289
-0
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
# Auto detect text files and perform LF normalization
22
* text=auto
3+
4+
*.b4a linguist-language=B4X
5+
*.b4i linguist-language=B4X
6+
*.b4j linguist-language=B4X
7+
*.bas linguist-language=B4X
8+
*.b4a linguist-detectable=true
9+
*.b4i linguist-detectable=true
10+
*.b4j linguist-detectable=true
11+
*.bas linguist-detectable=true

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ignore files
2+
*.meta
3+
*.zip
4+
5+
# ignore ALL files in these directories
6+
AutoBackups/
7+
Objects/

B4A/$APPNAME$.b4a

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
Build1=Default,b4a.example
2+
File1=MainPage.bal
3+
FileGroup1=Default Group
4+
Group=Default Group
5+
Library1=core
6+
Library2=b4xpages
7+
ManifestCode='This code will be applied to the manifest file during compilation.~\n~'You do not need to modify it in most cases.~\n~'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136~\n~AddManifestText(~\n~<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33"/>~\n~<supports-screens android:largeScreens="true" ~\n~ android:normalScreens="true" ~\n~ android:smallScreens="true" ~\n~ android:anyDensity="true"/>)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~CreateResourceFromFile(Macro, Themes.LightTheme)~\n~'End of default text.~\n~
8+
Module1=|relative|..\B4XMainPage
9+
Module2=Starter
10+
NumberOfFiles=1
11+
NumberOfLibraries=2
12+
NumberOfModules=2
13+
Version=12.8
14+
@EndOfDesignText@
15+
#Region Project Attributes
16+
#ApplicationLabel: B4A Example
17+
#VersionCode: 1
18+
#VersionName:
19+
'SupportedOrientations possible values: unspecified, landscape or portrait.
20+
#SupportedOrientations: portrait
21+
#CanInstallToExternalStorage: False
22+
#End Region
23+
24+
#Region Activity Attributes
25+
#FullScreen: False
26+
#IncludeTitle: True
27+
#End Region
28+
29+
'#BridgeLogger: True
30+
31+
Sub Process_Globals
32+
Public ActionBarHomeClicked As Boolean
33+
End Sub
34+
35+
Sub Globals
36+
37+
End Sub
38+
39+
Sub Activity_Create(FirstTime As Boolean)
40+
Dim pm As B4XPagesManager
41+
pm.Initialize(Activity)
42+
End Sub
43+
44+
'Template version: B4A-1.01
45+
#Region Delegates
46+
47+
Sub Activity_ActionBarHomeClick
48+
ActionBarHomeClicked = True
49+
B4XPages.Delegate.Activity_ActionBarHomeClick
50+
ActionBarHomeClicked = False
51+
End Sub
52+
53+
Sub Activity_KeyPress (KeyCode As Int) As Boolean
54+
Return B4XPages.Delegate.Activity_KeyPress(KeyCode)
55+
End Sub
56+
57+
Sub Activity_Resume
58+
B4XPages.Delegate.Activity_Resume
59+
End Sub
60+
61+
Sub Activity_Pause (UserClosed As Boolean)
62+
B4XPages.Delegate.Activity_Pause
63+
End Sub
64+
65+
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
66+
B4XPages.Delegate.Activity_PermissionResult(Permission, Result)
67+
End Sub
68+
69+
Sub Create_Menu (Menu As Object)
70+
B4XPages.Delegate.Create_Menu(Menu)
71+
End Sub
72+
73+
#if Java
74+
public boolean _onCreateOptionsMenu(android.view.Menu menu) {
75+
processBA.raiseEvent(null, "create_menu", menu);
76+
return true;
77+
78+
}
79+
#End If
80+
#End Region
81+
82+
'Program code should go into B4XMainPage and other pages.

B4A/Files/mainpage.bal

1.55 KB
Binary file not shown.

B4A/Starter.bas

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
B4A=true
2+
Group=Default Group
3+
ModulesStructureVersion=1
4+
Type=Service
5+
Version=9.85
6+
@EndOfDesignText@
7+
#Region Service Attributes
8+
#StartAtBoot: False
9+
#ExcludeFromLibrary: True
10+
#End Region
11+
12+
Sub Process_Globals
13+
'These global variables will be declared once when the application starts.
14+
'These variables can be accessed from all modules.
15+
16+
End Sub
17+
18+
Sub Service_Create
19+
'This is the program entry point.
20+
'This is a good place to load resources that are not specific to a single activity.
21+
22+
End Sub
23+
24+
Sub Service_Start (StartingIntent As Intent)
25+
Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases.
26+
End Sub
27+
28+
Sub Service_TaskRemoved
29+
'This event will be raised when the user removes the app from the recent apps list.
30+
End Sub
31+
32+
'Return true to allow the OS default exceptions handler to handle the uncaught exception.
33+
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
34+
Return True
35+
End Sub
36+
37+
Sub Service_Destroy
38+
39+
End Sub

B4J/$APPNAME$.b4j

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
AppType=JavaFX
2+
Build1=Default,b4j.example
3+
File1=MainPage.bjl
4+
FileGroup1=New Group
5+
Group=Default Group
6+
Library1=jcore
7+
Library2=jfx
8+
Library3=b4xpages
9+
Module1=|relative|..\B4XMainPage
10+
NumberOfFiles=1
11+
NumberOfLibraries=3
12+
NumberOfModules=1
13+
Version=10
14+
@EndOfDesignText@
15+
#Region Project Attributes
16+
#MainFormWidth: 600
17+
#MainFormHeight: 600
18+
#End Region
19+
20+
Sub Process_Globals
21+
Private fx As JFX
22+
Private MainForm As Form
23+
End Sub
24+
25+
Sub AppStart (Form1 As Form, Args() As String)
26+
MainForm = Form1
27+
MainForm.Show
28+
Dim PagesManager As B4XPagesManager
29+
PagesManager.Initialize(MainForm)
30+
End Sub
31+
32+
'Template version: B4J-1.0
33+
#Region Delegates
34+
Sub MainForm_FocusChanged (HasFocus As Boolean)
35+
B4XPages.Delegate.MainForm_FocusChanged(HasFocus)
36+
End Sub
37+
38+
Sub MainForm_Resize (Width As Double, Height As Double)
39+
B4XPages.Delegate.MainForm_Resize(Width, Height)
40+
End Sub
41+
42+
Sub MainForm_Closed
43+
B4XPages.Delegate.MainForm_Closed
44+
End Sub
45+
46+
Sub MainForm_CloseRequest (EventData As Event)
47+
B4XPages.Delegate.MainForm_CloseRequest(EventData)
48+
End Sub
49+
50+
Public Sub MainForm_IconifiedChanged (Iconified As Boolean)
51+
B4XPages.Delegate.MainForm_IconifiedChanged(Iconified)
52+
End Sub
53+
#End Region

B4J/Files/MainPage.bjl

1.91 KB
Binary file not shown.

B4XMainPage.bas

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
B4A=true
2+
Group=Default Group
3+
ModulesStructureVersion=1
4+
Type=Class
5+
Version=9.85
6+
@EndOfDesignText@
7+
#Region Shared Files
8+
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
9+
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
10+
#End Region
11+
12+
'GitHub Desktop ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=github&Args=..\..\
13+
'Export as zip: ide://run?File=%B4X%\Zipper.jar&Args=%PROJECT_NAME%.zip
14+
15+
Sub Class_Globals
16+
Private Root As B4XView
17+
Private xui As XUI
18+
End Sub
19+
20+
Public Sub Initialize
21+
' B4XPages.GetManager.LogEvents = True
22+
End Sub
23+
24+
'This event will be called once, before the page becomes visible.
25+
Private Sub B4XPage_Created (Root1 As B4XView)
26+
Root = Root1
27+
Root.LoadLayout("MainPage")
28+
End Sub
29+
30+
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
31+
32+
Private Sub Button1_Click
33+
xui.MsgboxAsync("Hello world!", "B4X")
34+
End Sub

B4i/$APPNAME$.b4i

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Build1=Default,b4i.example
2+
File1=MainPage.bil
3+
FileGroup1=Default Group
4+
Group=Default Group
5+
Library1=icore
6+
Library2=b4xpages
7+
Module1=|relative|..\B4XMainPage
8+
NumberOfFiles=1
9+
NumberOfLibraries=2
10+
NumberOfModules=1
11+
Version=8.51
12+
@EndOfDesignText@
13+
'Code module
14+
#Region Project Attributes
15+
#ApplicationLabel: B4i Example
16+
#Version: 1.0.0
17+
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
18+
#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
19+
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
20+
#Target: iPhone, iPad
21+
#ATSEnabled: True
22+
#MinVersion: 11
23+
#End Region
24+
25+
Sub Process_Globals
26+
Public App As Application
27+
Public NavControl As NavigationController
28+
29+
End Sub
30+
31+
Private Sub Application_Start (Nav As NavigationController)
32+
NavControl = Nav
33+
Dim PagesManager As B4XPagesManager
34+
PagesManager.Initialize(NavControl)
35+
End Sub
36+
37+
'Template version: B4i-1.0
38+
#Region Delegates
39+
Private Sub Application_Background
40+
B4XPages.Delegate.Activity_Pause
41+
End Sub
42+
43+
Private Sub Application_Foreground
44+
B4XPages.Delegate.Activity_Resume
45+
End Sub
46+
#End Region

B4i/Files/mainpage.bil

3.01 KB
Binary file not shown.

0 commit comments

Comments
 (0)