├── .gitignore ├── README.md ├── _template ├── .haxeui ├── .vscode │ ├── launch.json │ └── tasks.json ├── application.xml ├── assets │ └── empty.txt ├── build │ └── html5 │ │ └── index.html ├── flixel-hl.hxml ├── flixel-html5.hxml ├── flixel-windows.hxml ├── heaps-hl.hxml ├── heaps-js.hxml ├── html5.hxml ├── hxwidgets.hxml ├── khafile.js ├── nme-windows.hxml ├── openfl-hl.hxml ├── openfl-html5.hxml ├── openfl-windows.hxml ├── pdcurses.hxml ├── project.nmml ├── project.xml ├── raylib.hxml └── src │ ├── Main.hx │ ├── MainView.hx │ ├── haxeui-flixel.properties │ ├── haxeui-heaps.properties │ ├── haxeui-hxwidgets.properties │ └── haxeui-pdcurses.properties └── buttons ├── basic-buttons ├── .haxeui ├── .vscode │ ├── launch.json │ └── tasks.json ├── application.xml ├── flixel-hl.hxml ├── flixel-html5.hxml ├── flixel-windows.hxml ├── heaps-hl.hxml ├── heaps-js.hxml ├── html5.hxml ├── hxwidgets.hxml ├── khafile.js ├── nme-windows.hxml ├── openfl-hl.hxml ├── openfl-html5.hxml ├── openfl-windows.hxml ├── pdcurses.hxml ├── project.nmml ├── project.xml ├── raylib.hxml └── src │ ├── Main.hx │ ├── MainView.hx │ ├── haxeui-flixel.properties │ ├── haxeui-heaps.properties │ ├── haxeui-hxwidgets.properties │ └── haxeui-pdcurses.properties └── colorful-buttons ├── .gitignore ├── .haxeui ├── README.md ├── html.png ├── html5.hxml ├── hxwidgets.hxml ├── src ├── Main.hx └── haxeui-hxwidgets.properties └── wxwidgets.png /.gitignore: -------------------------------------------------------------------------------- 1 | Kha/ 2 | build/ 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # component-examples 2 | 3 | This project contains example code using many of the UI components supported by HaxeUI. 4 | Each directory contains a standalone Haxe project that you can build and run locally 5 | using the included build hxml files for a variety of targets. 6 | 7 | ## A Note About Kha 8 | 9 | In order to run these examples with Kha simply use the following: `node path/to/Kha/make --compile --run`. 10 | 11 | ## Additional Resources 12 | 13 | For more examples, see [the HaxeUI Component Explorer](http://haxeui.org/explorer/). 14 | 15 | ## License 16 | 17 | This software is distributed under the terms of the Apache 2.0 license. See the included 18 | LICENSE.txt file for details. 19 | -------------------------------------------------------------------------------- /_template/.haxeui: -------------------------------------------------------------------------------- 1 | # generated file simply to hold info about projects created with "haxeui create ..." 2 | name=Main 3 | -------------------------------------------------------------------------------- /_template/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Kha: HTML5", 5 | "request": "launch", 6 | "type": "chrome", 7 | "cwd": "${workspaceFolder}/build/debug-html5", 8 | "runtimeExecutable": "${command:kha.findKhaElectron}", 9 | "runtimeArgs": [ 10 | "--no-sandbox", 11 | "--force-device-scale-factor=1", 12 | "." 13 | ], 14 | "outFiles": [ 15 | "${workspaceFolder}/build/debug-html5/*.js" 16 | ], 17 | "preLaunchTask": "Kha: Build for Debug HTML5", 18 | "internalConsoleOptions": "openOnSessionStart", 19 | "skipFiles": [ 20 | "/**" 21 | ] 22 | }, 23 | { 24 | "type": "krom", 25 | "request": "launch", 26 | "name": "Kha: Krom", 27 | "preLaunchTask": "Kha: Build for Krom", 28 | "internalConsoleOptions": "openOnSessionStart" 29 | } 30 | ], 31 | "compounds": [] 32 | } -------------------------------------------------------------------------------- /_template/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "haxe", 6 | "args": "active configuration", 7 | "group": { 8 | "kind": "build", 9 | "isDefault": true 10 | }, 11 | "problemMatcher": [], 12 | "label": "haxe: active configuration" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /_template/application.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /_template/assets/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haxeui/component-examples/4a7fb073a7948ae9f731d42689903e4dc40aadd2/_template/assets/empty.txt -------------------------------------------------------------------------------- /_template/build/html5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Main 6 | 7 | 8 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /_template/flixel-hl.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-flixel 3 | --cmd lime test project.xml hl -------------------------------------------------------------------------------- /_template/flixel-html5.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-flixel 3 | --cmd lime build project.xml html5 -------------------------------------------------------------------------------- /_template/flixel-windows.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-flixel 3 | --cmd lime test project.xml windows -------------------------------------------------------------------------------- /_template/heaps-hl.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib heaps 5 | -lib hlsdl 6 | -lib haxeui-core 7 | -lib haxeui-heaps 8 | 9 | -D resourcesPath=assets 10 | 11 | -hl build/heaps/hl/Main.hl 12 | -------------------------------------------------------------------------------- /_template/heaps-js.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib heaps 5 | -lib haxeui-core 6 | -lib haxeui-heaps 7 | 8 | -D resourcesPath=assets 9 | 10 | -js build/heaps/js/Main.js 11 | -------------------------------------------------------------------------------- /_template/html5.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib haxeui-core 5 | -lib haxeui-html5 6 | 7 | -js build/html5/Main.js 8 | -------------------------------------------------------------------------------- /_template/hxwidgets.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib haxeui-core 5 | -lib haxeui-hxwidgets 6 | -lib hxWidgets 7 | 8 | -D ABI=-MD 9 | -D WXSTATIC 10 | 11 | -cpp build/hxwidgets 12 | -------------------------------------------------------------------------------- /_template/khafile.js: -------------------------------------------------------------------------------- 1 | let project = new Project('Main'); 2 | 3 | 4 | const haxeui_kha_dir = await new Promise((resolve, reject) => { 5 | require('child_process').execFile('haxelib', ['path', 'haxeui-kha'], {}, (err, data) => { 6 | if (err) reject(err); 7 | else resolve(data.split("\n")[0].trim()); 8 | }); 9 | }); 10 | 11 | console.log("Using haxeui-kha from: " + haxeui_kha_dir); 12 | 13 | //project.addAssets('./assets/**'); 14 | project.addSources('./src'); 15 | 16 | project.addLibrary('haxeui-core'); 17 | await project.addProject(haxeui_kha_dir); 18 | 19 | resolve(project); 20 | -------------------------------------------------------------------------------- /_template/nme-windows.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-nme 3 | --cmd nme test windows -------------------------------------------------------------------------------- /_template/openfl-hl.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-openfl 3 | --cmd lime test application.xml hl -------------------------------------------------------------------------------- /_template/openfl-html5.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-openfl 3 | --cmd lime build application.xml html5 -------------------------------------------------------------------------------- /_template/openfl-windows.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-openfl 3 | --cmd lime test application.xml windows -------------------------------------------------------------------------------- /_template/pdcurses.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib haxeui-core 5 | -lib haxeui-pdcurses 6 | 7 | -cpp build/pdcurses 8 | -------------------------------------------------------------------------------- /_template/project.nmml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /_template/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /_template/raylib.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib haxeui-core 5 | -lib haxeui-raylib 6 | -lib raylib-haxe 7 | 8 | -cpp build/raylib 9 | -------------------------------------------------------------------------------- /_template/src/Main.hx: -------------------------------------------------------------------------------- 1 | package ; 2 | 3 | import haxe.ui.HaxeUIApp; 4 | 5 | class Main { 6 | public static function main() { 7 | var app = new HaxeUIApp(); 8 | app.ready(function() { 9 | app.addComponent(new MainView()); 10 | 11 | app.start(); 12 | }); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /_template/src/MainView.hx: -------------------------------------------------------------------------------- 1 | package ; 2 | 3 | import haxe.ui.containers.VBox; 4 | 5 | @:xml(' 6 | 7 | 8 | ') 9 | class MainView extends VBox { 10 | } -------------------------------------------------------------------------------- /_template/src/haxeui-flixel.properties: -------------------------------------------------------------------------------- 1 | haxe.ui.flixel.background.color=#FFFFFF 2 | haxe.ui.flixel.mouse.useSystemCursor=true 3 | -------------------------------------------------------------------------------- /_template/src/haxeui-heaps.properties: -------------------------------------------------------------------------------- 1 | haxe.ui.heaps.engine.background.color=#ffffff 2 | -------------------------------------------------------------------------------- /_template/src/haxeui-hxwidgets.properties: -------------------------------------------------------------------------------- 1 | haxe.ui.hxwidgets.frame.fit=true 2 | haxe.ui.hxwidgets.frame.title=Main 3 | -------------------------------------------------------------------------------- /_template/src/haxeui-pdcurses.properties: -------------------------------------------------------------------------------- 1 | haxe.ui.pdcurses.title=Main 2 | -------------------------------------------------------------------------------- /buttons/basic-buttons/.haxeui: -------------------------------------------------------------------------------- 1 | # generated file simply to hold info about projects created with "haxeui create ..." 2 | name=Main 3 | -------------------------------------------------------------------------------- /buttons/basic-buttons/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Kha: HTML5", 5 | "request": "launch", 6 | "type": "chrome", 7 | "cwd": "${workspaceFolder}/build/debug-html5", 8 | "runtimeExecutable": "${command:kha.findKhaElectron}", 9 | "runtimeArgs": [ 10 | "--no-sandbox", 11 | "--force-device-scale-factor=1", 12 | "." 13 | ], 14 | "outFiles": [ 15 | "${workspaceFolder}/build/debug-html5/*.js" 16 | ], 17 | "preLaunchTask": "Kha: Build for Debug HTML5", 18 | "internalConsoleOptions": "openOnSessionStart", 19 | "skipFiles": [ 20 | "/**" 21 | ] 22 | }, 23 | { 24 | "type": "krom", 25 | "request": "launch", 26 | "name": "Kha: Krom", 27 | "preLaunchTask": "Kha: Build for Krom", 28 | "internalConsoleOptions": "openOnSessionStart" 29 | } 30 | ], 31 | "compounds": [] 32 | } -------------------------------------------------------------------------------- /buttons/basic-buttons/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "haxe", 6 | "args": "active configuration", 7 | "group": { 8 | "kind": "build", 9 | "isDefault": true 10 | }, 11 | "problemMatcher": [], 12 | "label": "haxe: active configuration" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /buttons/basic-buttons/application.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /buttons/basic-buttons/flixel-hl.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-flixel 3 | --cmd lime test project.xml hl -------------------------------------------------------------------------------- /buttons/basic-buttons/flixel-html5.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-flixel 3 | --cmd lime build project.xml html5 -------------------------------------------------------------------------------- /buttons/basic-buttons/flixel-windows.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-flixel 3 | --cmd lime test project.xml windows -------------------------------------------------------------------------------- /buttons/basic-buttons/heaps-hl.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib heaps 5 | -lib hlsdl 6 | -lib haxeui-core 7 | -lib haxeui-heaps 8 | 9 | -D resourcesPath=assets 10 | 11 | -hl build/heaps/hl/Main.hl 12 | -------------------------------------------------------------------------------- /buttons/basic-buttons/heaps-js.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib heaps 5 | -lib haxeui-core 6 | -lib haxeui-heaps 7 | 8 | -D resourcesPath=assets 9 | 10 | -js build/heaps/js/Main.js 11 | -------------------------------------------------------------------------------- /buttons/basic-buttons/html5.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib haxeui-core 5 | -lib haxeui-html5 6 | 7 | -js build/html5/Main.js 8 | -------------------------------------------------------------------------------- /buttons/basic-buttons/hxwidgets.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib haxeui-core 5 | -lib haxeui-hxwidgets 6 | -lib hxWidgets 7 | 8 | -D ABI=-MD 9 | -D WXSTATIC 10 | 11 | -cpp build/hxwidgets 12 | -------------------------------------------------------------------------------- /buttons/basic-buttons/khafile.js: -------------------------------------------------------------------------------- 1 | let project = new Project('Main'); 2 | 3 | 4 | const haxeui_kha_dir = await new Promise((resolve, reject) => { 5 | require('child_process').execFile('haxelib', ['path', 'haxeui-kha'], {}, (err, data) => { 6 | if (err) reject(err); 7 | else resolve(data.split("\n")[0].trim()); 8 | }); 9 | }); 10 | 11 | console.log("Using haxeui-kha from: " + haxeui_kha_dir); 12 | 13 | //project.addAssets('./assets/**'); 14 | project.addSources('./src'); 15 | 16 | project.addLibrary('haxeui-core'); 17 | await project.addProject(haxeui_kha_dir); 18 | 19 | resolve(project); 20 | -------------------------------------------------------------------------------- /buttons/basic-buttons/nme-windows.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-nme 3 | --cmd nme test windows -------------------------------------------------------------------------------- /buttons/basic-buttons/openfl-hl.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-openfl 3 | --cmd lime test application.xml hl -------------------------------------------------------------------------------- /buttons/basic-buttons/openfl-html5.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-openfl 3 | --cmd lime build application.xml html5 -------------------------------------------------------------------------------- /buttons/basic-buttons/openfl-windows.hxml: -------------------------------------------------------------------------------- 1 | -lib haxeui-core 2 | -lib haxeui-openfl 3 | --cmd lime test application.xml windows -------------------------------------------------------------------------------- /buttons/basic-buttons/pdcurses.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib haxeui-core 5 | -lib haxeui-pdcurses 6 | 7 | -cpp build/pdcurses 8 | -------------------------------------------------------------------------------- /buttons/basic-buttons/project.nmml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /buttons/basic-buttons/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /buttons/basic-buttons/raylib.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -main Main 3 | 4 | -lib haxeui-core 5 | -lib haxeui-raylib 6 | -lib raylib-haxe 7 | 8 | -cpp build/raylib 9 | -------------------------------------------------------------------------------- /buttons/basic-buttons/src/Main.hx: -------------------------------------------------------------------------------- 1 | package ; 2 | 3 | import haxe.ui.HaxeUIApp; 4 | 5 | class Main { 6 | public static function main() { 7 | var app = new HaxeUIApp(); 8 | app.ready(function() { 9 | app.addComponent(new MainView()); 10 | 11 | app.start(); 12 | }); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /buttons/basic-buttons/src/MainView.hx: -------------------------------------------------------------------------------- 1 | package ; 2 | 3 | import haxe.ui.events.MouseEvent; 4 | import haxe.ui.containers.VBox; 5 | 6 | @:xml(' 7 | 8 |