Giter Club home page Giter Club logo

haxeui-hxwidgets's People

Contributors

aw4kening avatar elnabo avatar ianharrigan avatar ibilon avatar intoxopox avatar klabz avatar shallowmallow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

haxeui-hxwidgets's Issues

How to setup a menu bar on MacOS?

I'd like to have a menu bar like the one below, for example.

screenshot

But I've this:

screenshot

How can I edit the menu bar to add more menus and menu items?

Excepted compilation

Hi. I tried to compile simple application with one button, but compilation was finished with exception:

Error: ./src/hx/widgets/HardBreakWrapper.cpp:6:37: fatal error: custom/hardbreakwrapper.h: No such file or directory
compilation terminated.

Here is one of tested samples

I'm on Linux Mint 18.2 x64
Haxe 3.4.4
Hxcpp 3.4.188
haxeui-core, hxWidgets and haxeui-hxwidgets from git
And list of my installed wxWidgets packages:
screenshot at 2017-11-18 11-37-10

Thanks.

Something wrong with element's position and sizing into VBox

Hi, I have some troubles with positioning and sizing of elements into VBox.

For example:

<vbox width="100%" height="100%">
	<hscroll pos="25" width="100" height="25" />
	<hprogress pos="75" width="100" height="25" />
	<hslider pos="50" width="100" height="25" />
</vbox>

result:
1

if try use default value of height the result will not be correctly, too:

<vbox width="100%" height="100%">
	<hscroll pos="25" width="100" />
	<hprogress pos="75" width="100" />
	<hslider pos="50" width="100" />
</vbox>

result:
2

sample.zip

(all of these samples are correctly works with haxeui-html5, haxeui-kha and haxeui-openfl)
Thanks.

How to load Image from file?

Hi. When I have exception, when I trying to load Image from file.

UI.xml

<?xml version="1.0" encoding="utf-8"?>
<image resource="Tux.jpg" />

Result directory:
resdir

Exception:

$ ./Main
15:05:40: Debug: wxColour::Set - couldn't set to colour string 'MEDIUM GREY'
Screen.hx:314: WARNING: Screen event "KeyDown" not supported
Screen.hx:314: WARNING: Screen event "KeyDown" not supported
Error : Could not load bitmap from null bytes

Image.zip

Linux Mint 18.1 x64
Haxe 3.4.0
CPP target
haxeui-core from git
haxeui-hxwidgets from git

Thanks.

A little defect with styling

Hi, I noticed a small defect: the size of component can't be changed if width and height is setted into syle field.

For example, this will be shown correctly:

<textfield
   id="display"
   width="100"
   height="100"
   style="font-size:22;text-align:right"
   text="0" />

But will not be displayed with these samples of markup (I think because it size will be 0width 0height by default):

<textfield
   id="display"
   width="100"
   style="height:100;font-size:22;text-align:right"
   text="0" />

or

<textfield
   id="display"
   height="100"
   style="width:100;font-size:22;text-align:right"
   text="0" />

or

<textfield
   id="display"
   style="width:100;height:100;font-size:22;text-align:right"
   text="0" />

(all of these samples are correctly works with haxeui-html5, haxeui-kha and haxeui-openfl)
Thanks.

Template ?

Thanks a lot for HaxeUI!

I'm wondering if you have made a template for native (wxWidget) yet?
I want to convert a Qt C++ app I made to HaxeUI but I can't find the most basic example using the hxWidgets backend.

Simply adding the dependencies to my project results in the following error...

Type not found : haxe.ui.backend.ComponentImpl

Edit: Using Haxe 4 on MacOS

Tutorial on Linux Compilation

I would like to run the hxWdgets template project. But that is for flash develop on windows. How to do the same on linux (command-line version).

Is there a documentation where I can learn more about how to use this library?

The website is unfortunately not very informative and most entries in the API section don't have any descriptions (A simple search feature for the API would probably be a huge boon). Also the guides linked in here are all empty Markdown files for some reason.

https://github.com/haxeui/haxeui-guides

I was specifically looking for:

  • How to create another window, the Custom Modal Dialog sample in the Components section of the site don't seem to work for hxwidgets
  • How to prevent the application window from being resized by the user and also disable the maximize button
  • How to disable a menu item and button, or really any element for that matter
  • How to prevent multiple instances of the application executable from running at the same time
  • How to actually attach a function to an element? I saw @:bind being used but according to the haxe docs that's only supported in the Flash/SWF platform? Apparently it @:bind does work outside of SWF
  • Is it possible to create a custom "skin" for hxwidgets with my own design of window decoration and button styles?
  • Where can I find all the available options to put inside haxeui-hxwidgets.properties file?

Sorry if these are a lot!

Hardcoded styles for TextArea/TextField

Most of the styles of wxTextCtrl can only bet set on creation (especially on windows).

This means that TextField is always single line with text wrapping and TextArea always multiline without text wrapping.

There should be a possibility to set which style are preferred when creating a TextArea/TextField.

Removing tabview on Linux makes app crash

Current Behavior

It crashes

#1  0x000055555643c42b in wxBookCtrlBase::DeletePage(unsigned long) ()
#2  0x00005555563ff967 in wxNotebook::DeleteAllPages() ()
#3  0x00005555563ffee8 in wxNotebook::~wxNotebook() ()

Possible Solution

I have no idea. But a workaround is to hide the tabview instead.

Test app / minimal test case

import haxe.ui.containers.VBox;
import haxe.ui.events.MouseEvent;


@:xml('
<vbox width="100%" height="100%">
<button id="button" text="remove tab"/>
<tabview id="tab" width="100%" height="100%">
<vbox id="text_editor_tab" text ="TEXT_PREVIEW" width="100%" height="100%">
</vbox>
</tabview>
</vbox>')
class A003 extends VBox {

    @:bind(button, MouseEvent.CLICK)
    private function removeTab(e) {
        removeComponent(tab);
    }

}

Clicking on the button makes the app crash.

Your Environment

MxLinux 22
wxwidgets 3.2.1

Runtime Error: native.xml classes (Haxe 3.4)

Hi.

The new Haxe 3.4 version doesn't compile the classes in the native.xml file. The haxe.ui.backend.hxwidgets.size.* and haxe.ui.backend.hxwidgets.behaviours.*. With 3.2.1 it works fine.

Stacktrace:

Called from hxcpp::__hxcpp_main
Called from Main::main Main.hx line 13
Called from haxe.ui.HaxeUIApp::ready haxe/ui/HaxeUIApp.hx line 16
Called from haxe.ui.HaxeUIApp::init haxe/ui/HaxeUIApp.hx line 25
Called from haxe.ui.backend.AppBase::init haxe/ui/backend/AppBase.hx line 69
Called from Main::main Main.hx line 149
Called from haxe.ui.components.Button::new haxe/ui/components/Button.hx line 21
Called from haxe.ui.core.InteractiveComponent::new haxe/ui/core/InteractiveComponent.hx line 11
Called from haxe.ui.core.Component::new haxe/ui/core/Component.hx line 59
Called from haxe.ui.core.Component::addClass haxe/ui/core/Component.hx line 705
Called from haxe.ui.core.Component::invalidateStyle haxe/ui/core/Component.hx line 1609
Called from haxe.ui.components.Button::applyStyle haxe/ui/components/Button.hx line 80
Called from haxe.ui.core.Component::applyStyle haxe/ui/core/Component.hx line 1633
Called from haxe.ui.core.Component::set_native haxe/ui/core/Component.hx line 220
Called from haxe.ui.components.Button::create haxe/ui/components/Button.hx line 39
Called from haxe.ui.core.Component::create haxe/ui/core/Component.hx line 83
Called from haxe.ui.core.Component::createLayout haxe/ui/core/Component.hx line 115
Error : Null Object Reference

TableView virtual throws an invalid cast

I am playing around with the hxWidgets target and wanted to try out the TableView in virtual mode, but without success.

The component creation throws an exception: invalid cast.

my xml

<vbox style="padding: 5px;" width="100%" height="100%">
	<tableview width="100%" height="200" virtual="true">
		<header width="100%">
			<column id="colA" text="Column A" />
			<column id="colB" text="Column B" width="200" />
			<column id="colC" text="Column C" width="100%" />
		</header>

		<data>
			<item colA="Item 1A" colB="Item 1B" colC="Item 1C" /> 
		</data>
	</tableview>

</vbox>

and I use it like that:

class Main {
    public static function main() {
        Toolkit.init();
        var app = new HaxeUIApp();
        app.ready(function() {
            var main = ComponentMacros.buildComponent("assets/main-view.xml"); // throws here with invalid cast
            app.addComponent(main);
            app.start();
        });
    }
}

as soon as I remove the virtual, it works.

Cheers, Adrian.

Compilation error on Ubuntu 16.04 - invalid suffix "L_obj" on integer constant

Error: While running :g++ -I/home/jonas/haxe/haxeui-test/bin/obj/linux64/pch/haxe -Iinclude -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK -pthread -DwxUSE_WEBVIEW_WEBKIT -c -fvisibility=hidden -O2 -fpic -fPIC -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=330 -m64 -DHXCPP_M64 -I/home/jonas/hxcpp/include -x c++ -frtti -Wno-invalid-offsetof ./src/boot.cpp -o/home/jonas/haxe/haxeui-test/bin/obj/linux64/aea44ed0___boot__.o
In file included from /home/jonas/hxcpp/include/hxcpp.h:310:0:
include/hx/widgets/AnyButton.h:12:30: error: invalid suffix "L_obj" on integer constant
HX_DECLARE_CLASS2(hx,widgets,AnyButton)
^
/home/jonas/hxcpp/include/hx/Macros.h:16:8: note: in definition of macro ‘HX_DECLARE_CLASS0’
class klass##_obj;
^
/home/jonas/hxcpp/include/hx/Macros.h:19:58: note: in expansion of macro ‘HX_DECLARE_CLASS1’
#define HX_DECLARE_CLASS2(ns2,ns1,klass) namespace ns2 { HX_DECLARE_CLASS1(ns1,klass) }

OSX compilation error tr1/type_traits

Hello all,

I'm considering compiling a test project with this nice library, but under OSX.
I'm using a compiled version of wxWidgets, using the latest git version.

Haxe 3.4.2
hxcpp: [3.4.188]
hxWidgets: [1.0.0]
haxeui-core: [0.0.3]
haxeui-hxwidgets: [0.0.2]

 - src/wx/widgets/styles/TextCtrlStyle.cpp
Error: In file included from ./src/wx/widgets/styles/WindowStyle.cpp:5:
In file included from include/wx/widgets/styles/WindowStyle.h:11:
In file included from /usr/local/include/wx-3.1/wx/window.h:18:
In file included from /usr/local/include/wx-3.1/wx/event.h:16:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
/usr/local/include/wx-3.1/wx/strvararg.h:27:18: fatal error: 'tr1/type_traits' file not found
        #include <tr1/type_traits>
                 ^~~~~~~~~~~~~~~~~
1 error generated.
Error: Build failed
Le processus du terminal s'est achevé avec le code de sortie 1

I saw some people here with compiled project under OSX, so I'm pretty sure it is doable, but for some reasons I can't figure it out how to fix that compilation error (checked the web before, but didn't manage to apply the fix correctly if valid)

Thanks

No controls visible - Windows

So i've set up hxWidgets and that works fine. I also have HaxeUI set up correctly and the openfl backend works like it should. But when i try to create a haxeui project for haxeui-hxwidgets.. i get an empty window.. and if the frame.fit() function is run, the window collapses down to a tiny tiny box....

What could be wrong, since the controls are not being added? Neither building from xml or adding manually seem to work...

Hxcpp 3.4.49 , Haxe 3.4

Compilation error on Ubuntu 16.04 - GLCanvas.cpp conversion from int to non-scalar

Error: While running :g++ -I/home/jonas/haxe/haxeui-test/bin/obj/linux64/pch/haxe -Iinclude -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK -pthread -DwxUSE_WEBVIEW_WEBKIT -c -fvisibility=hidden -O2 -fpic -fPIC -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=330 -m64 -DHXCPP_M64 -I/home/jonas/hxcpp/include -x c++ -frtti -Wno-invalid-offsetof ./src/hx/widgets/GLCanvas.cpp -o/home/jonas/haxe/haxeui-test/bin/obj/linux64/edf3cd3c_GLCanvas.o
./src/hx/widgets/GLCanvas.cpp: In member function ‘void hx::widgets::GLCanvas_obj::__construct(hx::widgets::Window, Array, hx::Null, hx::Null)’:
./src/hx/widgets/GLCanvas.cpp:47:66: error: conversion from ‘int’ to non-scalar type ‘cpp::Pointer’ requested
HXLINE( 14) HX_VARI( ::cpp::Pointer< Int >,attribList) = (int)0;
^
Error: Build failed

We ♥ Unicode, don't we?

Testcase in testcase.zip, see Main.hx and main-view.xml.

The project was generated using '''haxelib run haxeui-core create hxwidgets''' from scratch.

screenshot

platform Windows 10
haxe version = 4.2.1+bf9ff69

  • haxeui-core: [1.2.3]
  • haxeui-hxwidgets: [1.2.3]
  • hxcpp: [4.2.1]
  • hxWidgets: [1.7.2]

Default size for Slider

Hi. Is it possible to evaluate default size of vslider and hslider?

For example this markup will not wirks correctly:
<hslider pos="50" width="100"/>
1

needed to set value height manually:
<hslider pos="50" width="100" height="25" />
2

Same defect actually for vslider and property width.

(all of these samples are correctly works with haxeui-html5, haxeui-kha and haxeui-openfl)
Thanks.

Mouse Event doesn't work.

The mouse down event doesn't seem to work.

Expected Behavior

It is required with InteractiveComponents, in special TextField and TextArea with placeholderText property.

Current Behavior

It doesn't dispatch the mouse event down.

Possible Solution

It could be a problem with hxWidgets. If it isn't possible to fix in hxWidgets, haxeui-hxwidgets should do it possible.

Test app / minimal test case

An example code is here haxeui/haxeui-core#69

Steps to Reproduce (for bugs)

Press in a textfield/textarea with default text. It should dissapear.

app does not start through padding

Expected Behavior

The application should start

Current Behavior

The application not start at all without errors.

Possible Solution

Steps to Reproduce (for bugs)

Create a xml with padding! (without padding it works)

package ;

import haxe.ui.containers.VBox;

@:build(haxe.ui.ComponentBuilder.build("assets/main-view.xml"))
class MainView extends VBox {
    public function new() {
        super();
    }
}
<vbox style="padding: 5px;" width="100%">
     <tabview width="240" height="100">
        <box text="Page1">
            <button text="Page 1" />
        </box>
        <box text="Page2">
            <button text="Page 2" />
        </box>
        <box text="Page3">
            <button text="Page 3" />
        </box>
    </tabview>
</vbox>

Test app / minimal test case

test.zip

Your Environment

  • Version used: git f0134b7
  • Operating System and version (desktop or mobile): Windows 10 desktop

can't change text in TextField

Hi. I can't change text in TextField.

UI.xml:

<?xml version="1.0" encoding="utf-8" ?>
<textfield width="100" text="hello world..."/>

Result:
test

TextField.zip

Linux Mint 18.1 x64
Haxe 3.4.0
CPP target
haxeui-core from git
haxeui-hxwidgets from git

Thanks.

Tableview crashes on Linux

Current Behavior

If you have a table in your app, you will have a popup
ASSERT INFO:
../src/gtk/window.cpp(2479): assert "m_wxwindow" failed in AddChildGTK(): Cannot add a child to a window without a client area

BACKTRACE:
[1] wxWindow::AddChildGTK(wxWindow*)
[2] wxStaticText::Create(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&)
[3] __libc_start_main
[4] _start

Ugly fix

Add
if ("" + id == "button-label") return;
at the beginning

private function createWindow(parent:Object = null) {

Reasons

The problem is the "button-label" of the columns.
Somehow the static text cannot be added to hx widget buttons because they are a "window without a client area".

Possible solutions

  • Find a way to distinguish " a window" from " a window without a client area". ( wasn't able to, thought about the client size but it was useless
  • Don't create windows for pure haxeeui components ?
    ( In fact the header is never used as a normal component, so if we can escape the createWindow for columns)
  • remove the problematic components as they are useless before the creation ?

Increasing label font size without specifying a width causes the text to clip

Expected Behavior

The label should increase in size to fit the text inside it instead of clipping the text. This is the behavior observed in other backends I've tried (html5, heaps-hl); it only seems to clip while using the hxwidgets backend.

Current Behavior

The label doesn't scale to fit the text it contains if you change the font size via CSS. The label retains its dimensions as if the default font size were used, thus clipping the text if the font size is bigger than default. This only seems to occur if the width of the label isn't specified.

Steps to Reproduce (for bugs)

  1. Create a default project with the hxwidgets backend (haxelib run haxeui-core create hxwidgets)
  2. Add a label with a larger font size than default and no specified width to assets/main-view.xml (e.g. <label text="this text will clip" style="font-size:30px" />)
  3. Compile and run the application; the text should be clipped.

Media

Using the heaps-hl backend (no clipping):
image

Same code using the hxwidgets backend (clipping):
image

Code that produced these screenshots below.

Test app / minimal test case

Default hxwidgets app with the following modifications:

assets/main-view.xml:

<hbox width="100%" height="100%">
  <style>
    .label {
      font-size: 25px;
    }
    .label.clipped {
      background-color: red;
      color: white;
    }
    .label.not-clipped {
      background-color: green;
      color: white;
      width: 100%;
    }
  </style>
  <label text="clipped" styleName="clipped" />
  <label text="not clipped" styleName="not-clipped"/>
</hbox>

src/MainView.hx:

package;

import haxe.ui.containers.HBox;

@:build(haxe.ui.ComponentBuilder.build("assets/main-view.xml"))
class MainView extends HBox {
  public function new() {
    super();
  }
}

Your Environment

  • Version used:
    $ haxe --version
    4.2.5
    
    $ wx-config --version
    3.2.2
    
    $ gtk4-launch --version
    4.10.4
    
    $ haxelib list
    format: [3.6.0]
    haxeui-core: [1.6.0]
    haxeui-heaps: [1.6.0]
    haxeui-html5: [1.6.0]
    haxeui-hxwidgets: [1.6.0]
    heaps: [1.10.0]
    hlopenal: [1.5.0]
    hlsdl: [1.13.0]
    hxcpp: [4.3.2]
    hxWidgets: [1.11.0]
    
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
    Replicated in:
    • XMonad 0.17.2 with no DE
    • KDE Plasma 5
  • Operating System and version (desktop or mobile): NixOS 23.11 (desktop)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.