mirror of
https://github.com/bdnugget/xautoclick.git
synced 2026-11-07 09:17:31 +00:00
Add units of measurements, fixes #3
This commit is contained in:
1 parent
fd72e4bf2b
commit
a7ed1d2be2
5 files changed
+16
-15
No files matched your search
+1
-1
@@ -30,7 +30,7 @@ extern "C" {
|
||||
#include <QVBoxLayout>
|
||||
|
||||
ClickWidget::ClickWidget(QWidget *parent) : QWidget(parent) {
|
||||
QString label[SPINS_COUNT] = { "Pre-delay", "Interval", "Random +/-", "# of clicks" };
|
||||
QString label[SPINS_COUNT] = { "Pre-delay, ms", "Interval, ms", "Random +/-, ms", "# of clicks" };
|
||||
QString butnames[BUTTONS_COUNT] = { "Tap", "Stop", "Start" };
|
||||
|
||||
QVBoxLayout *vbox = new QVBoxLayout;
|
||||
|
||||
+6
-6
@@ -57,9 +57,9 @@ int init_gui(int argc, char **argv) {
|
||||
}
|
||||
|
||||
printf("aautoclick\n\n");
|
||||
printf("p - set pre-delay\n");
|
||||
printf("i - set interval\n");
|
||||
printf("r - set random +/-\n");
|
||||
printf("p - set pre-delay, ms\n");
|
||||
printf("i - set interval, ms\n");
|
||||
printf("r - set random +/-, ms\n");
|
||||
printf("n - set number of clicks\n");
|
||||
printf("t - tap\n");
|
||||
printf("s - start\n");
|
||||
@@ -77,9 +77,9 @@ void close_gui(void) {
|
||||
}
|
||||
|
||||
static void print_variables(void) {
|
||||
printf("pre-delay: %i\n", spins[SPIN_PREDELAY]);
|
||||
printf("interval: %i\n", spins[SPIN_INTERVAL]);
|
||||
printf("random +/-: %i\n", spins[SPIN_RANDOM]);
|
||||
printf("pre-delay: %i ms\n", spins[SPIN_PREDELAY]);
|
||||
printf("interval: %i ms\n", spins[SPIN_INTERVAL]);
|
||||
printf("random +/-: %i ms\n", spins[SPIN_RANDOM]);
|
||||
printf("number of clicks: %i\n", spins[SPIN_NUMBER]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ void set_button_sensitive(button_t button, bool state) {
|
||||
}
|
||||
|
||||
static void printhelp(char *myname) {
|
||||
printf("usage: %s [-h][-i value][-n value][-p value][-r value]\n", myname);
|
||||
printf("usage: %s [-h][-i <interval, ms>][-n <# of clicks>][-p <pre-delay, ms>][-r <random +/-, ms>]\n", myname);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -82,7 +82,8 @@ static void start_callback(Fl_Widget *w, void *v) {
|
||||
|
||||
static Fl_Button* create_button(const char* name, Fl_Callback *callback) {
|
||||
static int n = 0;
|
||||
auto button = new Fl_Button(5+55*n, 125, 55, 25, name);
|
||||
const int width = 65;
|
||||
auto button = new Fl_Button(5 + width*n, 125, width, 25, name);
|
||||
button->callback(callback);
|
||||
++n;
|
||||
return button;
|
||||
@@ -90,7 +91,7 @@ static Fl_Button* create_button(const char* name, Fl_Callback *callback) {
|
||||
|
||||
static Fl_Spinner* create_spin(const char* name) {
|
||||
static int n = 0;
|
||||
auto spin = new Fl_Spinner(95, 5+n*30, 75, 25, name);
|
||||
auto spin = new Fl_Spinner(125, 5+n*30, 75, 25, name);
|
||||
spin->minimum(1);
|
||||
spin->maximum(INT_MAX);
|
||||
++n;
|
||||
@@ -104,7 +105,7 @@ int init_gui(int argc, char **argv) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
win = new Fl_Double_Window(175, 155, "fltkAutoClick");
|
||||
win = new Fl_Double_Window(205, 155, "fltkAutoClick");
|
||||
win->begin();
|
||||
win->align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE);
|
||||
|
||||
@@ -112,7 +113,7 @@ int init_gui(int argc, char **argv) {
|
||||
buttons[BUTTON_STOP] = create_button("Stop", stop_callback);
|
||||
buttons[BUTTON_START] = create_button("Start", start_callback);
|
||||
|
||||
const char * const label[SPINS_COUNT] = { "Pre-delay", "Interval", "Random +/-", "# of clicks" };
|
||||
const char * const label[SPINS_COUNT] = { "Pre-delay, ms", "Interval, ms", "Random +/-, ms", "# of clicks" };
|
||||
for (int c = 0; c < SPINS_COUNT; c++)
|
||||
spins[c] = create_spin(label[c]);
|
||||
|
||||
|
||||
@@ -119,9 +119,9 @@ static void create_spins(GObject *root, GtkWidget *box) {
|
||||
const char* text;
|
||||
int min_value;
|
||||
} spin_params[SPINS_COUNT] = {
|
||||
{"Pre-delay ", 0},
|
||||
{"Interval ", 0},
|
||||
{"Random +/- ", 0},
|
||||
{"Pre-delay, ms", 0},
|
||||
{"Interval, ms", 0},
|
||||
{"Random +/-, ms ", 0},
|
||||
{"# of clicks ", 1}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user