From e32c474ae1f43aae3f77bb18fdb57910646de0e3 Mon Sep 17 00:00:00 2001
From: Indrajith K L
Date: Mon, 13 May 2024 02:13:07 +0530
Subject: Initial Commit
* Basic CSV Parsing and Editable Table Display
---
CSV Editor/CSV Editor.vcxproj | 163 +
CSV Editor/CSV Editor.vcxproj.filters | 78 +
CSV Editor/imgui.ini | 53 +
CSV Editor/src/main.cpp | 277 +
CSV Editor/src/rapidcsv.h | 1916 +++
.../vendor/ImGui/backends/imgui_impl_allegro5.cpp | 614 +
.../vendor/ImGui/backends/imgui_impl_allegro5.h | 38 +
.../vendor/ImGui/backends/imgui_impl_android.cpp | 306 +
.../vendor/ImGui/backends/imgui_impl_android.h | 36 +
.../vendor/ImGui/backends/imgui_impl_dx10.cpp | 589 +
CSV Editor/vendor/ImGui/backends/imgui_impl_dx10.h | 31 +
.../vendor/ImGui/backends/imgui_impl_dx11.cpp | 605 +
CSV Editor/vendor/ImGui/backends/imgui_impl_dx11.h | 32 +
.../vendor/ImGui/backends/imgui_impl_dx12.cpp | 761 +
CSV Editor/vendor/ImGui/backends/imgui_impl_dx12.h | 44 +
.../vendor/ImGui/backends/imgui_impl_dx9.cpp | 410 +
CSV Editor/vendor/ImGui/backends/imgui_impl_dx9.h | 31 +
.../vendor/ImGui/backends/imgui_impl_glfw.cpp | 858 +
CSV Editor/vendor/ImGui/backends/imgui_impl_glfw.h | 58 +
.../vendor/ImGui/backends/imgui_impl_glut.cpp | 308 +
CSV Editor/vendor/ImGui/backends/imgui_impl_glut.h | 46 +
.../vendor/ImGui/backends/imgui_impl_metal.h | 72 +
.../vendor/ImGui/backends/imgui_impl_metal.mm | 590 +
.../vendor/ImGui/backends/imgui_impl_opengl2.cpp | 302 +
.../vendor/ImGui/backends/imgui_impl_opengl2.h | 38 +
.../vendor/ImGui/backends/imgui_impl_opengl3.cpp | 956 ++
.../vendor/ImGui/backends/imgui_impl_opengl3.h | 66 +
.../ImGui/backends/imgui_impl_opengl3_loader.h | 910 ++
CSV Editor/vendor/ImGui/backends/imgui_impl_osx.h | 51 +
CSV Editor/vendor/ImGui/backends/imgui_impl_osx.mm | 812 +
.../vendor/ImGui/backends/imgui_impl_sdl2.cpp | 754 +
CSV Editor/vendor/ImGui/backends/imgui_impl_sdl2.h | 45 +
.../vendor/ImGui/backends/imgui_impl_sdl3.cpp | 705 +
CSV Editor/vendor/ImGui/backends/imgui_impl_sdl3.h | 47 +
.../ImGui/backends/imgui_impl_sdlrenderer2.cpp | 266 +
.../ImGui/backends/imgui_impl_sdlrenderer2.h | 39 +
.../ImGui/backends/imgui_impl_sdlrenderer3.cpp | 260 +
.../ImGui/backends/imgui_impl_sdlrenderer3.h | 39 +
.../vendor/ImGui/backends/imgui_impl_vulkan.cpp | 1587 ++
.../vendor/ImGui/backends/imgui_impl_vulkan.h | 195 +
.../vendor/ImGui/backends/imgui_impl_wgpu.cpp | 797 +
CSV Editor/vendor/ImGui/backends/imgui_impl_wgpu.h | 49 +
.../vendor/ImGui/backends/imgui_impl_win32.cpp | 922 ++
.../vendor/ImGui/backends/imgui_impl_win32.h | 52 +
.../vendor/ImGui/backends/vulkan/generate_spv.sh | 6 +
.../vendor/ImGui/backends/vulkan/glsl_shader.frag | 14 +
.../vendor/ImGui/backends/vulkan/glsl_shader.vert | 25 +
CSV Editor/vendor/ImGui/imconfig.h | 131 +
CSV Editor/vendor/ImGui/imgui.cpp | 15863 +++++++++++++++++++
CSV Editor/vendor/ImGui/imgui.h | 3329 ++++
CSV Editor/vendor/ImGui/imgui_demo.cpp | 8607 ++++++++++
CSV Editor/vendor/ImGui/imgui_draw.cpp | 4623 ++++++
CSV Editor/vendor/ImGui/imgui_internal.h | 3617 +++++
CSV Editor/vendor/ImGui/imgui_tables.cpp | 4431 ++++++
CSV Editor/vendor/ImGui/imgui_widgets.cpp | 8995 +++++++++++
CSV Editor/vendor/ImGui/imstb_rectpack.h | 627 +
CSV Editor/vendor/ImGui/imstb_textedit.h | 1441 ++
CSV Editor/vendor/ImGui/imstb_truetype.h | 5085 ++++++
CSV Editor/vendor/ImGui/misc/README.txt | 23 +
CSV Editor/vendor/ImGui/misc/cpp/README.txt | 13 +
CSV Editor/vendor/ImGui/misc/cpp/imgui_stdlib.cpp | 85 +
CSV Editor/vendor/ImGui/misc/cpp/imgui_stdlib.h | 21 +
CSV Editor/vendor/ImGui/misc/debuggers/README.txt | 16 +
CSV Editor/vendor/ImGui/misc/debuggers/imgui.gdb | 12 +
.../ImGui/misc/debuggers/imgui.natstepfilter | 31 +
.../vendor/ImGui/misc/debuggers/imgui.natvis | 58 +
.../vendor/ImGui/misc/fonts/Cousine-Regular.ttf | Bin 0 -> 43912 bytes
CSV Editor/vendor/ImGui/misc/fonts/DroidSans.ttf | Bin 0 -> 190044 bytes
.../vendor/ImGui/misc/fonts/Karla-Regular.ttf | Bin 0 -> 16848 bytes
CSV Editor/vendor/ImGui/misc/fonts/ProggyClean.ttf | Bin 0 -> 41208 bytes
CSV Editor/vendor/ImGui/misc/fonts/ProggyTiny.ttf | Bin 0 -> 35656 bytes
.../vendor/ImGui/misc/fonts/Roboto-Medium.ttf | Bin 0 -> 162588 bytes
.../ImGui/misc/fonts/binary_to_compressed_c.cpp | 388 +
CSV Editor/vendor/ImGui/misc/freetype/README.md | 44 +
.../vendor/ImGui/misc/freetype/imgui_freetype.cpp | 950 ++
.../vendor/ImGui/misc/freetype/imgui_freetype.h | 51 +
.../ImGui/misc/single_file/imgui_single_file.h | 29 +
77 files changed, 75323 insertions(+)
create mode 100644 CSV Editor/CSV Editor.vcxproj
create mode 100644 CSV Editor/CSV Editor.vcxproj.filters
create mode 100644 CSV Editor/imgui.ini
create mode 100644 CSV Editor/src/main.cpp
create mode 100644 CSV Editor/src/rapidcsv.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_allegro5.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_allegro5.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_android.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_android.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_dx10.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_dx10.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_dx11.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_dx11.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_dx12.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_dx12.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_dx9.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_dx9.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_glfw.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_glfw.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_glut.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_glut.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_metal.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_metal.mm
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_opengl2.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_opengl2.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_opengl3.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_opengl3.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_opengl3_loader.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_osx.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_osx.mm
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_sdl2.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_sdl2.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_sdl3.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_sdl3.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_sdlrenderer2.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_sdlrenderer2.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_sdlrenderer3.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_sdlrenderer3.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_vulkan.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_vulkan.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_wgpu.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_wgpu.h
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_win32.cpp
create mode 100644 CSV Editor/vendor/ImGui/backends/imgui_impl_win32.h
create mode 100644 CSV Editor/vendor/ImGui/backends/vulkan/generate_spv.sh
create mode 100644 CSV Editor/vendor/ImGui/backends/vulkan/glsl_shader.frag
create mode 100644 CSV Editor/vendor/ImGui/backends/vulkan/glsl_shader.vert
create mode 100644 CSV Editor/vendor/ImGui/imconfig.h
create mode 100644 CSV Editor/vendor/ImGui/imgui.cpp
create mode 100644 CSV Editor/vendor/ImGui/imgui.h
create mode 100644 CSV Editor/vendor/ImGui/imgui_demo.cpp
create mode 100644 CSV Editor/vendor/ImGui/imgui_draw.cpp
create mode 100644 CSV Editor/vendor/ImGui/imgui_internal.h
create mode 100644 CSV Editor/vendor/ImGui/imgui_tables.cpp
create mode 100644 CSV Editor/vendor/ImGui/imgui_widgets.cpp
create mode 100644 CSV Editor/vendor/ImGui/imstb_rectpack.h
create mode 100644 CSV Editor/vendor/ImGui/imstb_textedit.h
create mode 100644 CSV Editor/vendor/ImGui/imstb_truetype.h
create mode 100644 CSV Editor/vendor/ImGui/misc/README.txt
create mode 100644 CSV Editor/vendor/ImGui/misc/cpp/README.txt
create mode 100644 CSV Editor/vendor/ImGui/misc/cpp/imgui_stdlib.cpp
create mode 100644 CSV Editor/vendor/ImGui/misc/cpp/imgui_stdlib.h
create mode 100644 CSV Editor/vendor/ImGui/misc/debuggers/README.txt
create mode 100644 CSV Editor/vendor/ImGui/misc/debuggers/imgui.gdb
create mode 100644 CSV Editor/vendor/ImGui/misc/debuggers/imgui.natstepfilter
create mode 100644 CSV Editor/vendor/ImGui/misc/debuggers/imgui.natvis
create mode 100644 CSV Editor/vendor/ImGui/misc/fonts/Cousine-Regular.ttf
create mode 100644 CSV Editor/vendor/ImGui/misc/fonts/DroidSans.ttf
create mode 100644 CSV Editor/vendor/ImGui/misc/fonts/Karla-Regular.ttf
create mode 100644 CSV Editor/vendor/ImGui/misc/fonts/ProggyClean.ttf
create mode 100644 CSV Editor/vendor/ImGui/misc/fonts/ProggyTiny.ttf
create mode 100644 CSV Editor/vendor/ImGui/misc/fonts/Roboto-Medium.ttf
create mode 100644 CSV Editor/vendor/ImGui/misc/fonts/binary_to_compressed_c.cpp
create mode 100644 CSV Editor/vendor/ImGui/misc/freetype/README.md
create mode 100644 CSV Editor/vendor/ImGui/misc/freetype/imgui_freetype.cpp
create mode 100644 CSV Editor/vendor/ImGui/misc/freetype/imgui_freetype.h
create mode 100644 CSV Editor/vendor/ImGui/misc/single_file/imgui_single_file.h
(limited to 'CSV Editor')
diff --git a/CSV Editor/CSV Editor.vcxproj b/CSV Editor/CSV Editor.vcxproj
new file mode 100644
index 0000000..79866f5
--- /dev/null
+++ b/CSV Editor/CSV Editor.vcxproj
@@ -0,0 +1,163 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 17.0
+ Win32Proj
+ {7c9054cf-c1f4-4119-a2c4-3681a3e38e9b}
+ CSVEditor
+ 10.0
+
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(ProjectDir)vendor\ImGui;$(ProjectDir)vendor\ImGui\backends;$(IncludePath)
+
+
+ $(ProjectDir)vendor\ImGui;$(ProjectDir)vendor\ImGui\backends;$(IncludePath)
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ d3d9.lib;%(AdditionalDependencies)
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+ d3d9.lib;%(AdditionalDependencies)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CSV Editor/CSV Editor.vcxproj.filters b/CSV Editor/CSV Editor.vcxproj.filters
new file mode 100644
index 0000000..e489d0b
--- /dev/null
+++ b/CSV Editor/CSV Editor.vcxproj.filters
@@ -0,0 +1,78 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/CSV Editor/imgui.ini b/CSV Editor/imgui.ini
new file mode 100644
index 0000000..0582132
--- /dev/null
+++ b/CSV Editor/imgui.ini
@@ -0,0 +1,53 @@
+[Window][Debug##Default]
+Pos=179,68
+Size=400,400
+
+[Window][Dear ImGui Demo]
+Pos=719,23
+Size=550,680
+
+[Window][Hello, world!]
+Pos=209,37
+Size=339,180
+
+[Window][Another Window]
+Pos=528,62
+Size=198,71
+
+[Window][CSV Editor]
+Pos=0,0
+Size=1264,749
+
+[Table][0xDA36A7E0,6]
+RefScale=13
+Column 0 Width=28 Sort=0v
+Column 1 Width=42
+Column 2 Width=73
+Column 3 Width=68
+Column 4 Weight=1.0000
+Column 5 Width=-1
+
+[Table][0x82CBB907,3]
+Column 0 Weight=1.0000
+Column 1 Weight=1.0000
+Column 2 Weight=1.0000
+
+[Table][0x49D11DC0,3]
+RefScale=13
+Column 0 Width=86
+Column 1 Width=86
+Column 2 Width=86
+
+[Table][0x8DFA6E86,2]
+Column 0 Weight=1.0000
+Column 1 Weight=1.0000
+
+[Table][0xFABAAEF7,2]
+Column 0 Weight=1.0000
+Column 1 Weight=1.0000
+
+[Table][0x0F4524DA,2]
+RefScale=13
+Column 0 Width=163
+Column 1 Width=82
+
diff --git a/CSV Editor/src/main.cpp b/CSV Editor/src/main.cpp
new file mode 100644
index 0000000..d8cd2d5
--- /dev/null
+++ b/CSV Editor/src/main.cpp
@@ -0,0 +1,277 @@
+// Standalone CSV Editor using ImGui + DirectX 9
+
+#include "imgui.h"
+#include "imgui_impl_dx9.h"
+#include "imgui_impl_win32.h"
+#include
+#include
+#include
+#include
+#include "rapidcsv.h"
+
+// Structs
+struct Cell {
+ std::string uniqueId;
+ std::string value;
+};
+
+// Data
+static LPDIRECT3D9 g_pD3D = nullptr;
+static LPDIRECT3DDEVICE9 g_pd3dDevice = nullptr;
+static UINT g_ResizeWidth = 0, g_ResizeHeight = 0;
+static D3DPRESENT_PARAMETERS g_d3dpp = {};
+
+//member function
+
+std::vector getCSVHeader();
+std::vector> getCSVData();
+
+// Forward declarations of helper functions
+bool CreateDeviceD3D(HWND hWnd);
+void CleanupDeviceD3D();
+void ResetDevice();
+LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+// Main code
+int main(int, char**)
+{
+ // Create application window
+ //ImGui_ImplWin32_EnableDpiAwareness();
+ std::vector headers = getCSVHeader();
+ std::vector> data = getCSVData();
+
+ WNDCLASSEXW wc = { sizeof(wc), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(nullptr), nullptr, nullptr, nullptr, nullptr, L"ImGui Example", nullptr };
+ ::RegisterClassExW(&wc);
+ HWND hwnd = ::CreateWindowW(wc.lpszClassName, L"Dear ImGui DirectX9 Example", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, nullptr, nullptr, wc.hInstance, nullptr);
+
+ // Initialize Direct3D
+ if (!CreateDeviceD3D(hwnd))
+ {
+ CleanupDeviceD3D();
+ ::UnregisterClassW(wc.lpszClassName, wc.hInstance);
+ return 1;
+ }
+
+ // Show the window
+ ::ShowWindow(hwnd, SW_SHOWDEFAULT);
+ ::UpdateWindow(hwnd);
+
+ // Setup Dear ImGui context
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ ImGuiIO& io = ImGui::GetIO(); (void)io;
+ io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
+ io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
+
+ // Setup Dear ImGui style
+ ImGui::StyleColorsDark();
+ //ImGui::StyleColorsLight();
+
+ // Setup Platform/Renderer backends
+ ImGui_ImplWin32_Init(hwnd);
+ ImGui_ImplDX9_Init(g_pd3dDevice);
+
+
+ ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
+
+ // Main loop
+ bool done = false;
+ while (!done)
+ {
+ // Poll and handle messages (inputs, window resize, etc.)
+ // See the WndProc() function below for our to dispatch events to the Win32 backend.
+ MSG msg;
+ while (::PeekMessage(&msg, nullptr, 0U, 0U, PM_REMOVE))
+ {
+ ::TranslateMessage(&msg);
+ ::DispatchMessage(&msg);
+ if (msg.message == WM_QUIT)
+ done = true;
+ }
+ if (done)
+ break;
+
+ // Handle window resize (we don't resize directly in the WM_SIZE handler)
+ if (g_ResizeWidth != 0 && g_ResizeHeight != 0)
+ {
+ g_d3dpp.BackBufferWidth = g_ResizeWidth;
+ g_d3dpp.BackBufferHeight = g_ResizeHeight;
+ g_ResizeWidth = g_ResizeHeight = 0;
+ ResetDevice();
+ }
+
+ // Start the Dear ImGui frame
+ ImGui_ImplDX9_NewFrame();
+ ImGui_ImplWin32_NewFrame();
+ ImGui::NewFrame();
+
+ ImGui::SetNextWindowPos(ImGui::GetMainViewport()->Pos);
+ ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size);
+ static ImGuiTableFlags flags = ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_Resizable;
+ if (ImGui::Begin("CSV Editor")) {
+ if (ImGui::BeginTable("table1", headers.size(), flags))
+ {
+ for (const auto& header : headers) {
+ //std::cout << header << std::endl;
+ ImGui::TableSetupColumn(header.c_str(), ImGuiTableColumnFlags_WidthFixed);
+ }
+ ImGui::TableHeadersRow();
+ for (size_t i = 0; i < data.size(); i++) {
+ ImGui::TableNextRow();
+ for (size_t j = 0; j < data[i].size(); j++) {
+ //ImGui::TableNextColumn(); ImGui::Text(data[i][j].value.c_str());
+ ImGui::TableSetColumnIndex(j);
+ ImGui::PushID(data[i][j].uniqueId.c_str());
+ //char value[] = data[i][j].value.c_str();
+ char* value = &data[i][j].value[0];
+ //ImGui::InputText("Rdi", &data[i][j].value, Im);
+ //std::string value = data[i][j].value;
+ ImGui::InputText("##image_path", value, data[i][j].value.size()*100, ImGuiInputTextFlags_None);
+ ImGui::PopID();
+ }
+ }
+
+ /*for (int row = 0; row < 3; row++)
+ {
+ ImGui::TableNextRow();
+ ImGui::TableNextColumn(); ImGui::Text("Oh dear");
+ ImGui::TableNextColumn(); ImGui::Text("Oh dear");
+ ImGui::TableNextColumn(); ImGui::Text("Oh dear");
+ }*/
+ ImGui::EndTable();
+ }
+ }
+ ImGui::End();
+
+
+
+ // Rendering
+ ImGui::EndFrame();
+ g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
+ g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
+ g_pd3dDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
+ D3DCOLOR clear_col_dx = D3DCOLOR_RGBA((int)(clear_color.x * clear_color.w * 255.0f), (int)(clear_color.y * clear_color.w * 255.0f), (int)(clear_color.z * clear_color.w * 255.0f), (int)(clear_color.w * 255.0f));
+ g_pd3dDevice->Clear(0, nullptr, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, clear_col_dx, 1.0f, 0);
+ if (g_pd3dDevice->BeginScene() >= 0)
+ {
+ ImGui::Render();
+ ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
+ g_pd3dDevice->EndScene();
+ }
+ HRESULT result = g_pd3dDevice->Present(nullptr, nullptr, nullptr, nullptr);
+
+ // Handle loss of D3D9 device
+ if (result == D3DERR_DEVICELOST && g_pd3dDevice->TestCooperativeLevel() == D3DERR_DEVICENOTRESET)
+ ResetDevice();
+ }
+
+ ImGui_ImplDX9_Shutdown();
+ ImGui_ImplWin32_Shutdown();
+ ImGui::DestroyContext();
+
+ CleanupDeviceD3D();
+ ::DestroyWindow(hwnd);
+ ::UnregisterClassW(wc.lpszClassName, wc.hInstance);
+
+ return 0;
+}
+
+std::vector getCSVHeader() {
+
+ rapidcsv::Document doc("simple.csv");
+ // Get headers
+ std::vector headers = doc.GetColumnNames();
+ // Print headers
+ for (const auto& header : headers) {
+ std::cout << header << std::endl;
+ }
+ return headers;
+}
+
+std::vector> getCSVData() {
+ rapidcsv::Document doc("simple.csv");
+ std::vector> values;
+
+ for (size_t row = 0; row < doc.GetRowCount(); row++) {
+ std::vector rowValues;
+
+ for (size_t col = 0; col < doc.GetColumnCount(); col++) {
+ Cell cell;
+ cell.uniqueId = std::to_string(row) + "-" + std::to_string(col);
+ cell.value = doc.GetCell(col, row);
+ rowValues.push_back(cell);
+ }
+ values.push_back(rowValues);
+ }
+
+ return values;
+}
+
+// Helper functions
+
+bool CreateDeviceD3D(HWND hWnd)
+{
+ if ((g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == nullptr)
+ return false;
+
+ // Create the D3DDevice
+ ZeroMemory(&g_d3dpp, sizeof(g_d3dpp));
+ g_d3dpp.Windowed = TRUE;
+ g_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
+ g_d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; // Need to use an explicit format with alpha if needing per-pixel alpha composition.
+ g_d3dpp.EnableAutoDepthStencil = TRUE;
+ g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
+ g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; // Present with vsync
+ //g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; // Present without vsync, maximum unthrottled framerate
+ if (g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &g_d3dpp, &g_pd3dDevice) < 0)
+ return false;
+
+ return true;
+}
+
+void CleanupDeviceD3D()
+{
+ if (g_pd3dDevice) { g_pd3dDevice->Release(); g_pd3dDevice = nullptr; }
+ if (g_pD3D) { g_pD3D->Release(); g_pD3D = nullptr; }
+}
+
+void ResetDevice()
+{
+ ImGui_ImplDX9_InvalidateDeviceObjects();
+ HRESULT hr = g_pd3dDevice->Reset(&g_d3dpp);
+ if (hr == D3DERR_INVALIDCALL)
+ IM_ASSERT(0);
+ ImGui_ImplDX9_CreateDeviceObjects();
+}
+
+// Forward declare message handler from imgui_impl_win32.cpp
+extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+// Win32 message handler
+// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
+// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application, or clear/overwrite your copy of the mouse data.
+// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application, or clear/overwrite your copy of the keyboard data.
+// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
+LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ if (ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam))
+ return true;
+
+ switch (msg)
+ {
+ case WM_SIZE:
+ if (wParam == SIZE_MINIMIZED)
+ return 0;
+ g_ResizeWidth = (UINT)LOWORD(lParam); // Queue resize
+ g_ResizeHeight = (UINT)HIWORD(lParam);
+ return 0;
+ case WM_SYSCOMMAND:
+ if ((wParam & 0xfff0) == SC_KEYMENU) // Disable ALT application menu
+ return 0;
+ break;
+ case WM_DESTROY:
+ ::PostQuitMessage(0);
+ return 0;
+ }
+ return ::DefWindowProcW(hWnd, msg, wParam, lParam);
+}
diff --git a/CSV Editor/src/rapidcsv.h b/CSV Editor/src/rapidcsv.h
new file mode 100644
index 0000000..280aba3
--- /dev/null
+++ b/CSV Editor/src/rapidcsv.h
@@ -0,0 +1,1916 @@
+/*
+ * rapidcsv.h
+ *
+ * URL: https://github.com/d99kris/rapidcsv
+ * Version: 8.83
+ *
+ * Copyright (C) 2017-2024 Kristofer Berggren
+ * All rights reserved.
+ *
+ * rapidcsv is distributed under the BSD 3-Clause license, see LICENSE for details.
+ *
+ */
+
+#pragma once
+
+#include
+#include
+#include
+#ifdef HAS_CODECVT
+#include
+#include
+#endif
+#include
+#include
+#include
+#include
+#include
+#include |