HTML5 backend
First I created the following folders with the following structure :
Projects
|______html5test
|______openfltest
I changed current directory to html5test and on command line, executed
the following command :
haxelib run haxeui-crore create html5
This created the the following folders and files under the html5test :
html5test
|_____assets (folder)
| |
| main-view.xml
|
|_____build (folder)
| |
| html5 (folder)
| |
| index.html
| Main.js
|
|_____src (folder)
| |
| Main.hx
|
|__ .haxeui
|__ html5.hxml
Next, at the command prompt I executed the following commandc:
haxelib run haxeui-crore test html5
I got the following output :
Building for heaxeui-html5 using "haxe html5.hxml"
running : start chrome http://localhost:2000
Process creation failure : start
I expect Chrome to open show the output. But some error has happened. So
what I did was to double-click ‘index.html’ under the build>html5 folder.
This opened Chrome with the desired output i.e. it display a button 'Click me!"
and it worked.
So, I was able to compile and run the default code even though it did not run Chrome
on its own.
My next, step was use the sample code you provided to see the how it works with
the hope that it would work in HTML5 also.
This is what I did :
I copied the following files to ‘src’ folder :
Dialog1.hx
Dialog2.hx
Main.hx
MainView.hx
Then, I copied the following files into the ‘assets’ folder:
dialog1.xml
dialog2.xml
main-view.xml
Again I ran the following command :
haxelib run haxeui-core test html5
src/Main.hx:3: characters 23-32 : Type not found : haxeUIApp
src/MainView.hx :2: characters 24-28 : Type not found : VBox
src/Main.hx:1: lines 1-10: Defined in this class
running : start chrome http://localhost:2000
Process creation failure : start
Now I was stuck. I think I have made some mistake somewhere. I went to
the haxeui-core GitHub repository and found a link “haxeui-guides - Set of
guides to working with HaxeUI and backends.” But I couldn’t find any content
there.
I changed track and decided to try to compile to hxwidgets backend.
I used the haxeui-crore create command to create the hxwidgets project.
Again, I copied the same files as in your example and tried to compile.
But I got a very big error message :
D:\Nirmal\Haxe\projects\hxwidget>haxelib run haxeui-core test hxwidgets
Building for haxeui-hxwidgets using “haxe hxwidgets.hxml”
haxelib run hxcpp Build.xml haxe -DABI="-MD" -DNO_PRECOMPILED_HEADERS=“1” -DPLATFORM_WINDOWS=“1” -DWXSTATIC=“1” -Dhaxe=“4.1.4” -Dhaxe3=“1” -Dhaxe4=“1” -Dhaxe_ver=“4.104” -Dhaxeui-core=“1.1.2” -Dhaxeui-hxwidgets=“1.1.0” -Dhaxeui_core=“1.1.2” -Dhaxeui_hxwidgets=“1.1.0” -Dhscript=“1” -DhxWidgets=“1.6.0” -Dhxcpp=“4.1.15” -Dhxcpp_api_level=“400” -Dhxcpp_smart_strings=“1” -Dsource-header=“Generated by Haxe 4.1.4” -Dstatic=“1” -Dtarget.name=“cpp” -Dtarget.static=“true” -Dtarget.sys=“true” -Dtarget.threaded=“true” -Dtarget.unicode=“true” -Dtarget.utf16=“true” -Dutf16=“1” -I"C:\HaxeToolkit\haxe\lib\hxcpp/4,1,15/" -I"C:\HaxeToolkit\haxe\lib\hxWidgets/1,6,0/src/" -I"C:\HaxeToolkit\haxe\lib\haxeui-hxwidgets/1,1,0/" -I"C:\HaxeToolkit\haxe\lib\hscript/2,4,0/" -I"C:\HaxeToolkit\haxe\lib\haxeui-core/1,1,2/" -I"src/" -I"" -I"C:\HaxeToolkit\haxe\extraLibs/" -I"C:\HaxeToolkit\haxe\std/cpp/_std/" -I"C:\HaxeToolkit\haxe\std/"
Using wxWidgets from: \lib\vc_lib
Compiling group: haxe
cl.exe -Iinclude -I\include -I\lib\vc_lib\mswu -IC:/HaxeToolkit/haxe/lib/hxWidgets/1,6,0/\include -DUNICODE -D_UNICODE -DwxMSVC_VERISON_AUTO -DwxUSE_GRAPHICS_CONTEXT -DWIN32 -D__WXMSW__ -D__WX__=1 -nologo /WX- /fp:precise -DHX_WINDOWS -GR -O2(optim-std) -Zi(debug) -FdD:\Nirmal\Haxe\projects\hxwidget\build\hxwidgets\obj/msvc19xp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -FS -Oy- -c -EHs -GS- -arch:SSE2 -IC:/HaxeToolkit/haxe/lib/hxcpp/4,1,15/include -DHXCPP_VISIT_ALLOCS(haxe) -DHX_SMART_STRINGS(haxe) -DHXCPP_API_LEVEL=400(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -wd4996 … tags=[haxe,static]
- src/haxe/ui/components/_HorizontalScroll/PosFromCoord.cpp
- src/wx/widgets/styles/MessageDialogStyle.cpp
- src/hx/widgets/ImageList.cpp
- src/hx/widgets/SystemOptions.cpp
- src/haxe/ui/components/_DropDown/DataSourceBehaviour.cpp
- src/hx/widgets/BoolProperty.cpp
- src/sys/FileSystem.cpp
- src/hx/widgets/CheckBox.cpp
Error: CheckBox.cpp
./src/hx/widgets/CheckBox.cpp(6): fatal error C1083: Cannot open include file: ‘wx/checkbox.h’: No such file or directory
Error: Build failed
Using name from descriptor “descriptors.HxmlFile”: “Main”
running: build/hxwidgets/Main
Process creation failure : build/hxwidgets/Main
Did I miss something and do something wrong. For compiling hxwidgets example,
is it necessary to install wxWidgets also. I couldn’t find any instruction
in this regard anywhere on haxeu site. Again, I started googling. Finally I
reached the hxWidgets repository in GitHub. Ah! There it is! Here it was
mentioned the pre-requisites for compiling under Windows. I will try this and
report again.
I checked the haxeui.org website at ‘haxeui.org’. Well, it links ‘Components’,
‘Playground’, ‘API’, ‘Forums’ and 'Contribute". I couldn’t find any ‘Getting
Started’ tutorial to help beginners like me.
Though I have good experience in C# and .NET, I feel lost trying to get a hold
of Haxeui. My search further led me to the GitHub repository ‘haxeui-guides’. This appeared
to be work-in-progress to create some documentation. I wish it was completed.
In this repository, I found a topics on ‘Custom Components’, ‘Modules’. I liked it very
much as I have experience in creating custom user components in C#. So, this
was an area I am interested in.
I wish there is sufficient documentation on topics such as :
- Installation of haxeui library - command-line instructions to be used
and details of the parameters, any points to be noted specifically
- Creating to directory structure using the haxeui-core create command -
the details of each sub-folder in the directory and the purpose of the
the directory, what type of files are placed in them. For example,
what is the purpose of ‘assets’ sub-folder, what type of files are stored
therein etc.
- Pre-requisites for compiling for difference backends.
- In which folder should we save the .hx, .hxml and .xml files so that the
compiler could find it.
- Any differences in the code for different types of backends, if so what they
are.
I was also in search of different frameworks/platform for cross-platform coding.
My search also led me to ‘Apache Royale’. It uses ActionScript and XML (for GUI)
and seems to be similar to Haxe language and Haxeui. I found detailed and elaborate
documents for Apache Royale. It hand-holds a new user in developing and compiling
programs. I wish there was similar documents for HaxeUI also. It would help
in greater adoption by users like.
Anyways, I will continue to explore HaxeUI. This post is a lengthy one and
I fear whether I am wasting your valuable time! But if you could provide
some help I hope it would help other like me too! Thanks a lot for answering
all my previous queries!
Regards,
Nirmal