Skip to content

Commit 0d82c6c

Browse files
committed
small changes: changed cimspinner to imspinner, etc
1 parent 647bf12 commit 0d82c6c

File tree

20 files changed

+209
-195
lines changed

20 files changed

+209
-195
lines changed

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,10 @@ implot3d:
7676
@cp -f $(EXT_LIB_DIR)/c$@/$@/{LICENSE,*.cpp,*.h,README.md} $(TARGET_DIR)/c$@/$@/
7777

7878
imspinner:
79-
@echo [ cimspinner ] copying...
80-
@-mkdir -p $(TARGET_DIR)/c$@/$@
81-
@cp -f $(EXT_LIB_DIR)/c$@/{*.cpp,*.h,README.md} $(TARGET_DIR)/c$@/
82-
@cp -f $(EXT_LIB_DIR)/c$@/libs/$@/{LICENSE.txt,*.h,README.md} $(TARGET_DIR)/c$@/$@/
83-
@echo "" > $(TARGET_DIR)/c$@/cimspinner_config.h
79+
@echo [ $@ ] copying...
80+
@-mkdir -p $(TARGET_DIR)/$@
81+
@cp -f $(EXT_LIB_DIR)/$@/{LICENSE.txt,*.cpp,*.h,README.md} $(TARGET_DIR)/$@/
82+
@echo "" > $(TARGET_DIR)/$@/cimspinner_config.h
8483

8584
imCTE:
8685
@echo [ cimCTE ] copying...
@@ -97,8 +96,9 @@ libs:
9796

9897
.PHONY: cimgui cimplot cimnodes cimguizmo cimguifiledialog cimgui_toggle cimCTE
9998

100-
clonelibs: cimgui cimplot cimnodes cimguizmo cimgui_toggle cimplot3d cimspinner cimCTE
99+
clonelibs: cimgui cimplot cimnodes cimguizmo cimgui_toggle cimplot3d imspinner_git cimCTE
101100

101+
GIT_LIBS = ../../../../../libs
102102
cimgui:
103103
git clone --recurse-submodules https://github.com/$@/$@ ../libs/$@
104104
cimplot:
@@ -113,8 +113,8 @@ cimgui_toggle:
113113
git clone --recurse-submodules https://github.com/dinau/$@ ../libs/$@
114114
cimplot3d:
115115
git clone --recurse-submodules https://github.com/cimgui/$@ ../libs/$@
116-
cimspinner:
117-
git clone --recurse-submodules https://github.com/dinau/$@ ../libs/$@
116+
imspinner_git:
117+
git clone --recurse-submodules https://github.com/dalerank/imspinner $(GIT_LIBS)/imspinner
118118
cimCTE:
119119
git clone --recurse-submodules https://github.com/cimgui/$@ ../libs/$@
120120

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
![alt](https://github.com/dinau/imguin/actions/workflows/windows.yml/badge.svg) ![alt](https://github.com/dinau/imguin/actions/workflows/linux.yml/badge.svg)
2020

21-
Updated to latest [Dear ImGui](https://github.com/ocornut/imgui) / [CImGui](https://github.com/cimgui/cimgui) version: : **v1.92.0 dock** (2025/07)
21+
Updated to latest [Dear ImGui](https://github.com/ocornut/imgui) / [CImGui](https://github.com/cimgui/cimgui) version: : **v1.92.0 dock** (2025/08)
2222

2323
This project is Dear ImGui wrapper library for Nim language [^notice].
2424

@@ -77,7 +77,7 @@ Library name / C lang. wrapper
7777
- [x] [ImPlot3d](https://github.com/brenocq/implot3d) / [CImPlot3d](https://github.com/cimgui/cimplot3d)
7878
- [x] [ImSpinner](https://github.com/dalerank/imspinner) / [CImSpinner](https://github.com/dinau/CImSpinner)
7979
- [x] [ImGuiColorTextEdit](https://github.com/santaclose/ImGuiColorTextEdit) / [cimCTE](https://github.com/cimgui/cimCTE) (2025/03)
80-
- [ ] [ImGui_Markdown](https://github.com/enkisoftware/imgui_markdown) WIP
80+
- [ ] [ImGui_Markdown](https://github.com/enkisoftware/imgui_markdown) (2025/09) WIP
8181

8282
#### Frontends and Backends
8383

@@ -176,6 +176,7 @@ Windows OS is all OK.
176176

177177
| ImGui/CImGui Ver. | ImGuin Ver. | Date | Linux Debian Family (3) |
178178
| :--------------: | --------- | :----: | :---: |
179+
| 1.92.0 dock | 1.92.0.2 | 2025/08 | OK |
179180
| 1.92.0 dock | 1.92.0.1 | 2025/07 | OK |
180181
| 1.91.9b dock | 1.91.9.4 | 2025/06 | OK |
181182
| 1.91.8dock | 1.91.8.2 | 2025/03 | OK |

imguin.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Package
22

3-
version = "1.92.0.1"
3+
version = "1.92.0.2"
44
author = "dinau"
55
description = "Imguin: ImGui / ImPlot / ImNodes wrapper using Futhark"
66
license = "MIT"

src/imguin/cimgui.nim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ const CImGuiFileDialogPath = joinPath(currentSourceDir(),"private/CImGuiFileDial
2929
const CImGuiTogglePath = joinPath(currentSourceDir(),"private/cimgui_toggle").replace("\\", "/")
3030
const ImGuiTogglePath = joinPath(currentSourceDir(),"private/cimgui_toggle/libs/imgui_toggle").replace("\\", "/")
3131
#
32-
const CImSpinnerPath = joinPath(currentSourceDir(),"private/cimspinner").replace("\\", "/")
33-
const ImSpinnerPath = joinPath(currentSourceDir(),"private/cimspinner/imspinner").replace("\\", "/")
32+
const CImSpinnerPath = joinPath(currentSourceDir(),"private/imspinner").replace("\\", "/")
3433
#
3534
const CImCTEPath = joinPath(currentSourceDir(),"private/cimCTE").replace("\\", "/")
3635
const ImGuiColorTextEditPath = joinPath(currentSourceDir(),"private/cimCTE/ImGuiColorTextEdit").replace("\\", "/")
@@ -182,7 +181,6 @@ else: # Use generated header by Futark in your programs.
182181

183182
when defined(ImSpinnerEnable) or defined(ImSpinner) :
184183
{.passC:"-I" & CImSpinnerPath.}
185-
{.passC:"-I" & ImSpinnerPath.}
186184
{.compile:joinPath(CImSpinnerPath,"cimspinner.cpp").replace("\\", "/").}
187185

188186
when defined(ImColorTextEditEnable) or defined(ImColorTextEdit) :

src/imguin/cimgui_defs.nim

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,8 @@ type
12221222
ImGui_FileDialogFlags_DisablePlaceMode = 2048,
12231223
ImGui_FileDialogFlags_DisableQuickPathSelection = 4096,
12241224
ImGui_FileDialogFlags_ShowDevicesButton = 8192,
1225-
ImGui_FileDialogFlags_NaturalSorting = 16384
1225+
ImGui_FileDialogFlags_NaturalSorting = 16384,
1226+
ImGui_FileDialogFlags_OptionalFileName = 32768
12261227
type
12271228
enum_IGFD_ResultMode_private* {.size: sizeof(cuint).} = enum
12281229
IGFD_ResultMode_AddIfNoFileExt = 0, IGFD_ResultMode_OverwriteFileExt = 1,
@@ -4408,6 +4409,7 @@ type
44084409
ImPlane3D_private* = enum_ImPlane3D_private
44094410
ImPlot3DColormap_private* = enum_ImPlot3DColormap_private
44104411
ImPlot3DFormatter* = proc (a0: cfloat; a1: cstring; a2: cint; a3: pointer): cint {.cdecl.}
4412+
LeafColor* = proc (a0: cint): ImColor {.cdecl.}
44114413
TextEditor* = struct_TextEditor
44124414
PaletteId* = enum_PaletteId
44134415
LanguageDefinitionId* = enum_LanguageDefinitionId
@@ -4585,11 +4587,11 @@ when "v0.6.8" is static:
45854587
IGFD_VERSION* = "v0.6.8"
45864588
else:
45874589
let IGFD_VERSION* = "v0.6.8"
4588-
when "1.90.5 WIP" is static:
4590+
when "1.92.0 WIP" is static:
45894591
const
4590-
IGFD_IMGUI_SUPPORTED_VERSION* = "1.90.5 WIP"
4592+
IGFD_IMGUI_SUPPORTED_VERSION* = "1.92.0 WIP"
45914593
else:
4592-
let IGFD_IMGUI_SUPPORTED_VERSION* = "1.90.5 WIP"
4594+
let IGFD_IMGUI_SUPPORTED_VERSION* = "1.92.0 WIP"
45934595
when 1.618033988749895 is static:
45944596
const
45954597
ImGui_ToggleConstants_Phi* = 1.618033988749895
@@ -7305,6 +7307,8 @@ proc SpinnerWifiIndicator*(label: cstring; radius: cfloat; thickness: cfloat): v
73057307
proc SpinnerWifiIndicatorEx*(label: cstring; radius: cfloat; thickness: cfloat; color: ImColor; bg: ImColor; speed: cfloat; cangle: cfloat; dots: cint): void {.cdecl, importc: "SpinnerWifiIndicatorEx".}
73067308
proc SpinnerTrianglesSelector*(label: cstring; radius: cfloat; thickness: cfloat): void {.cdecl, importc: "SpinnerTrianglesSelector".}
73077309
proc SpinnerTrianglesSelectorEx*(label: cstring; radius: cfloat; thickness: cfloat; color: ImColor; bg: ImColor; speed: cfloat; bars: csize_t): void {.cdecl, importc: "SpinnerTrianglesSelectorEx".}
7310+
proc SpinnerCamera*(label: cstring; radius: cfloat; thickness: cfloat; leaf_color: LeafColor): void {.cdecl, importc: "SpinnerCamera".}
7311+
proc SpinnerCameraEx*(label: cstring; radius: cfloat; thickness: cfloat; leaf_color: LeafColor; speed: cfloat; bars: csize_t; mode: cint): void {.cdecl, importc: "SpinnerCameraEx".}
73087312
proc SpinnerFlowingGradient*(label: cstring; radius: cfloat; thickness: cfloat): void {.cdecl, importc: "SpinnerFlowingGradient".}
73097313
proc SpinnerFlowingGradientEx*(label: cstring; radius: cfloat; thickness: cfloat; color: ImColor; bg: ImColor; speed: cfloat; angle: cfloat): void {.cdecl, importc: "SpinnerFlowingGradientEx".}
73107314
proc SpinnerRotateSegments*(label: cstring; radius: cfloat; thickness: cfloat): void {.cdecl, importc: "SpinnerRotateSegments".}

src/imguin/private/CImGuiFileDialog/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ git hash: c66089f509bbfbc0d8852d54106b1af88a104822
6666
---
6767

6868
```sh
69-
git clone --recursive https://github.com/dinau/CImGuiFileDialog
69+
git clone -b main --single-branch --depth 1 --recursive --shallow-submodules https://github.com/dinau/CImGuiFileDialog
7070
```
7171

7272
For example,

src/imguin/private/CImGuiFileDialog/libs/ImGuiFileDialog/ImGuiFileDialog.cpp

Lines changed: 62 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,11 +1975,13 @@ bool IGFD::FileManager::m_CompleteFileInfosWithUserFileAttirbutes(const FileDial
19751975
void IGFD::FileManager::ClearFileLists() {
19761976
m_FilteredFileList.clear();
19771977
m_FileList.clear();
1978+
m_SelectedFileNames.clear();
19781979
}
19791980

19801981
void IGFD::FileManager::ClearPathLists() {
19811982
m_FilteredPathList.clear();
19821983
m_PathList.clear();
1984+
m_SelectedFileNames.clear();
19831985
}
19841986

19851987
void IGFD::FileManager::m_AddFile(const FileDialogInternal& vFileDialogInternal, const std::string& vPath, const std::string& vFileName, const FileType& vFileType) {
@@ -2711,16 +2713,23 @@ std::string IGFD::FileManager::GetResultingFilePathName(FileDialogInternal& vFil
27112713

27122714
std::map<std::string, std::string> IGFD::FileManager::GetResultingSelection(FileDialogInternal& vFileDialogInternal, IGFD_ResultMode vFlag) {
27132715
std::map<std::string, std::string> res;
2714-
for (const auto& selectedFileName : m_SelectedFileNames) {
2715-
auto result = GetResultingPath();
2716+
const auto& result_path = GetResultingPath();
2717+
if (!m_SelectedFileNames.empty()) {
2718+
for (const auto& selectedFileName : m_SelectedFileNames) {
2719+
auto result = result_path;
27162720
#ifdef _IGFD_UNIX_
2717-
if (fsRoot != result)
2721+
if (fsRoot != result)
27182722
#endif // _IGFD_UNIX_
2719-
{
2720-
result += IGFD::Utils::GetPathSeparator();
2723+
{
2724+
result += IGFD::Utils::GetPathSeparator();
2725+
}
2726+
result += vFileDialogInternal.filterManager.ReplaceExtentionWithCurrentFilterIfNeeded(selectedFileName, vFlag);
2727+
res[selectedFileName] = result;
2728+
}
2729+
} else { // opened directory with no selection
2730+
if (vFileDialogInternal.fileManager.dLGDirectoryMode) { // directory mode
2731+
res["."] = result_path;
27212732
}
2722-
result += vFileDialogInternal.filterManager.ReplaceExtentionWithCurrentFilterIfNeeded(selectedFileName, vFlag);
2723-
res[selectedFileName] = result;
27242733
}
27252734
return res;
27262735
}
@@ -3758,12 +3767,11 @@ bool IGFD::FileDialog::Display(const std::string& vKey, ImGuiWindowFlags vFlags,
37583767
}
37593768
m_FileDialogInternal.lastImGuiFrameCount = g.FrameCount; // mark this instance as used this frame
37603769

3761-
m_CurrentDisplayedFlags = ImGuiWindowFlags_None;
3770+
m_CurrentDisplayedFlags = vFlags;
37623771
std::string name = m_FileDialogInternal.dLGtitle + "##" + m_FileDialogInternal.dLGkey;
37633772
if (m_FileDialogInternal.name != name) {
37643773
fdFile.ClearComposer();
37653774
fdFile.ClearFileLists();
3766-
m_CurrentDisplayedFlags = vFlags;
37673775
}
37683776

37693777
m_NewFrame();
@@ -4018,7 +4026,8 @@ void IGFD::FileDialog::m_DisplayPathPopup(ImVec2 vSize) {
40184026

40194027
bool IGFD::FileDialog::m_DrawOkButton() {
40204028
auto& fdFile = m_FileDialogInternal.fileManager;
4021-
if (m_FileDialogInternal.canWeContinue && strlen(fdFile.fileNameBuffer)) {
4029+
if (m_FileDialogInternal.canWeContinue && strlen(fdFile.fileNameBuffer) || //
4030+
m_FileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_OptionalFileName) { // optional
40224031
if (IMGUI_BUTTON(okButtonString "##validationdialog", ImVec2(okButtonWidth, 0.0f)) || m_FileDialogInternal.isOk) {
40234032
m_FileDialogInternal.isOk = true;
40244033
return true;
@@ -4105,7 +4114,22 @@ bool IGFD::FileDialog::m_DrawFooter() {
41054114
return res;
41064115
}
41074116

4108-
void IGFD::FileDialog::m_SelectableItem(int vidx, std::shared_ptr<FileInfos> vInfos, bool vSelected, const char* vFmt, ...) {
4117+
bool IGFD::FileDialog::m_Selectable(int vRowIdx, const char* vLabel, bool vSelected, ImGuiSelectableFlags vFlags, const ImVec2& vSizeArg) {
4118+
bool res = false;
4119+
#ifdef USE_EXPLORATION_BY_KEYS
4120+
bool flashed = m_BeginFlashItem((size_t)vRowIdx);
4121+
res = m_FlashableSelectable(vLabel, vSelected, vFlags, flashed, vSizeArg);
4122+
if (flashed) {
4123+
m_EndFlashItem();
4124+
}
4125+
#else // USE_EXPLORATION_BY_KEYS
4126+
(void)vRowIdx; // remove a warnings for unused var
4127+
res = ImGui::Selectable(vLabel, vSelected, vFlags, vSizeArg);
4128+
#endif // USE_EXPLORATION_BY_KEYS
4129+
return res;
4130+
}
4131+
4132+
void IGFD::FileDialog::m_SelectableItem(int vRowIdx, std::shared_ptr<FileInfos> vInfos, bool vSelected, const char* vFmt, ...) {
41094133
if (!vInfos.use_count()) return;
41104134

41114135
auto& fdi = m_FileDialogInternal.fileManager;
@@ -4123,18 +4147,7 @@ void IGFD::FileDialog::m_SelectableItem(int vidx, std::shared_ptr<FileInfos> vIn
41234147
h = DisplayMode_ThumbailsList_ImageHeight;
41244148
}
41254149
#endif // USE_THUMBNAILS
4126-
#ifdef USE_EXPLORATION_BY_KEYS
4127-
bool flashed = m_BeginFlashItem((size_t)vidx);
4128-
bool res = m_FlashableSelectable(fdi.variadicBuffer, vSelected, selectableFlags, flashed, ImVec2(-1.0f, h));
4129-
if (flashed) {
4130-
m_EndFlashItem();
4131-
}
4132-
#else // USE_EXPLORATION_BY_KEYS
4133-
(void)vidx; // remove a warnings for unused var
4134-
4135-
bool res = ImGui::Selectable(fdi.variadicBuffer, vSelected, selectableFlags, ImVec2(-1.0f, h));
4136-
#endif // USE_EXPLORATION_BY_KEYS
4137-
if (res) {
4150+
if (m_Selectable(vRowIdx, fdi.variadicBuffer, vSelected, selectableFlags, ImVec2(-1.0f, h))) {
41384151
if (vInfos->fileType.isDir()) {
41394152
// nav system, selectable cause open directory or select directory
41404153
if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) {
@@ -4194,13 +4207,29 @@ void IGFD::FileDialog::m_BeginFileColorIconStyle(std::shared_ptr<FileInfos> vFil
41944207

41954208
vOutStr += " " + vFileInfos->fileNameExt;
41964209

4197-
if (vOutShowColor) ImGui::PushStyleColor(ImGuiCol_Text, vFileInfos->fileStyle->color);
4198-
if (*vOutFont) ImGui::PushFont(*vOutFont);
4210+
if (vOutShowColor) {
4211+
ImGui::PushStyleColor(ImGuiCol_Text, vFileInfos->fileStyle->color);
4212+
}
4213+
if (*vOutFont) {
4214+
#if IMGUI_VERSION_NUM < 19201
4215+
ImGui::PushFont(*vOutFont);
4216+
#else
4217+
ImGui::PushFont(*vOutFont, 0.0f);
4218+
#endif
4219+
}
41994220
}
42004221

42014222
void IGFD::FileDialog::m_EndFileColorIconStyle(const bool vShowColor, ImFont* vFont) {
4202-
if (vFont) ImGui::PopFont();
4203-
if (vShowColor) ImGui::PopStyleColor();
4223+
if (vFont) {
4224+
ImGui::PopFont();
4225+
}
4226+
if (vShowColor) {
4227+
ImGui::PopStyleColor();
4228+
}
4229+
}
4230+
4231+
void IGFD::FileDialog::m_drawColumnText(int /*vColIdx*/, const char* vLabel, bool /*vSelected*/, bool /*vHovered*/) {
4232+
ImGui::Text("%s", vLabel);
42044233
}
42054234

42064235
void IGFD::FileDialog::m_DrawFileListView(ImVec2 vSize) {
@@ -4310,6 +4339,7 @@ void IGFD::FileDialog::m_DrawFileListView(ImVec2 vSize) {
43104339
bool _showColor = false;
43114340

43124341
int column_id = 0;
4342+
bool _rowHovered = false;
43134343
m_FileListClipper.Begin((int)fdi.GetFilteredListSize(), ImGui::GetTextLineHeightWithSpacing());
43144344
while (m_FileListClipper.Step()) {
43154345
for (int i = m_FileListClipper.DisplayStart; i < m_FileListClipper.DisplayEnd; i++) {
@@ -4325,30 +4355,31 @@ void IGFD::FileDialog::m_DrawFileListView(ImVec2 vSize) {
43254355
ImGui::TableNextRow();
43264356

43274357
column_id = 0;
4358+
_rowHovered = false;
43284359
if (ImGui::TableNextColumn()) { // file name
43294360
if (!infos_ptr->deviceInfos.empty()) {
43304361
_str += " " + infos_ptr->deviceInfos;
43314362
}
43324363
m_SelectableItem(i, infos_ptr, selected, _str.c_str());
4364+
_rowHovered = ImGui::IsItemHovered();
43334365
m_DisplayFileInfosTooltip(i, column_id++, infos_ptr);
43344366
}
43354367
if (ImGui::TableNextColumn()) { // file type
4336-
ImGui::Text("%s", infos_ptr->fileExtLevels[0].c_str());
4368+
m_drawColumnText(column_id, infos_ptr->fileExtLevels[0].c_str(), selected, _rowHovered);
43374369
m_DisplayFileInfosTooltip(i, column_id++, infos_ptr);
43384370
}
43394371
if (ImGui::TableNextColumn()) { // file size
43404372
if (!infos_ptr->fileType.isDir()) {
4341-
ImGui::Text("%s ", infos_ptr->formatedFileSize.c_str());
4373+
m_drawColumnText(column_id, infos_ptr->formatedFileSize.c_str(), selected, _rowHovered);
43424374
} else {
43434375
ImGui::TextUnformatted("");
43444376
}
43454377
m_DisplayFileInfosTooltip(i, column_id++, infos_ptr);
43464378
}
43474379
if (ImGui::TableNextColumn()) { // file date + time
4348-
ImGui::Text("%s", infos_ptr->fileModifDate.c_str());
4380+
m_drawColumnText(column_id, infos_ptr->fileModifDate.c_str(), selected, _rowHovered);
43494381
m_DisplayFileInfosTooltip(i, column_id++, infos_ptr);
43504382
}
4351-
43524383
m_EndFileColorIconStyle(_showColor, _font);
43534384
}
43544385
}

0 commit comments

Comments
 (0)