Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving more trackbars on single mouse down #84

Open
freetomik opened this issue Sep 9, 2019 · 6 comments
Open

Moving more trackbars on single mouse down #84

freetomik opened this issue Sep 9, 2019 · 6 comments
Labels

Comments

@freetomik
Copy link

I have more trackbars below each other. When I am moving first one, and go with mouse cursor over next ones, they are being moved instead of first one. It is quite annoying.
Could this be fixed to moving only firstly selected trackbar, please?

@Dovyski
Copy link
Owner

Dovyski commented Sep 9, 2019

Thanks for your report! Could you please provide a snippet of your code so I can better understand the problem? Are you using a single window for your application or multiple windows, for instance?

@freetomik
Copy link
Author

freetomik commented Sep 11, 2019

I am using a single window. I just have several trackbars below each other:

cvui::trackbar(...);
cvui::trackbar(...);
cvui::trackbar(...);
cvui::trackbar(...);

cvui_trackbars
When I hold most top trackbar and move mouse into trails of trackbars below, they are moved instead of the top one, which I am holding.
[EDIT] Note: Putting trackbars into rows does not help.

@Dovyski
Copy link
Owner

Dovyski commented Sep 11, 2019

Could you provide a bit more code regarding the cvui::trackbar(...); call, please? What is in the (...) and what variables are you using?

@freetomik
Copy link
Author

Sure, here is complete minimal working example:

#include <opencv2/opencv.hpp>

#define CVUI_IMPLEMENTATION
#include "cvui.h"

int main(int argc, char** argv)
{
	double a = 50.0;
	double b = 25.0;

	const double min = 0.0;
	const double max = 100.0;

	cv::namedWindow("Window", cv::WINDOW_AUTOSIZE);
	cvui::init("Window");

	cv::Mat frame = cv::Mat::zeros(120, 500, CV_8U);

	while (true)
	{
		cvui::window(frame, 0, 0, frame.cols, frame.rows, "Settings");

		cvui::trackbar(frame, 20, 20, frame.cols - 50, &a, min, max);
		cvui::trackbar(frame, 20, 60, frame.cols - 50, &b, min, max);

		cvui::imshow("Window", frame);

		if (cv::waitKey(30) == 27) break;
	}

	return 0;
}

@freetomik
Copy link
Author

freetomik commented Sep 12, 2019

Behaviour looks like this:
cvui_trackbars
This is on single mouse down. When user wants to change only one parameter at time, back and forth, it is annoying, when other parameters are also changed, if he/she misses the exact horizontal trail of the trackbar.
[EDIT]: CVUI is otherwise great idea and very useful - thanks for making it! But this one thing I found uncomfortable.

@Dovyski
Copy link
Owner

Dovyski commented Sep 30, 2019

Thank you for your information. I'll work on this bug as soon as I have some free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants