#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "nilorea/n_common.h"
#include "nilorea/n_gui.h"
#include "nilorea/n_log.h"
Go to the source code of this file.
|
| static void | expect_true (const char *label, int cond) |
| | Assert a condition, logging which check failed.
|
| int | main (void) |
| static ALLEGRO_EVENT | mouse_event (int type, int x, int y) |
| | Build a left-button mouse event at (x, y).
|
| static void | on_change (int widget_id, double value, void *user_data) |
| | The slider's on_change: count the calls and keep the value.
|
| static void | press_at (N_GUI_CTX *gui, int x, int y, int release) |
| | Press the primary button at (x, y), and release it unless asked not to.
|
|
| static int | changes = 0 |
| | How many times on_change ran, and the last value it was given.
|
| static int | failures = 0 |
| | Count of failed assertions.
|
| static double | last_value = -1.0 |
| | how many times the picker called back, and with what
|
◆ ALLEGRO_UNSTABLE
| #define ALLEGRO_UNSTABLE 1 |
◆ expect_true()
| void expect_true |
( |
const char * | label, |
|
|
int | cond ) |
|
static |
◆ main()
Definition at line 112 of file ex_gui_slider_default.c.
References changes, expect_true(), failures, font, gui, last_value, LOG_ERR, LOG_NOTICE, mouse_event(), n_gui_add_slider(), n_gui_add_window(), n_gui_destroy_ctx(), n_gui_new_ctx(), n_gui_open_window(), n_gui_process_event(), n_gui_set_display_size(), n_gui_slider_get_default(), n_gui_slider_get_value(), n_gui_slider_set_default(), N_GUI_SLIDER_VALUE, N_GUI_WIN_FRAMELESS, n_gui_window_set_flags(), n_log, on_change(), press_at(), and set_log_level().
◆ mouse_event()
| ALLEGRO_EVENT mouse_event |
( |
int | type, |
|
|
int | x, |
|
|
int | y ) |
|
static |
Build a left-button mouse event at (x, y).
- Parameters
-
| type | The ALLEGRO_EVENT_MOUSE_* type. |
| x | Cursor x. |
| y | Cursor y. |
- Returns
- The event.
Definition at line 89 of file ex_gui_slider_default.c.
References type().
◆ on_change()
| void on_change |
( |
int | widget_id, |
|
|
double | value, |
|
|
void * | user_data ) |
|
static |
The slider's on_change: count the calls and keep the value.
- Parameters
-
| widget_id | The slider. |
| value | Its new value. |
| user_data | Unused. |
Definition at line 75 of file ex_gui_slider_default.c.
References changes, and last_value.
◆ press_at()
| void press_at |
( |
N_GUI_CTX * | gui, |
|
|
int | x, |
|
|
int | y, |
|
|
int | release ) |
|
static |
◆ changes
◆ failures
◆ last_value