Giter VIP home page Giter VIP logo

Comments (26)

aiekick avatar aiekick commented on September 27, 2024 1

in fact Alphanum is not a "one header only" lib (forgotten that ^^). so your proposal is a better choice

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024 1

No nothing specific. I have not tried yet the DemoApp. I will try that and let you know! Thanks.

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024 1

Yes, I tested both on MacOS (my main machine) and on Windows (with a win64 toolchain). I can try on linux if needed (but I'm not sure as you are already doing some tests on linux).

"Happy" to see that you also have an issue ;-).

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024 1

i have the issue in the dialog but not in the tests with the same file list...

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024 1

Just tried the latest version with the fix you released two hours ago. It is working like a charm, many thanks!

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024 1

i have fix it i guess.

if you have some time can you test the last build pls ?

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

hello,

no its easy and i could provide a way for anyone use his own sorting or integrate as a third party the one header library alphanum i have mirrored on github some years ago

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024

Hello,

That would be perfect. Many thanks!

Vincent

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

I have added the feature for sorting of filenames and extensions.
Finally self made and maybe optimizable a bit.
Since its slower than the base sorting, the use is optional.
You can enable it by using the flag ImGuiFileDialogFlags_NaturalSorting

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024

Many thanks for you time and reactivity. I just tried the lastest version on a simple test case. I have three files in a folder: file1.txt, file2.txt and file11.txt.

The standard sort algorithm gives the following order: file1.txt, file11.txt, file2.txt.

The natural sort algorithm that has just been added gives: file11.txt, file1.txt, file2.txt.

My file explorer (Finder) gives: file1.txt, file2.txt, file11.txt.

From what I had in mind and understood, my file explorer gives the correct output as as the number should not be treated digit by digit but as a "whole".

What do you think?

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

i just tried your test files and this is what i obtain via the DemoApp :
image

i have added the testing of this feature and he is ok on macos, so its weird..

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024

Yes, this is weird. Anyway, that means that the issue is on my side! Thank you very much for this implementation.

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

yes maybe but i would like to know what can be the bug.
any particular locales ?
can you tried the DemoApp branch ?

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024

I did compile the DemoApp and here is what I got :
Capture d’écran 2024-07-07 aΜ€ 15 35 37

That is really weird. Just to make sure, we just have to click on the arrow located on the left of File name to sort the content, right?

By the way, to be able to use the DemoApp, I had to change line 67 of the file mainWinLinuxMacOS.cpp from

#if APPLE

to

#if __APPLE__

otherwise I had the following error message when I tried to execute the application:

Glfw Error 65543: NSGL: The targeted version of macOS does not support OpenGL 3.0 or 3.1 but may support 3.2 and above

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

yes just click on the header. even if you dont click the sorting must be ok

thanks for the define

can you enable the tests and run them ?

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024

I compiled the tests and run them. Nothing happened and nothing was printed in the terminal (I tried to execute the test from my IDE - CLion - and from the terminal). Is it the attended behavior when everything is fine?

I found a log file whose content is

Start testing: Jul 07 16:44 CEST
----------------------------------------------------------
End testing: Jul 07 16:44 CEST

I dive a little bit in the code and I think I do not understand how the tests work. In the CMakeLists.txt file of the test folder, there is a line

include_directories("../src")

but there is not src directory... What am I missing?

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

no, when its fine you have a full list fo sucessfull tests

i think you dont have enabled them, you must set the cmake option USE_TEST=ON

you can check the files im using for github actions in .github/workflows/

and take a one for your compiler

ex for gcc :

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_DIRENT_FILESYSTEM=ON
cmake --build build --config Release
ctest --test-dir build --output-on-failure

thanks for your time, i appreciate a lot :)

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024

No, I enabled the test in the main CMakeLists.txt file. I compiled manually (and no longer with my IDE). It worked. You can find the results here. All the tests passed successfully.

This is really strange! What can I do to help you?

PS : you are welcome and thank you for the wonderful library.

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

nothing, in my mind, is the tests was passed successfully, so the natural sorting must be ok.

i have a linux vm i will test. maybe i missed something for the unix behavior( mac or linux)

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024

FYI, I have compiled my code on a windows machine, the DemoApp also and the unit tests. Nothing has changed. This is not working as expected using the DemoApp, but all the tests are OK.

There must be something I do wrong!

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

there is a but related to the ordering on linux. im investigating..

you have compiled on windows but with a win32 toolchain ?
why was you on mac.. not sure understand.

you have tested on win and mac ?

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

no finally i have the same result. i just got an exceptions for a particular comparison.

but the sorting is bad in one sense..

in ascending i got test1, test2, test11
but in descending i got test11, test1, test2 but could be test11, test2, test1

will fix that

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024

It seems to be vicious issue. How can I help you?

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

nice for you but i always have an issue around :(

from imguifiledialog.

lesauxvi avatar lesauxvi commented on September 27, 2024

I just compiled the latest build, and more specifically the DemoApp. Everything runs smoothy and works as expected. All the unit tests passed successfully.

I think we can conclude that everything is ok and we can close definitely this issue.

Many thanks for your time and efficiency.

from imguifiledialog.

aiekick avatar aiekick commented on September 27, 2024

yep cool.

many thanks for your time too. πŸ‘

from imguifiledialog.

Related Issues (20)

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.