Giter VIP home page Giter VIP logo

gammasoft71 / xtd Goto Github PK

View Code? Open in Web Editor NEW
715.0 29.0 54.0 1.62 GB

Free open-source modern C++17 / C++20 framework to create console, GUI (forms like WinForms) and unit test applications and libraries on Microsoft Windows, Apple macOS and Linux.

Home Page: https://gammasoft71.github.io/xtd

License: MIT License

CMake 1.27% C++ 97.07% Batchfile 0.03% Shell 0.10% Objective-C++ 0.84% C 0.26% CSS 0.44%
c-plus-plus gui-framework gui console unittest desktop portable cross-platform cmake cli toolkit gui-toolkit cplusplus-20 framework xtd cpp cross-platform-desktop cross-platform-gui test-framework raii

xtd's Introduction

xtd

xtd (pronounced "extend") is a modern C++17/20 framework to create console, GUI (forms like WinForms) and unit test applications on Microsoft Windows, Apple macOS, Linux, iOS and android (*).

logo

(*) See portability for more information.

License Language web Reference Guide wiki discord Download xtd

Latest news

Features

xtd libraries architecture

architecture_logo

xtd is composed of several libraries.

xtd.core

core The xtd.core library is modern C++17/20 libraries of classes, interfaces, and value types that provide access to system functionality. It is the foundation on which c++ applications, components, and controls are built.

xtd.drawing

drawing The xtd.drawing library contains types that support basic GDI+ graphics functionality. Child namespaces support advanced two-dimensional and vector graphics functionality, advanced imaging functionality, and print-related and typographical services. A child namespace also contains types that extend design-time user-interface logic and drawing.

xtd.forms

forms The xtd.forms library contains classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and linux base operating system.

xtd.tunit

tunit The xtd.tunit library is a unit-testing framework for modern C++17/20, inspired by Microsoft.VisualStudio.TestTools.Cpp.

Getting Started

  • Installation provides download, install and uninstall documentation.
  • Guides provides xtd guides and tutorials.
  • Examples provides over 750 examples to help you use xtd, grouped by libraries and topics.

Development status

  • Release notes provides release notes information.
  • Roadmap provides a view of the xtd roadmap.
  • Kanban board provides a Kanban view for all tasks (enhancements, pull requests, bugs, questions,...).
  • Development status provides information about classes and libraries development status.
  • Translation status provides information about translations status.

Current release status

GitHub milestone GitHub milestone

This project is an open source project. The developers who participate do so on their own time. It is therefore difficult to fix realese dates.

But you can follow the evolution of the development. We keep the status up to date.

Continuous Integration build status

At each commit, a build and unit tests are performed for the following configurations :

Operating system Debug Release
Windows (x64) Windows (x64) Debug Windows (x64) Release
Windows (x86) Windows (x86) Debug Windows (x86) Release
macOS macOS Debug macOS Release
Ubuntu Ubuntu Debug Ubuntu Release
iOS (**) Coming soon Coming soon
Android (**) Coming soon Coming soon

(**) xtd.core and xtd.tunit only.

Deploy to GitHub Pages status
Deployment of the website Ubuntu Debug
Deployment of the latest reference guide Ubuntu Debug

Issues status

As xtd is managed by a Kanban project, the number of open issues can be quite large. The table below gives a clearer view on the number of open bugs/questions and enhancements.

Issues Open Closed
Bugs / Questions from users GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.1.0 - Enhancements / Developments (*) GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.1.1 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.2.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.3.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.4.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 1.0.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo

(*) There is only one enhancement for xtd 0.1.0, as project management was not yet available.

Examples

The classic first application 'Hello World'.

Console (CLI)

hello_world_console.cpp

#include <xtd/xtd>

using namespace xtd;

auto main()->int {
  console::background_color(console_color::blue);
  console::foreground_color(console_color::white);
  console::write_line("Hello, World!");
}

or simply

#include <xtd/xtd>

using namespace xtd;

auto main()->int {
  console::out << background_color(console_color::blue) << foreground_color(console_color::white) << "Hello, World!" << environment::new_line();
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.20)

project(hello_world_console)
find_package(xtd REQUIRED)
add_sources(hello_world_console.cpp)
target_type(CONSOLE_APPLICATION)

Build and run

Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:

xtdc run

Output

Screenshot

Forms (GUI like WinForms)

hello_world_forms.cpp

#include <xtd/xtd>

using namespace xtd::forms;

class main_form : public form {
public:
  main_form() {
    text("Hello world (message_box)");

    button1.location({10, 10});
    button1.parent(*this);
    button1.text("&Click me");
    button1.click += [] {
      message_box::show("Hello, World!");
    };
  }
  
private:
  button button1;
};

auto main()->int {
  application::run(main_form {});
}

or simply

#include <xtd/xtd>

auto main()->int {
  auto main_form = xtd::forms::form::create("Hello world (message_box)");
  auto button1 = xtd::forms::button::create(main_form, "&Click me", {10, 10});
  button1.click += [] {xtd::forms::message_box::show("Hello, World!");};
  xtd::forms::application::run(main_form);
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.20)

project(hello_world_forms)
find_package(xtd REQUIRED)
add_sources(hello_world_forms.cpp)
target_type(GUI_APPLICATION)

Build and run

Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:

xtdc run

Output

Windows

Screenshot

Screenshot

macOS

Screenshot

Screenshot

Linux Gnome

Screenshot

Screenshot

tunit (Unit tests like Microsoft Unit Testing Framework)

hello_world_test.cpp

#include <xtd/xtd>
#include <string>

using namespace std;
using namespace xtd::tunit;

namespace unit_tests {
  class test_class_(hello_world_test) {
    void test_method_(create_string_from_literal) {
      auto s = string {"Hello, World!"};
      valid::are_equal(13, s.size());
      assert::are_equal("Hello, World!", s);
    }
    
    void test_method_(create_string_from_chars) {
      auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
      valid::are_equal(13, s.size());
      string_assert::starts_with("Hello,", s);
      string_assert::ends_with(" World!", s);
    }
  };
}

auto main()->int {
  return console_unit_test().run();
}

or without helpers

#include <xtd/xtd>
#include <string>

using namespace std;
using namespace xtd::tunit;

namespace unit_tests {
  class hello_world_test;
  
  auto hello_world_test_class_attr = test_class_attribute<hello_world_test> {"unit_tests::hello_world_test"};
  class hello_world_test : public test_class {
    test_method_attribute create_string_from_literal_attr {"create_string_from_literal", *this, &hello_world_test::create_string_from_literal};
    void create_string_from_literal() {
      auto s = string {"Hello, World!"};
      valid::are_equal(13, s.size());
      assert::are_equal("Hello, World!", s);
    }
    
    test_method_attribute create_string_from_chars_attr {"create_string_from_chars", *this, &hello_world_test::create_string_from_chars};
    void create_string_from_chars() {
      auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
      valid::are_equal(13, s.size());
      string_assert::starts_with("Hello,", s);
      string_assert::ends_with(" World!", s);
    }
  };
}

auto main()->int {
  return console_unit_test().run();
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.20)

project(hello_world_test)
find_package(xtd REQUIRED)
add_sources(hello_world_test.cpp)
target_type(TEST_APPLICATION)

Build and run

Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:

xtdc run

Output

Screenshot

Visual Studio Output

Screenshot

Gallery

Minesweeper

minesweeper

minesweeper (on Windows)


Game of Life

game_of_life

game_of_life (on macOS)


xtdc-gui

xtdc-gui

xtdc-gui - Create a new project (on macOS)


Calculator

calculator

calculator (on Ubuntu)


Stopwatch

stopwatch

stopwatch (on Windows)


Painting

painting

painting (on Ubuntu)

Contributing

The authors file lists contributors together with contact information. If you make a contribution, please add yourself to the list.

Your contributions are welcome.

  • First read Code of conduct and the design guidelines to make sure your contribution follows the rules.
  • Fork the project and use a pull request for adding your contribution.
  • If you face any problems feel free to open an issue at the issues tracker, If you feel like there is a missing feature, please raise a ticket on Github. Pull request are also welcome.

Your feedback is important for the evolution of the project.

Beginners

The following project aims to simplify and guide the way beginners make their first contribution. If you are looking to make your first contribution, check out the project below.

First Contributions

Now you are ready to make your first contribution to xtd.

See also


© 2024 Gammasoft.

xtd's People

Contributors

baderouaich avatar bigplayszn avatar deltoro05 avatar emmanuel-ferdman avatar gammasoft71 avatar germanaizek avatar jimorc avatar jopadan avatar niansa avatar qingyiwebt avatar yfiumefreddo 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  avatar  avatar

xtd's Issues

[ENHANCEMENT] xtd.forms - control_renderer

xtd.forms - control_renderer

Library

xtd.forms

Enhancement

control_renderer

Description

Provides xtd::forms::control renderer methods.

  • xtd::forms::control_renderer renderer

[ENHANCEMENT] Set default location of .xtdc-gui to ~/.config/xtdc-gui

Would it be possible to set the default location of the .xtdc-gui config file to $HOME/.config/xtdc-gui? One of the problems I face is that my home directory ends up with a ton of different hidden folders at top-level, and it'd be really nice if xtd didn't fall prey to that issue.

I wanted to ask now, because this is something that would be more difficult to change later on.

[BUG] Problems of installing xtd in Arch linux and distributions that are based on it

The bug
I have a problems with installing this framework in Arch linux and also the distributions that are based on it, i tried to install it on Manjaro and it fails, and now in Arch linux and it fails also.

Expected behaviour
I can use the xtd in Arch linux without any problems

Desktop:

  • OS: Arch linux
  • Version: 1/02/2022
  • kernel : 5.16.4
  • xtd version: latest version

[QUESTION] Why does the hello world example not running ?

i tried to build hello world app from the examples in the examples folder,

#include <xtd/xtd>

using namespace xtd::forms;

class main_form : public form {
public:
  main_form() {
    text("Hello world (message_box)");
    button1.location({10, 10});
    button1.parent(*this);
    button1.text("&Click me");
    button1.click += [] {
      message_box::show("Hello, World!");
    };
  }
  
private:
  button button1;
};

int main() {
  application::run(main_form());
}

this code is from github, but when i run xtdc run i get :

[ 33%] Linking CXX executable gui_app1
/usr/bin/ld: CMakeFiles/gui_app1.dir/properties/startup.cpp.o: in function `main':
startup.cpp:(.text+0x20): multiple definition of `main'; CMakeFiles/gui_app1.dir/src/form1.cpp.o:form1.cpp:(.text+0x0): first defined here
/usr/bin/ld: CMakeFiles/gui_app1.dir/properties/startup.cpp.o: in function `main':
startup.cpp:(.text+0x3c): undefined reference to `gui_app1::form1::main()'
collect2: error: ld returned 1 exit status
make[2]: *** [gui_app1/CMakeFiles/gui_app1.dir/build.make:125: gui_app1/gui_app1] Error 1
make[1]: *** [CMakeFiles/Makefile2:152: gui_app1/CMakeFiles/gui_app1.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
Build error! Run project aborted.

is this a problem with the code or the framework.

[ENHANCEMENT] xtd.forms - collapsible_panel

xtd.forms - collapsible_panel

Library

xtd.forms

Enhancement

collapsible_panel

Description

Used to group collections of controls in a collapsible panel.

  • xtd::forms::collapsible_panel container

[ENHANCEMENT] xtd.core - io::directory

xtd.core - io::directory

Library

xtd.core

Enhancement

io::directory

Description

Exposes static methods for creating, moving, and enumerating through directories and subdirectories.

  • xtd::io::directory class

[BUG] xtd-gui doesn't launch on Linux

Describe the bug
The program crashes with SIGTRAP and:

(xtdc-gui:15502): Gtk-ERROR **: 18:38:12.366: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

To Reproduce
Steps to reproduce the behavior:

  1. Install on linux (opensuse in my case)
  2. Try to launch the gui via terminal (to see the error message)

Expected behaviour
Gui should show up

Desktop (please complete the following information):

  • OS: Linux, OpenSuSE
  • Version: Tumbleweed
  • xtd version: master (4d412ab046f51da2e5baf782f9f2f5bb23c49840)

[ENHANCEMENT] Have you used FetchContent before in CMake? It might help with dependencies!

Hi Gammasoft,

Thank you so much for your work again on this library! It's exciting to have a C++ GUI library made for modern C++.

I've spent the morning installing the library, and I noticed it's installing a number of dependencies manually. This is definitely appropriate for dependencies like wxWidgets, which are rather large, but I that a feature added in CMake 3.14 might be able to help with some of the dependency management!

NB: it was originally added in CMake 3.11, but FetchContent_MakeAvailable, which is extremely useful, was added in CMake 3.14

Please see here for a link to the documentation: https://cmake.org/cmake/help/latest/module/FetchContent.html

Essentially, you can use FetchContent to download and link against a library directly from a git repository! I usually use it by wrapping it in a function called find_or_fetch, which will check to see if a package already exists on the system before downloading anything.

Here is a short example that uses find_or_fetch to look for 3 dependencies. If it finds them on the system, it'll use the system version; otherwise, it'll clone the github repository and build & link against that.

    # Find the benchmark library, or download it in build/_deps
    find_or_fetch(
        benchmark
        https://github.com/google/benchmark.git
        main)
    find_or_fetch(
        fmt
        https://github.com/fmtlib/fmt.git
        master)
    find_or_fetch(
        Catch2
        https://github.com/catchorg/catch2.git
        devel)
    FetchContent_MakeAvailable(${remote_dependencies})

This will:

  • Look for the google benchmark library,
  • Look for libfmt,
  • And look for the Catch2 unit test library.

For each one, if it can't find it on the system, then it'll add it to a list called remote_dependencies. It will also clone each github repo into a _deps folder inside the build directory. Once we have all the dependencies, we call FetchContent_MakeAvailable, which will introduce each library into the scope of the current CMakeLists.txt.

Then, we can target the libraries as usual:

target_link_libraries(<your target> 
    benchmark::benchmark 
    fmt::fmt 
    Catch2::Catch2WithMain)

This is the definition of find_or_fetch that I wrote. It provides an ALWAYS_FETCH option that can be passed to CMake if a user wishes to always fetch these libraries, rather than using the system ones.

set(remote_dependencies "")

# If ALWAYS_FETCH is ON, then find_or_fetch will always fetch any remote
# dependencies rather than using the ones provided by the system. This is
# useful for creating a static executable.
option(
    ALWAYS_FETCH
    "Tells find_or_fetch to always fetch packages"
    OFF)


include(FetchContent)
# find_or_fetch will search for a system installation of ${package} via
# find_package. If it fails to find one, it'll use FetchContent to download and
# build it locally.
function(find_or_fetch package repo tag)
    if (NOT ALWAYS_FETCH)
        find_package(${package} QUIET)
    endif()

    if (ALWAYS_FETCH OR NOT ${${package}_FOUND})
        message("Fetching dependency '${package}' from ${repo}")
        
        FetchContent_Declare(
            "${package}"
            GIT_REPOSITORY "${repo}"
            GIT_TAG "${tag}"
        )
        list(APPEND remote_dependencies "${package}")
        set (remote_dependencies  ${remote_dependencies} PARENT_SCOPE)
    else()
        message("Using system cmake package for dependency '${package}'")
    endif()
endfunction()

I just thought I'd share this because it made my life a lot easier, and I thought it might help you too!

[ENHANCEMENT] xtd.forms - command_link_buttons

xtd.forms - command_link_buttons

Library

xtd.forms

Enhancement

command_link_buttons

Description

Provides a collection of command_link_button objects for use by a Windows Forms application.

  • xtd::forms::command_link_buttons class

[BUG] cannot delete recent projects in xtdc-gui

Describe the bug
When selecting a recent project in xtdc-gui and pressing the DEL key, it does not delete the item from the list.

To Reproduce
Steps to reproduce the behavior:

  1. Launch xtdc-gui
  2. Go to Open recent list and choose a project
  3. Press DEL keyboard key
  4. Nothing will happen

Expected behaviour
Expected the recent project item to be deleted from recent projects list.

Screenshots
pl
I made a new project to test key_down and key_code's value when pressing the DEL key, it looks like it reports the wrong key_code value of F16:
image

Desktop (please complete the following information):

  • OS: Windows x64
  • Version: 10
  • xtd version: 0.2.0

Additional context
When debugging xtdc-gui in Visual Studio, the key_event_args.key_code() value was F16 0x0000007F instead of DEL 0x0000002E (as shown in the screenshots above), which prevent the function delete_from_open_recent_projects from being called.

[ENHANCEMENT] xtd.core - io::binary_writer

xtd.core - io::binary_writer

Library

xtd.core

Enhancement

io::binary_writer

Description

Writes primitive types in binary to a stream and supports writing strings.

  • xtd::io::binary_writer class

[BUG] WriteFile never sets number_of_bytes_written to -1

Describe the bug
WrtieFile in src/xtd.core.native.win32/src/xtd/native/win32/process.cpp line 38, never sets number_of_bytes_written to -1

To Reproduce
No need to reproduced

Expected behavior
If WriteLine succeeds, the return value is nonzero (TRUE).

Screenshots
Not applicable.

Desktop (please complete the following information):

  • OS: Windows
  • Version all
  • v0.1.0-beta

Additional context
No context.

[ENHANCEMENT] xtd.forms - check_box_renderer

xtd.forms - check_box_renderer

Library

xtd::forms

Enhancement

check_box_renderer

Description

Provides xtd::forms::check_box renderer methods.

  • xtd::forms::check_box_renderer renderer

[BUG] xtdc-gui panels redraw over each other

Describe the bug
When selecting xtdc-gui menu items File -> Open xtd examples then File -> Create new project (or vice versa), the panels redraw over each other.

To Reproduce
Steps to reproduce the behavior:

  1. Run xtdc-gui
  2. Click on menu item File -> Open xtd examples then click on File -> Create new project
  3. See redraw issue

Expected behaviour
Panels to be visible/invisible correctly

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10 x64
  • Version: 21H2
  • xtd version: 0.2.0

Workaround
I think its an issue with the panels visibility when a menu item is clicked.
I got this, you can assign this issue to me.

[ENHANCEMENT] xtd.core - date_time

xtd.core - date_time

Library

xtd.core

Enhancement

date_time

Description

Represents an instant in time, typically expressed as a date and time of day.

  • xtd::date_time class
  • xtd::date_time_kind enumeration
  • day_of_week enumeration
  • month_of_year enumeration

[BUG] Unable to start program - Access is denied

Hello there, thank you to whoever contributes to this cool repository, i think it deserves more attention than it already has...
I had a first attempt to try xtd this morning, everything went fine (installing, buiding, setting up project,..) which shows some real pragmatic work being done here which i truly appreciate!
although as im having fun with my first application, i couldn't run it. as bellow it shows the access denied dialog.

xtd err
Here are some info you may find useful to help me solve this issue:

- OS: Windows 10 x64 Version 20H2
- IDE: Microsoft Visual Studio Community 2019 version 16.9.1
- Compiler: MSVC 19.28

if there is anything else i should provide please tell me.
Have a great day!

[ENHANCEMENT] xtd.forms - dot_matrix_display_renderer

xtd.forms - dot_matrix_display_renderer

Library

xtd.forms

Enhancement

dot_matrix_display_renderer

Description

Provides xtd::forms::dot_matrix_display renderer methods.

  • xtd::forms::dot_matrix_display_renderer renderer

[ENHANCEMENT] xtd.core - time_zone_info

xtd.core - time_zone_info

Library

xtd.core

Enhancement

time_zone_info

Description

Represents any time zone in the world.

  • xtd::time_zone_info class
  • xtd::time_zone_exception exception

[ENHANCEMENT] xtd.forms - command_link_button_renderer

xtd.forms - command_link_button_renderer

Library

xtd.forms

Enhancement

command_link_button_renderer

Description

Provides xtd::forms::command_link_button renderer methods.

  • xtd::forms::command_link_button_renderer render

[ENHANCEMENT] File drop feature request

Hello @gammasoft71, thanks again for the work your are doing in this repo, such a steady progress that i appreciate!
i have a feature request which can be useful to the xtd forms users.
its when a user drops a file into a form and an event will be dispatched serving the files paths dropped, may be something like this:

file_drop += [&](control& sender, const file_drop_event_args& e) {
      std::vector<std::filesytem::path> files = e.files();
      ...
    };

i was able to achieve this in an example using GLFW's glfwSetDropCallback function. i hope this helps.
you may already have this feature in your future plans, i just want to let u know anyways 😁.
Thanks again!
Have a good day 🙌.

[ENHANCEMENT] xtd.core - io::directory_info

xtd.core - io::directory_info

Library

xtd.core

Enhancement

io::directory_info

Description

Exposes instance methods for creating, moving, and enumerating through directories and subdirectories.

  • xtd::io::directory_info class

[ENHANCEMENT] xtd.core - uri

xtd.core - uri

Library

xtd.core

Enhancement

uri

Description

Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.

  • xtd::uri class
  • uri_components enumeration
  • uri_format enumeration
  • uri_format_exception exception
  • uri_host_name_type enumeration
  • uri_kind enumeration
  • uri_partial enumeration
  • uri_template_match_exception

[QUESTION] Cmake Error install(error installing..)

hi...i download it from sourceForge and ... but when i start file install(from cmd and with adminstor)i got Error Cmake and other error....
i have git,Vs Studio,Cmake(version 3.23.0-rc3(laset version)) and other reqiued for this.
i really need this lib pls help me in fixing!
ScreenShot:
Capture
list error in TXT file:
Error install.txt

Operation System: Windows 10 Home (ver 2004(AND LASSET UPDATE))
Viusal Studio Ver 2022 Community
Cmake version 3.23.0-rc3(laset version)
Help me!

[QUESTION] How to use CSS?

Hello. This gui library looks awesome and I had a question. Is there a way to use CSS to customize widgets?

[ENHANCEMENT] xtd.core - io::binary_reader

xtd.core - io::binary_reader

Library

xtd.core

Enhancement

io::binary_reader

Description

Reads primitive data types as binary values in a specific encoding.

  • xtd::io::binary_reader class

[BUG] cannot build unit test project created with xtdc-gui

Describe the bug
When using xtdc-gui to create a Unit test project, the project fails to build because of an invalid include in startup.cpp

To Reproduce
Steps to reproduce the behavior:

  1. Run xtdc-gui
  2. Create new unit tests project
  3. Try compile project
  4. You will see error Severity Code Description Project File Line Suppression State Error C1083 Cannot open include file: 'xtd/tunit_main.h': No such file or directory unit_test_project (unit_test_project\unit_test_project) C:\Users\bader\Desktop\unit_test_project\unit_test_project\properties\startup.cpp 6

Expected behaviour
Project to be compiled without errors

Screenshots

Windows 10

4

Ubuntu MATE

linux

Desktop (please complete the following information):

  • OS: Windows x64
  • Version: 10
  • xtd version: 0.1.0

Additional context
Project compiles fine when changing #include <xtd/tunit_main.h> to #include <xtd/tunit/tunit_main.h>

[BUG] xtdc-gui crashes with projects with space in name

Describe the bug
When i create a new project using xtdc-gui with a project name that has a space for example "hello world", it crashes, but it works fine when using no spaces in names like "hello_world"

To Reproduce
Steps to reproduce the behavior:

  1. Launch xtdc-gui
  2. Create new project
  3. Give the project a name with a space in between for example "hello world"
  4. xtdc-gui will crash

Expected behaviour
Expected the project to be created successfully without any problems with names with space in between, or xtdc-gui to show you a warning message dialog to warn you not to use project names with that format.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows x64
  • Version: 10
  • xtd version: 0.2.0

Additional context

Windows generated crash report

Faulting application name: xtdc-gui.exe, version: 1.0.0.0, time stamp: 0x6179b157
Faulting module name: xtdc-gui.exe, version: 1.0.0.0, time stamp: 0x6179b157
Exception code: 0xc0000005
Fault offset: 0x00000000001e2096
Faulting process id: 0x17b4
Faulting application start time: 0x01d7ce5adbcf92c0
Faulting application path: C:\Program Files (x86)\xtd\bin\xtdc-gui.exe
Faulting module path: C:\Program Files (x86)\xtd\bin\xtdc-gui.exe
Report Id: a0e57ee8-826f-4d74-ae97-8f90b48ce40d
Faulting package full name: 
Faulting package-relative application ID: 
Version=1
EventType=APPCRASH
EventTime=132801604303755265
ReportType=2
Consent=1
UploadTime=132801604306802417
ReportStatus=268435456
ReportIdentifier=e48bfb09-767d-4812-9f2e-161b3b59514d
IntegratorReportIdentifier=0d13a137-b987-4f8e-ad16-12502fee0c54
Wow64Host=34404
NsAppName=xtdc-gui.exe
OriginalFilename=xtdc-gui.exe
AppSessionGuid=00003570-0001-007c-503d-e5f05aced701
TargetAppId=W:0006e99646db45e2426f4244b728e1bb2b1d00000000!00003733cdef35d05481656dc06be464496802beeb8e!xtdc-gui.exe
TargetAppVer=2021//10//27:20:06:47!0!xtdc-gui.exe
BootId=4294967295
TargetAsId=1011
UserImpactVector=808452912
IsFatal=1
EtwNonCollectReason=1
Response.BucketId=2ac861693c778dfc96f4b90526697b89
Response.BucketTable=4
Response.LegacyBucketId=1654150394922236809
Response.type=4
Sig[0].Name=Application Name
Sig[0].Value=xtdc-gui.exe
Sig[1].Name=Application Version
Sig[1].Value=1.0.0.0
Sig[2].Name=Application Timestamp
Sig[2].Value=6179b157
Sig[3].Name=Fault Module Name
Sig[3].Value=xtdc-gui.exe
Sig[4].Name=Fault Module Version
Sig[4].Value=1.0.0.0
Sig[5].Name=Fault Module Timestamp
Sig[5].Value=6179b157
Sig[6].Name=Exception Code
Sig[6].Value=c0000005
Sig[7].Name=Exception Offset
Sig[7].Value=00000000001e2096
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=10.0.19043.2.0.0.256.48
DynamicSig[2].Name=Locale ID
DynamicSig[2].Value=1033
DynamicSig[22].Name=Additional Information 1
DynamicSig[22].Value=cb89
DynamicSig[23].Name=Additional Information 2
DynamicSig[23].Value=cb89c4bdd76f148f9800a33f8af54f7f
DynamicSig[24].Name=Additional Information 3
DynamicSig[24].Value=ca59
DynamicSig[25].Name=Additional Information 4
DynamicSig[25].Value=ca59aa6569a13932fbcac25751daf62a
UI[2]=C:\Program Files (x86)\xtd\bin\xtdc-gui.exe
LoadedModule[0]=C:\Program Files (x86)\xtd\bin\xtdc-gui.exe
LoadedModule[1]=C:\Windows\SYSTEM32\ntdll.dll
LoadedModule[2]=C:\Windows\System32\KERNEL32.DLL
LoadedModule[3]=C:\Windows\System32\KERNELBASE.dll
LoadedModule[4]=C:\Windows\System32\SHLWAPI.dll
LoadedModule[5]=C:\Windows\System32\msvcrt.dll
LoadedModule[6]=C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll
LoadedModule[7]=C:\Windows\System32\RPCRT4.dll
LoadedModule[8]=C:\Windows\SYSTEM32\UxTheme.dll
LoadedModule[9]=C:\Windows\SYSTEM32\OLEACC.dll
LoadedModule[10]=C:\Windows\System32\GDI32.dll
LoadedModule[11]=C:\Windows\System32\USER32.dll
LoadedModule[12]=C:\Windows\System32\ucrtbase.dll
LoadedModule[13]=C:\Windows\System32\win32u.dll
LoadedModule[14]=C:\Windows\System32\combase.dll
LoadedModule[15]=C:\Windows\System32\gdi32full.dll
LoadedModule[16]=C:\Windows\System32\SHELL32.dll
LoadedModule[17]=C:\Windows\System32\msvcp_win.dll
LoadedModule[18]=C:\Windows\SYSTEM32\VERSION.dll
LoadedModule[19]=C:\Windows\System32\ole32.dll
LoadedModule[20]=C:\Windows\System32\COMDLG32.dll
LoadedModule[21]=C:\Windows\SYSTEM32\WINSPOOL.DRV
LoadedModule[22]=C:\Windows\System32\shcore.dll
LoadedModule[23]=C:\Windows\System32\ADVAPI32.dll
LoadedModule[24]=C:\Windows\System32\sechost.dll
LoadedModule[25]=C:\Windows\SYSTEM32\MSIMG32.dll
LoadedModule[26]=C:\Windows\SYSTEM32\VCRUNTIME140D.dll
LoadedModule[27]=C:\Windows\SYSTEM32\MSVCP140D.dll
LoadedModule[28]=C:\Windows\SYSTEM32\VCRUNTIME140_1D.dll
LoadedModule[29]=C:\Windows\SYSTEM32\ucrtbased.dll
LoadedModule[30]=C:\Windows\System32\IMM32.DLL
LoadedModule[31]=C:\Windows\SYSTEM32\kernel.appcore.dll
LoadedModule[32]=C:\Windows\System32\bcryptPrimitives.dll
LoadedModule[33]=C:\Windows\SYSTEM32\CRYPTBASE.DLL
LoadedModule[34]=C:\Windows\System32\MSCTF.dll
LoadedModule[35]=C:\Windows\System32\OLEAUT32.dll
LoadedModule[36]=C:\Windows\WinSxS\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.19041.1288_none_91a663c8cc864906\gdiplus.dll
LoadedModule[37]=C:\Windows\SYSTEM32\TextShaping.dll
LoadedModule[38]=C:\Windows\SYSTEM32\textinputframework.dll
LoadedModule[39]=C:\Windows\System32\CoreMessaging.dll
LoadedModule[40]=C:\Windows\System32\CoreUIComponents.dll
LoadedModule[41]=C:\Windows\System32\WS2_32.dll
LoadedModule[42]=C:\Windows\SYSTEM32\ntmarta.dll
LoadedModule[43]=C:\Windows\SYSTEM32\wintypes.dll
LoadedModule[44]=C:\Windows\SYSTEM32\DUser.dll
LoadedModule[45]=C:\Windows\SYSTEM32\atlthunk.dll
State[0].Key=Transport.DoneStage1
State[0].Value=1
OsInfo[0].Key=vermaj
OsInfo[0].Value=10
OsInfo[1].Key=vermin
OsInfo[1].Value=0
OsInfo[2].Key=verbld
OsInfo[2].Value=19043
OsInfo[3].Key=ubr
OsInfo[3].Value=1288
OsInfo[4].Key=versp
OsInfo[4].Value=0
OsInfo[5].Key=arch
OsInfo[5].Value=9
OsInfo[6].Key=lcid
OsInfo[6].Value=1033
OsInfo[7].Key=geoid
OsInfo[7].Value=244
OsInfo[8].Key=sku
OsInfo[8].Value=48
OsInfo[9].Key=domain
OsInfo[9].Value=0
OsInfo[10].Key=prodsuite
OsInfo[10].Value=256
OsInfo[11].Key=ntprodtype
OsInfo[11].Value=1
OsInfo[12].Key=platid
OsInfo[12].Value=10
OsInfo[13].Key=sr
OsInfo[13].Value=0
OsInfo[14].Key=tmsi
OsInfo[14].Value=221333281
OsInfo[15].Key=osinsty
OsInfo[15].Value=2
OsInfo[16].Key=iever
OsInfo[16].Value=11.789.19041.0-11.0.1000
OsInfo[17].Key=portos
OsInfo[17].Value=0
OsInfo[18].Key=ram
OsInfo[18].Value=8082
OsInfo[19].Key=svolsz
OsInfo[19].Value=118
OsInfo[20].Key=wimbt
OsInfo[20].Value=0
OsInfo[21].Key=blddt
OsInfo[21].Value=191206
OsInfo[22].Key=bldtm
OsInfo[22].Value=1406
OsInfo[23].Key=bldbrch
OsInfo[23].Value=vb_release
OsInfo[24].Key=bldchk
OsInfo[24].Value=0
OsInfo[25].Key=wpvermaj
OsInfo[25].Value=0
OsInfo[26].Key=wpvermin
OsInfo[26].Value=0
OsInfo[27].Key=wpbuildmaj
OsInfo[27].Value=0
OsInfo[28].Key=wpbuildmin
OsInfo[28].Value=0
OsInfo[29].Key=osver
OsInfo[29].Value=10.0.19041.1288.amd64fre.vb_release.191206-1406
OsInfo[30].Key=buildflightid
OsInfo[31].Key=edition
OsInfo[31].Value=Professional
OsInfo[32].Key=ring
OsInfo[32].Value=Retail
OsInfo[33].Key=expid
OsInfo[34].Key=fconid
OsInfo[35].Key=containerid
OsInfo[36].Key=containertype
OsInfo[37].Key=edu
OsInfo[37].Value=0
FriendlyEventName=Stopped working
ConsentKey=APPCRASH
AppName=xtdc-gui.exe
AppPath=C:\Program Files (x86)\xtd\bin\xtdc-gui.exe
NsPartner=windows
NsGroup=windows8
ApplicationIdentity=C2F338FB50363581B8BD2537AB432134
MetadataHash=389531664

[ENHANCEMENT] xtd.core - io::file_info

xtd.core - io::file_info

Library

xtd.core

Enhancement

io::file_info

Description

Provides static methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of std::fstream objects.

  • xtd::io::file_info class

[ENHANCEMENT] td.forms - box_renderer

xtd.forms - box_renderer

Library

xtd.forms

Enhancement

box_renderer

## Description

Provides xtd::forms::box renderer methods.

  • xtd::forms::box_renderer renderer

[BUG] operator + and operator - does not build with xtd::delegate

Describe the bug
operator + and operator - does not build with xtd::delegate

To Reproduce
using del = xtd::delegate<void(const xtd::ustring& message)>;

void method_with_callback(int param1, int param2, del callback) {
callback("The number is: " + to_string(param1 + param2));
}

class method_class {
public:
void method1(const xtd::ustring& message) { }
void method2(const xtd::ustring& message) { }
};

int main() {
del handler = del(delegate_method);

method_class obj;
del d1 = {obj, &method_class::method1};
del d2 = {obj, &method_class::method2};
del d3 = {delegate_method};

del all_methods_delegate = d1 + d2; // build error
}

Expected behaviour
Not build error

Desktop (please complete the following information):

  • On all platforms]

Workaround
using += operator

[ENHANCEMENT] xtd.forms - collapsible_panel_renderer

xtd.forms - collapsible_panel_renderer

Library

xtd.forms

Enhancement

collapsible_panel_renderer

Description

Provides xtd::forms::collapsible_panel renderer methods.

  • xtd::forms::collapsible_panel_rendererer renderer

[ENHANCEMENT] xtd.core - io::file_system_info

xtd.core - io::file_system_info

Library

xtd.core

Enhancement

io::file_system_info

Description

Provides the base class for both xtd::io::file_info and xtd::io::directory_info objects.

  • xtd::io::file_system_info class

[BUG] install.cmd removed items from my windows path

Describe the bug
Some entries were removed from user path variable. I managed to figure out what they were by printing $Env:Path in the open powershell window were I ran ./install.cmd from.

One of the folders that was removed is C:\Users\maart\AppData\Local\Microsoft\WindowsApps; (I noticed the bug when trying to run winget, which is in this folder).

To Reproduce
I am not going to reproduce this bug, but proof that install.cmd caused this is that $Env:Path in the powershell window were I ran
./install.cmd still contained the entries that went missing afterwards (I restored them manually, hope that's ok).

Expected behaviour
The user path variable isn't destructively altered (perhaps if the path variable would become too long, cancel install.cmd..?, but I don't think that is the case as several entries were removed from the path variable and the # characters removed far exceeded that of the added string C:\Program Files (x86)\xtd\bin.

Desktop (please complete the following information):

  • OS: windows 10
  • Version: 19044.1466
  • xtd version: 0.1.0-beta

[ENHANCEMENT] xtd.forms - find_box

xtd.forms - find_box

Library

xtd.forms

Enhancement

find_box

Description

Represents a common dialog box that displays find dialog.

  • xtd::forms::find_box dialog

[ENHANCEMENT] xtd.forms - color_picker_rendererer

std.forms - color_picker_rendererer

Library

xtd.forms

Enhancement

color_picker_rendererer

Description

Provides xtd::forms::color_picker renderer methods.

  • xtd::forms::color_picker_renderer renderer

[BUG] Error when building src/xtd/forms/loading_indicator.cpp: reference to `'link'` is abmiguous

Describe the bug
When running the install script, it encounters a compiler error when building src/xtd/forms/loading_indicator.cpp. The error states that a reference to link is ambiguous, with the two candidates being class xtd::forms::link, and extern int link in unistd.h.

I've attached the full output below.

To Reproduce

  • I cloned xtd master.
  • I installed gtk3 and gtk3mm for my system
  • I went into the xtd directory, and ran ./install

It downloaded and build wxwidgets and the other dependencies without issues, however there was an error 82% of the way through the build process when building src/xtd/forms/loading_indicator.cpp

Screenshots

Click to see screenshots

image
image

Desktop (please complete the following information):

  • OS: Manjaro Linux (a distribution of arch)

    NB: I made sure to install gtk3 and gtk3mm before building xtd. I made sure they worked, and I was able to compile and run a gtk3 GUI program to test the installation.

    I have CMake 3.21 installed on the system.

  • Version: Linux version 5.10.68-1-MANJARO (builduser@fv-az72-509) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed Sep 22 12:29:47 UTC 2021

  • xtd version. 0.1.0, xtd on master branch, commit 12a62a6

Additional context

Click to see CMake Environment Info
-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0") 
-- Checking for module 'gtk+-3.0'
--   Found gtk+-3.0, version 3.24.30
-- Found wxWidgets: -L/usr/local/lib;-pthread;/usr/local/lib/libwx_gtk3u_xrc-3.1.a;/usr/local/lib/libwx_gtk3u_core-3.1.a;/usr/local/lib/libwx_baseu-3.1.a;gtk-3;gdk-3;z;pangocairo-1.0;pango-1.0;harfbuzz;atk-1.0;cairo-gobject;cairo;gdk_pixbuf-2.0;gio-2.0;gobject-2.0;glib-2.0;libSM.so;libICE.so;libX11.so;libXext.so;libXtst.so;-lwx_baseu-3.1;libjpeg.so;libpng.so;libz.so;libtiff.so;libSDL2main.a;libSDL2.so;gtk-3;gdk-3;z;pangocairo-1.0;pango-1.0;harfbuzz;atk-1.0;cairo-gobject;cairo;gdk_pixbuf-2.0;gio-2.0;gobject-2.0;glib-2.0;libSM.so;libICE.so;libX11.so;libXext.so;libXtst.so;libz.so;-lwxregexu-3.1;secret-1;gio-2.0;gobject-2.0;glib-2.0;libc.so;-lpthread;dl (found version "3.1.5") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alecto/.local/sources/xtd/build/Release
Click to see Compiler Error
[ 82%] Building CXX object src/xtd.forms/CMakeFiles/xtd.forms.dir/src/xtd/forms/loading_indicator.cpp.o
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:17:1: error: reference to ‘link’ is ambiguous
   17 | link& link::description(const xtd::ustring& value) {
      | ^~~~
In file included from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:27:11: note: candidates are: ‘class xtd::forms::link’
   27 |     class link : public object {
      |           ^~~~
In file included from /usr/include/c++/11.1.0/bits/atomic_wait.h:44,
                 from /usr/include/c++/11.1.0/bits/atomic_base.h:41,
                 from /usr/include/c++/11.1.0/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/11.1.0/memory:78,
                 from /home/alecto/.local/sources/xtd/src/xtd.core/include/xtd/object.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/usr/include/unistd.h:801:12: note:                 ‘int link(const char*, const char*)’
  801 | extern int link (const char *__from, const char *__to)
      |            ^~~~
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:26:1: error: reference to ‘link’ is ambiguous
   26 | link& link::enabled(bool value) {
      | ^~~~
In file included from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:27:11: note: candidates are: ‘class xtd::forms::link’
   27 |     class link : public object {
      |           ^~~~
In file included from /usr/include/c++/11.1.0/bits/atomic_wait.h:44,
                 from /usr/include/c++/11.1.0/bits/atomic_base.h:41,
                 from /usr/include/c++/11.1.0/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/11.1.0/memory:78,
                 from /home/alecto/.local/sources/xtd/src/xtd.core/include/xtd/object.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/usr/include/unistd.h:801:12: note:                 ‘int link(const char*, const char*)’
  801 | extern int link (const char *__from, const char *__to)
      |            ^~~~
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:35:1: error: reference to ‘link’ is ambiguous
   35 | link& length(size_t value);
      | ^~~~
In file included from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:27:11: note: candidates are: ‘class xtd::forms::link’
   27 |     class link : public object {
      |           ^~~~
In file included from /usr/include/c++/11.1.0/bits/atomic_wait.h:44,
                 from /usr/include/c++/11.1.0/bits/atomic_base.h:41,
                 from /usr/include/c++/11.1.0/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/11.1.0/memory:78,
                 from /home/alecto/.local/sources/xtd/src/xtd.core/include/xtd/object.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/usr/include/unistd.h:801:12: note:                 ‘int link(const char*, const char*)’
  801 | extern int link (const char *__from, const char *__to)
      |            ^~~~
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:41:1: error: reference to ‘link’ is ambiguous
   41 | link& link::link_data(std::any value) {
      | ^~~~
In file included from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:27:11: note: candidates are: ‘class xtd::forms::link’
   27 |     class link : public object {
      |           ^~~~
In file included from /usr/include/c++/11.1.0/bits/atomic_wait.h:44,
                 from /usr/include/c++/11.1.0/bits/atomic_base.h:41,
                 from /usr/include/c++/11.1.0/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/11.1.0/memory:78,
                 from /home/alecto/.local/sources/xtd/src/xtd.core/include/xtd/object.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/usr/include/unistd.h:801:12: note:                 ‘int link(const char*, const char*)’
  801 | extern int link (const char *__from, const char *__to)
      |            ^~~~
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:50:1: error: reference to ‘link’ is ambiguous
   50 | link& link::name(const xtd::ustring& value) {
      | ^~~~
In file included from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:27:11: note: candidates are: ‘class xtd::forms::link’
   27 |     class link : public object {
      |           ^~~~
In file included from /usr/include/c++/11.1.0/bits/atomic_wait.h:44,
                 from /usr/include/c++/11.1.0/bits/atomic_base.h:41,
                 from /usr/include/c++/11.1.0/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/11.1.0/memory:78,
                 from /home/alecto/.local/sources/xtd/src/xtd.core/include/xtd/object.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/usr/include/unistd.h:801:12: note:                 ‘int link(const char*, const char*)’
  801 | extern int link (const char *__from, const char *__to)
      |            ^~~~
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:59:1: error: reference to ‘link’ is ambiguous
   59 | link& link::start(size_t value) {
      | ^~~~
In file included from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:27:11: note: candidates are: ‘class xtd::forms::link’
   27 |     class link : public object {
      |           ^~~~
In file included from /usr/include/c++/11.1.0/bits/atomic_wait.h:44,
                 from /usr/include/c++/11.1.0/bits/atomic_base.h:41,
                 from /usr/include/c++/11.1.0/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/11.1.0/memory:78,
                 from /home/alecto/.local/sources/xtd/src/xtd.core/include/xtd/object.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/../../../include/xtd/forms/link.h:7,
                 from /home/alecto/.local/sources/xtd/src/xtd.forms/src/xtd/forms/link.cpp:1:
/usr/include/unistd.h:801:12: note:                 ‘int link(const char*, const char*)’
  801 | extern int link (const char *__from, const char *__to)
      |            ^~~~

[BUG] When resizing xtdc-gui, the graphics get messed up

Describe the bug
When resizing xtdc-gui, the graphics get messed up.

To Reproduce
Steps to reproduce the behavior:

  1. Resize form to minimum
  2. Resize form to the original size
  3. Do the operation several times
  4. Controls are misaligned

Expected behaviour
The controls must be aligned correctly.

Screenshots
image

Desktop (please complete the following information):

  • OS: all OS
  • Version: any
  • xtd version: development version

Additional context
The error comes from wxWidgets, depending on the frequency of calls to GetClientSize and SetClientSize applying the difference between the previous size and the new size, it makes more and more errors when updating the sizes:

  • the width becomes bigger and bigger
  • the height becomes smaller and smaller

POC :

class MainFrame : public wxFrame {
public:
  MainFrame() : wxFrame {nullptr, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize} {
    SetClientSize(300, 300);
    panelLeft->SetBackgroundColour({255, 0, 0});
    Show();
    parent_size_ = panel->GetClientSize();
    SetTitle(wxString::Format("diff = {%d, %d}", panel->GetSize().GetWidth() - panelLeft->GetSize().GetWidth(), panel->GetSize().GetHeight() - panelLeft->GetSize().GetHeight()));

    panel->Bind(wxEVT_SIZE, [&](wxSizeEvent& e) {
      auto diff = panel->GetClientSize() - parent_size_;
      panelLeft->SetSize(panelLeft->GetSize() + diff);
      parent_size_ = panel->GetSize();
      SetTitle(wxString::Format("diff = {%d, %d}", panel->GetSize().GetWidth() - panelLeft->GetSize().GetWidth(), panel->GetSize().GetHeight() - panelLeft->GetSize().GetHeight()));
    });
  }
  
private:
  wxSize parent_size_ ;
  wxPanel* panel = new wxPanel(this, wxID_ANY);
  wxPanel* panelLeft = new wxPanel(panel, wxID_ANY, {50, 50}, {150, 150});
};

Workaround
No workaround

[ENHANCEMENT] xtd.forms - button_renderer

xtd.forms - button_renderer

Library

xtd.forms

Enhancement

button_renderer

Description

Provides xtd::forms::button renderer methods.

  • xtd::forms::button_rendererer class

[ENHANCEMENT] xtd - iOS platforms

xtd - iOS platforms

Library

xtd

Enhancement

iOS platforms

Description

  • Creates iOS CMake toolchain
  • Replace references to std::filesystem libraries by xtd::io classes in some classes (not supported by iOS)

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.