-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a documentation where I can learn more about how to use this library? #27
Comments
It should work, maybe its out of date, ill have a play later (creating a dialog across all haxeui backends is consistent, unless ive recently broken something, which i dont think i have)
You can do this will wxWidgets window styles, it may be nice if haxeui would allow some short cuts for this though, ill have to have a check / play
There seems to be a
You can style windows controls somewhat but not fully, this is a limitation of the OS, these are fully native components and therefore the OS (windows in your case) will drastically limit what you can and cant do (eg: wxWidgets on osx is VERY limited, but again, this is a limitation by the OS, not wxWidgets or even haxeui) - what kind of styles are you looking for?
I guess there is no central place, as you've noticed (and pointed out) documentation is pretty thin and sporadic - i keep saying im going to fix that, but never get round to it as something else always seems to come along as my time is limited :( Hope that helps somewhat, not really any solid answers, but i few things ill check out when i get some free hours Cheers, |
Thanks a lot for the detailed response!
I have managed to get this to work and I must've botched something when initially trying to follow the instruction beforehand.
How can I access the wxWidgets API from haxe in the meantime? Or is this not possible?
Indeed using
I think it would be enough to simply give the users knowledge of the other instance running and then let them handle what to do depending on their use case, (e.g Open a new tab to the existing instance if a new file is opened from the explorer for files associated to the application) And on a somewhat related note, in order to set file associations on Windows, we need to use the registry so is there a way to interface with the Windows Registry aside from relying on hack-y console commands to launch REG.EXE? I know that another approach would be to set the file associations using the software installer but ideally, the end-user should be able to manage it from the application itself. And also related to files, I can't seem to find any way to open the native file and folder picker?
It's one of those things where I couldn't find anything about it in the documentation so I just assumed it was relying on the one haxe uses
I am mainly just interested in making the Windows version up-to-par with design "standards" (if you can call it that) of Windows 10. Since Microsoft can't seem to decide on what their design language is going to be and keeps changing it every few years, Windows 10 is now a hodgepodge of different UI systems going all the way back to Windows 98. What I had in mind is to just roll my own design with custom window decorations, animations, themed controls, etc. that tries to adhere somewhat to the latest one (fluent design) but I only want it applied on the Windows side of things because macOS and Linux don't seem to suffer as much from these design inconsistencies and applications look fine on them by default. Hence why I still want to do this in hxwidgets. Other targets like OpenFL don't seem to have support for custom window decorations anyway and also wouldn't work with a true multi-window setup. For example, I wanted to have the menubar unified with the title bar just like VS Code but without the massive overhead that Electron brings to the table. I think this can be achievable if I can just hide the native window decoration and figure out how to make custom components for hxwidgets.
I would help if I could but I'm relatively new to haxe / haxeui so I should probably wait until I'm more comfortable before contributing stuff. As for the question at hand, I found this post from you last year: https://community.haxeui.org/t/sizing-of-sub-children/174/13 so that takes care of that then but would still be nice to see a post like this for the other targets as well. |
So ive made a few updates:
To answer a few of your other questions:
Sure, each haxeui component in haxeui-hxwidgets has a "window" property, this is the hxWidgets window, which is a wrapper for the wxWidgets extern.
It looks to be fairly simple to know if another wxWidgets app is running via that
I could be wrong, but i think this is going to be pretty hard to achieve in wxWidgets, i havent actually tried though ofc... That fluent design looks pretty interesting, do you know how it works?? I mean, what component lib is it using, what language etc? Sounds like it could be a new haxeui backend! ;) EDIT: you'll need git hxWidgets, haxeui-hxwidgets, haxeui-core |
I just tried it and it works great! Also, I tried to poke around wxWidgets and apparently it is possible to disable the window's decorations via I'm still figuring out how I can use a custom control to handle dragging on the sides of the borderless window but I'm at least glad it's something that can be done. But you are right in that it would be a pain in the ass to basically reinvent the wheel with custom components. And I only have surface level knowledge about fluent design but I do know it is being used in UWP applications so most definitely .NET. I believe there is an ongoing effort (by Microsoft) to expose these same components to Win32 applications as well via WinUI 3 so projects like wxWidgets would be able to use it. |
WinUI 3 looks interesting - never heard of it - downloading it now to have a play. I wonder how / if / when wxWidgets will take advantage of it. UWP could certainly be another backend in haxeui... in fact, i have a prototype somewhere, but stopped playing with it for some reason. Anyways, interesting stuff. Cheers, |
I seem to have hit some more snags, the
Meanwhile the resulting app doesn't show it no matter what kind of text I put in there.
|
Thanks loads for the PRs, i had no idea you could restrict windows on the wx level, figured if you wanted that it would have to be wired up yourself. Also, wrt to your other questions:
Thanks again for the PRs! Cheers, |
I just checked it out and it seems while the |
Do you have a minimal example of both menu issues? I tried using the menu (context and menu bar) and both were fine... I didnt try an icon though, will try that shortly. Yeah, scrollview increment needs to be calculated on wxWidgets - will look at best way to do that Ian EDIT: hmm, yeah, icon doesnt work for some reason, im sure that used to work. |
Ive also changed the scroll step (also latest git)... im not conviced its the right value (10 rather than 1) but it feels a little better, it still might make sense to calculate it based on the height of the component and the scrollable area - ill have to a have a bit of a deeper play with that |
Thank you for all the updates! Here's an example of the issue I'm having with the menu not firing events: test.mp4And here's the project source: |
Ah, ok, you are using the wrong event. Generally you should be listening for a menu selected event, eg: mainMenu.onMenuSelected = function(e:MenuEvent) {
trace("menu bar: " + e.menuItem.text);
} or for context menus: var menu:Menu = ComponentMacros.buildComponent("assets/menu.xml");
menu.onMenuSelected = function(e:MenuEvent) {
trace("context menu: " + e.menuItem.text);
}
Screen.instance.registerEvent(MouseEvent.RIGHT_CLICK, function(e:MouseEvent) {
menu.left = e.screenX;
menu.top = e.screenY;
Screen.instance.addComponent(menu);
menu.show();
}); The click would work on other backends as the click will still dispatch, which isnt the case in wxWidgets (wx wont dispatch a click event in the same manner)... that said, other people have tried the exact same thing and ive had to explain it a number of times, i wonder if it would make sense to dispatch a click from haxeui-hxwidgets when a menu is selected?... ... ... thoughts? EDIT: Btw, that event can ofc also be used with binding: @:bind(mainMenu, MenuEvent.MENU_SELECTED)
function onMainMenu(e:MenuEvent) {
...
} |
I didn't know it needed to be something else because it MouseEvent works with HTML5 export so I thought it was simply hxWidgets having some hiccups. So then what do I use if I want to have a "global" event catcher? For example, anywhere on the app, if I want to catch the user pressing, let's say Alt+K? Or I want to catch if the user right clicks anywhere on the app? I think another thing I'm unclear about is how do I reference an image that is in the same project directory? I tried either relative |
Also how do I get this awesome file tree view https://community.haxeui.org/t/beginnings-of-a-haxe-ide-written-in-haxeui/121/2 |
Ok, so for resources (images for this case), haxeui can use either framework specific resources (ie, resources that are specific to the backend framework), or a universal method using haxe resources (that will be turned into the framework specific resources). For wxWidgets these are one at the same, that is a bunch of haxe.Bytes that will be turned into bitmaps etc. So you have a few methods, the first would be to just package up some haxe resources manually (see A much easier method is to use haxeui modules, this does exactly what the resource flag does (essentially) but it does it recursively and allows for renaming of the generated resource names, a simple example would be:
<module>
<resources>
<resource path="assets/myImages" prefix="myImages" />
</resources>
</module>
As for the treeview, there isnt one in core... specifically for the reason that there is no wxTreeView exposed in hxWidgets yet, and so no native counterpart. Its something i keep putting off and putting off, but maybe i should just add it at this stage. It would certainly be useful... maybe this weekend if i have time / motivation (tm) Cheers, EDIT: fyi haxeui-core should also understand the following protocols: |
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 actually attach a function to an element? I sawApparently it@:bind
being used but according to the haxe docs that's only supported in the Flash/SWF platform?@:bind
does work outside of SWFhaxeui-hxwidgets.properties
file?Sorry if these are a lot!
The text was updated successfully, but these errors were encountered: