![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#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.
Macros | |
| #define | ALLEGRO_UNSTABLE 1 |
Functions | |
| static void | expect_near (const char *label, double got, double want) |
| Assert two values are equal to within a tolerance. | |
| static void | expect_true (const char *label, int cond) |
| Assert a condition, logging which check failed. | |
| static void | handle_stays_inside (N_GUI_CTX *gui, int id, float along, const char *what) |
| Check that a slider's handle is drawn whole wherever its value is. | |
| int | main (void) |
| static ALLEGRO_EVENT | mouse_event (int type, int x, int y) |
Build a mouse event at (x, y). | |
Variables | |
| static int | failures = 0 |
| Count of failed assertions. | |
| #define ALLEGRO_UNSTABLE 1 |
Definition at line 41 of file ex_gui_slider_handle.c.
|
static |
Assert two values are equal to within a tolerance.
| label | What is being checked. |
| got | The value under test. |
| want | The expected value. |
Definition at line 75 of file ex_gui_slider_handle.c.
References failures, LOG_ERR, LOG_INFO, and n_log.
Referenced by main().
|
static |
|
static |
Check that a slider's handle is drawn whole wherever its value is.
| gui | The context. |
| id | The slider. |
| along | The widget's length along its own axis. |
| what | A name for the log lines. |
Definition at line 108 of file ex_gui_slider_handle.c.
References expect_true(), failures, gui, LOG_ERR, n_gui_slider_handle_pos(), n_gui_slider_set_value(), and n_log.
Referenced by main().
| int main | ( | void | ) |
Definition at line 134 of file ex_gui_slider_handle.c.
References expect_near(), expect_true(), failures, font, gui, handle_stays_inside(), LOG_ERR, LOG_NOTICE, mouse_event(), n_gui_add_label(), n_gui_add_slider(), n_gui_add_vslider(), n_gui_add_window(), N_GUI_ALIGN_LEFT, 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_value(), n_gui_slider_handle_pos(), n_gui_slider_set_value(), N_GUI_SLIDER_VALUE, N_GUI_WIN_FRAMELESS, n_gui_window_set_flags(), n_log, and set_log_level().
|
static |
Build a mouse event at (x, y).
| type | The ALLEGRO_EVENT_MOUSE_* type. |
| x | Cursor x. |
| y | Cursor y. |
Definition at line 91 of file ex_gui_slider_handle.c.
References type().
|
static |
Count of failed assertions.
Definition at line 53 of file ex_gui_slider_handle.c.