Open Zaryob opened 2 days ago
bool mouseClicked = ImGui::ButtonBehavior(ImRect(fftAreaMin, wfMax), GetID("WaterfallID"), &mouseHovered, &mouseHeld, ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_PressedOnClick); bool mouseRClicked = ImGui::ButtonBehavior(ImRect(fftAreaMin, wfMax), GetID("WaterfallID"), &mouseHovered, &mouseHeld, ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_PressedOnClick);
That's an interesting use case. I think it this specific case indeed did work before (even if it should be illegal). I will investigate this.
I think you can use single button with both ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight
and then checking which mouse button was clicked or released? This should work.
You can surround this block of code with:
PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true);
ButtonBehavior(...)
ButtonBehavior(...)
PopItemFlag();
bool mouseClicked = ImGui::ButtonBehavior(ImRect(fftAreaMin, wfMax), GetID("WaterfallID"), &mouseHovered, &mouseHeld, ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_PressedOnClick); bool mouseRClicked = ImGui::ButtonBehavior(ImRect(fftAreaMin, wfMax), GetID("WaterfallID"), &mouseHovered, &mouseHeld, ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_PressedOnClick);
That's an interesting use case. I think it this specific case indeed did work before (even if it should be illegal). I will investigate this.
I think you can use single button with both
ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight
and then checking which mouse button was clicked or released? This should work.
It legally fixed like this:
bool mouseClicked = ImGui::ButtonBehavior(ImRect(fftAreaMin, wfMax), GetID("WaterfallID"), &mouseHovered, &mouseHeld,
ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_PressedOnClick);
It gathers if mouseClicked and then;
if (mouseClicked && !targetFound) {
if (IsMouseClicked(ImGuiMouseButton_Right)) {
......
}
else {
......
}
}
It solved my problem but if you consider to investigate, Issue can be open remain.
Version/Branch of Dear ImGui:
Branch: docking, Commit: 793773209bb0fdeb8ccb756052e770457193c9f2
Back-ends:
imgui_impl_opengl3.cpp
Compiler, OS:
macOS + Clang 12, GCC, Windows + MSVC
Full config/build information:
No response
Details:
My Issue/Question:
Hi,
I was getting the click behavior using two ButtonBehavior(), one left click (with ImGuiButtonFlags_MouseButtonLeft flag) and one right click (with ImGuiButtonFlags_MouseButtonRight flag).
However, I get the following image with the io.ConfigDebugDetectIdConflicts added since commit number d1ea03b872c1de31ab4c0167cf959dffe947cbeb.
Here I have a basic situation and two questions.
I think the io.ConfigDebugDetectIdConflicts parameter is not implemented because it is still in development. Therefore I cannot close this error ("Unless I patch it manually"). Will it be added???
Secondly, I use two ButtonBehaviour's to achieve this behavior. I tried different ways:
So, how can I encourage with this issue?
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
It is fork of SDRPlusPlus of AlexandreRouma,
Code is on https://github.com/Zaryob/SDRPlusPlus