Giter Site home page Giter Site logo

ui's People

Contributors

kosenko 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ui's Issues

Is this project still alive?

I haven't got a responce about CMake support issue after 2 months.

Wondering if the author is still active or any of the watchers. I have some plans about significant extension of the library as written in this reddit thread but if no one is here I will just fork it and go with additions under a different library name.

events handled incorrectly

Hey there,
I just discovered an issue with events. Consider the following code:

class Product {
private:
    ui::window parent;
    ui::label name;
    ui::string_box price;
    ui::choice unit;
public:
    Product(ui::window& iparent, const std::string& name) : parent{iparent}, name{ui::label(iparent, name)} {
	price = ui::string_box(parent, "Price");
	
	price.on_edit([&](){
	   price.text(std::regex_replace(price.text().string(), std::regex("[^\\d\.]"), ""));
	   priceStatus.text("");
	});
	unit = ui::choice(parent, {"g", "kg"});
	unit.select(0);
    }
    ui::layout::item layout() {
	return (ui::hbox() << name << price << unit).layout().center();
    }
    float getPrice() {
	float outPrice = std::stof(price.text().string());
	if (unit.current_selection_index() == 0) {
	   outPrice *= 1000;
	}
	return outPrice;
    }
};

If I now create instances of this class, and type in any text box it turns out that only the last created instance gets this regex applied.
I don't think this is an issue on my side, but please tell me, if it is!
Thanks!

Allow to control dialog button(s) and menu

I don't see any example even if I see some dialog with buttons (minimize, maximize, close etc..) and menu.

The question can you disable them (buttons), change the window to be resizable etc...? I checked the source code but I see nothing related to that.

For example making an app, my main window, ideally would be resizable, with a min / max and close button... but dialog (popup) would be mostly without the min/max buttons and fixed...

Also can you put menu on a dialog/window?

I want to start a new application (multi-os) and try to pickup a good lib. I tried JUCE but
the way certain thing are handled are pretty bad (menu for example). I prefer to look
for something more generic and fast to develop.

Do you plan to add some kind of table/grid controls, or can this be added using the current version of the lib?

Thank you!

Input event for text box base

Hey there,
I noticed that it would be really useful, if the text_box_base actually had an input event using e.g. a uistring not only for consistency's sake, but also because it would be really useful. It would just allow to write code much easier with less problems like the following:

ui::string_box text(parent, "text");
text.on_edit([&](){somevar = std::stof(text.text().string());});

Which throws: libs/ui/src/text_box.cpp(102): assert ""impl"" failed in text(): Widget should be created (I have no clue what this means, maybe I'm just doing something stupid)
I would be pretty pleased if you added this!
Thanks!

Input box enhancement

Hey there,
I was wondering if you could add two features:

  1. Support for placeholder text in text boxes
  2. Buttons to modify a number in a text box like the time input box, but without the time

I would find these very useful!
Thanks!

ui::window not working properly

Hey there,
I want to create a window with a frame and I wanted to achieve this with ui::window, but whenever I try to create it, nomatter how I do it, I always end up with /src/gtk/window.cpp(2787): assert ""parent"" failed in PreCreation(): Must have non-NULL parent or libs/ui/src/window.cpp(54): assert ""impl"" failed in title(): Widget should be created when using title().
Here is an example:

class Window : public ui::window {
public:
    Window() : ui::window() {
	ui::vbox layout(*this);
    }
}

Why is it not working?
Thanks!

Integrating Boost::UI into the system

Hey there,
since I have now finally managed to build this project, I went right onwards to create a package and try this out.
I am facing a problem though: How can I build my project? Jamfiles are overly complicated and I would just like to use g++ to compile the project. I did stumble upon this but trying that didn't yield any proper results. It would just fail to find the library.

My packaging process was the following:

  1. Compile boost and -ui
  2. Grab the .a and .so file and put them into /usr/lib, also creating a symlink without the extension
  3. Put the include stuff into /usr/include

You might wonder, why I am not just installing all of this stuff via boost directly - I already have it installed and would just like to only extend that, and this without leaving stray files in my filesystem that I would have to clean up manually.

Do you know, what I did wrong?
Thanks!

FileDialog

Could you please provide some example using FileDialog? I couldn find the implementation in your code.

allegro 5 support?

is it possible to use allegro 5 with this?

the things I am wondering to do are..

  • pass allegro bitmaps instead of boost.ui images
  • pass allegro colors instead of boost.ui colors
  • host allegro windows in a control

OpenGL support

It would be very nice, if you support OpenGL canvas widget.

A number of comments:
Keep up the good work!
I like native widgets.
Better find 2-3 co-programmers. One man show has small probability to lead to success story.

cross platform MDI support

can boost do crossplatform mdi?
basically mdi allows the user to add a normal window into a container inside a window.

its a outdated layout but its still good for things like game editors.

if it doesn't can this be added?

CMake support

wxWidgets supports CMake and the CMake itself has a built-in FindBoost.cmake script. Since this library is not a part of official Boost, it would be very convenient if one could just find_package(...) to easily build and install the library + automatically propagate dependencies.

About library reference in Linux

Hi,

I try to run the project in Linux

After executing the following commands
./b2 libs/ui/build/ cxxflags=-std=c++0x
./b2 libs/ui/test/ cxxflags=-std=c++0x
./b2 libs/ui/example/ cxxflags=-std=c++0x
./b2 libs/ui/example/cpp11/ cxxflags=-std=c++0x

I can successfully run the built UI example above

However, if I want to run my project in another folder(Either in VS code or other IDE), I even get failed at the code line
#include <boost/ui.hpp> (With the undefined reference errors)

What should I do next?

Are the library built from above ./b2 libs/ui/build/ cxxflags=-std=c++0x along with the headers inside ui/include sufficient to build my own project with #include<boost/ui.hpp> as reference?

For example, after building the official boost library with the syntax ./b2 install, list of related compiled library such as libboost_xxx.a, libboost_xxx.so and liboost_xxx.1.84.so.0 can be obtained in /usr/local/lib. Along with the header files, I can successfully use these libraries with my projects by taking the correct reference path. Did I miss something for boost UI as the example here https://kosenko.github.io/boost.ui/?

Any advice is appreciated.

How to center text in label?

I want to create a label that fills the width of the window, but with the text centered. Currently, I have this:

#include <boost/ui.hpp>

namespace ui = boost::ui;

int ui_main()
{
	ui::dialog dlg("Title");
	ui::label label(dlg, "h");
	ui::vbox layout(dlg);
	layout << label.layout().justify();
	label.text("hello");
	dlg.show_modal();
	return 0;
}

int main(int argc, char* argv[])
{
	return ui::entry(&ui_main, argc, argv);
}

Using label.layout().justify() fills the space, but causes the text to be left-aligned. Using label.layout().center() centers the element, but causes text to be cutoff when it is changed.

I managed to get it to work with static_cast<wxStaticText*>(label.native_handle())->SetWindowStyleFlag(wxALIGN_CENTRE_HORIZONTAL), but I also came across this issue where I had to set the text to an empty string first, so it would be nice to be able to set this in the constructor.

label.font() causes crash

This program causes a crash on macOS High Sierra:

#include <boost/ui.hpp>

namespace ui = boost::ui;

int ui_main()
{
	ui::label label;
	label.font();
	return 0;
}

int main(int argc, char* argv[])
{
	return ui::entry(&ui_main, argc, argv);
}

Error:

libs/ui/src/widget.cpp(304): assert "impl" failed in font().

Call stack:
[00] ui_main()                               
[01] boost_ui_app::OnRunHere(int&)           	application.cpp:0
[02] (anonymous namespace)::safe_call(boost::function<void ()> const&, char const*) 	application.cpp:15
[03] boost_ui_app::OnRun()                   	function_template.hpp:87
[04] wxEntry(int&, wchar_t**)                
[05] boost::ui::entry(int (*)(), int, char**) 	application.cpp:31
[06] main                                    
[07] start                                   
[08] 0x00000001

Failed updating 1 target

Hey there,
I gave compiling this another attempt and I actually got further, this time I got the following error:

...updating 40 targets...
gcc.link.dll bin.v2/libs/ui/build/gcc-12/debug/threading-multi/visibility-hidden/libboost_ui.so.1.79.0
/usr/bin/ld: cannot find -lwx_gtk2u_webview-3.0: No such file or directory
collect2: error: ld returned 1 exit status

I have installed wxwidgets-gtk3 after noticing this error, but nothing has changed.
Why is this?
Thanks!

build boost.ui project using visual studio 2019

Severity Code Description Project File Line Suppression State
Error LNK1104 cannot open file 'libboost_ui-vc142-mt-gd-x32-1_70.lib' UIDemo C:\Users\Muhammed\source\repos\UIDemo\UIDemo\LINK 1

I got this error while I am trying to build a simple project for the first time using Boost.UI

when I looked at $(BOOST_ROOT)\stage\lib : I didnot find " libboost_ui-vc142-mt-gd-x32-1_70.lib " although I did the build steps on the build Boost.UI github repos
build boost.ui

@kosenko 👍 :

Linux package

Hey there,
I just stumbled about this and it might be the first actually not bloated (QMap, QWidget, all that annoying stuff) and most usable gui library that I have ever found, but I'm facing a problem: Building just fails since gcc fails to find the required wxwidgets libraries even though I followed all the building steps.
Please create a Linux package using e.g. actions to allow easier installation and assist with compilation issues. The process is quite involved and doesn't seem easy to fix in case it fails.
I would really welcome this.
Thanks!

Build error "address-model [...] unknown in module address-model-feature"

Hello,

I am following the instructions here and get the following error on step 4 for windows.

c:\Users\me\dev\boost_1_77_0>b2 libs/ui/test/ link=static
C:/Users/me/dev/boost_1_77_0/tools/build/src/tools/features\address-model-feature.jam:22: in load
ERROR: rule "[[bbv2.builtin.features.address-model]]address-model::" unknown in module "address-model-feature".
C:\Users\me\dev\boost_1_77_0\tools\build\src/kernel\modules.jam:295: in import
C:/Users/me/dev/boost_1_77_0/tools/build/src/tools/features_init_features_.jam:22: in load
C:\Users\me\dev\boost_1_77_0\tools\build\src/kernel\modules.jam:295: in import
C:/Users/me/dev/boost_1_77_0/tools/build/src/tools\builtin.jam:16: in load
C:\Users\me\dev\boost_1_77_0\tools\build\src/kernel\modules.jam:295: in import
C:/Users/me/dev/boost_1_77_0/tools/build/src\build-system.jam:12: in load
C:\Users\me\dev\boost_1_77_0\tools\build\src/kernel\modules.jam:295: in import
C:\Users\me\dev\boost_1_77_0\tools\build\src/kernel/bootstrap.jam:139: in boost-build
C:\Users\me\dev\boost_1_77_0\boost-build.jam:17: in module scope

Any ideas what this error means? Specifying "address-model=64" doesn't do anything.

My environment looks like this:
Visual Studio 2019
boost 1.77.0
wxWidgets 3.1.5.7

theming support

Is is possible to add any themes (being able not to look like very classic OS application) or make changes to eg background color?

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.