![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#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 |
| #define | CB_H 30 |
| Where the combobox is and how tall one row of it is. | |
| #define | CB_W 200 |
| Where the combobox is and how tall one row of it is. | |
| #define | CB_X 10 |
| Where the combobox is and how tall one row of it is. | |
| #define | CB_Y 10 |
| Where the combobox is and how tall one row of it is. | |
| #define | ITEMS 9 |
| How many items: more than the six it shows. | |
Functions | |
| static void | click_at (N_GUI_CTX *gui, int x, int y) |
Move to (x, y) and click there. | |
| 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, int dz) |
Build a left-button mouse event at (x, y). | |
| static int | row_y (int row) |
| The screen y of the middle of one row of the open list. | |
| static int | wheel_then_click (N_GUI_CTX *gui, int cb, int row, int notches) |
| Open the list, turn the wheel over one row, then click that row. | |
Variables | |
| static int | failures = 0 |
| Count of failed assertions. | |
| #define ALLEGRO_UNSTABLE 1 |
Definition at line 41 of file ex_gui_combobox_wheel.c.
| #define CB_H 30 |
Where the combobox is and how tall one row of it is.
Definition at line 61 of file ex_gui_combobox_wheel.c.
Referenced by main(), row_y(), and wheel_then_click().
| #define CB_W 200 |
Where the combobox is and how tall one row of it is.
Definition at line 59 of file ex_gui_combobox_wheel.c.
Referenced by main(), and wheel_then_click().
| #define CB_X 10 |
Where the combobox is and how tall one row of it is.
Definition at line 55 of file ex_gui_combobox_wheel.c.
Referenced by main(), and wheel_then_click().
| #define CB_Y 10 |
Where the combobox is and how tall one row of it is.
Definition at line 57 of file ex_gui_combobox_wheel.c.
Referenced by main(), row_y(), and wheel_then_click().
| #define ITEMS 9 |
How many items: more than the six it shows.
Definition at line 64 of file ex_gui_combobox_wheel.c.
Referenced by main().
|
static |
Move to (x, y) and click there.
| gui | GUI context. |
| x | Cursor x. |
| y | Cursor y. |
Definition at line 105 of file ex_gui_combobox_wheel.c.
References gui, mouse_event(), and n_gui_process_event().
Referenced by main(), main(), and wheel_then_click().
|
static |
| int main | ( | void | ) |
Definition at line 140 of file ex_gui_combobox_wheel.c.
References CB_H, CB_W, CB_X, CB_Y, expect_true(), failures, font, gui, ITEMS, LOG_ERR, LOG_NOTICE, n_gui_add_combobox(), n_gui_add_window(), n_gui_combobox_add_item(), n_gui_combobox_set_selected(), n_gui_destroy_ctx(), n_gui_new_ctx(), n_gui_open_window(), n_gui_set_display_size(), N_GUI_WIN_FRAMELESS, n_gui_window_set_flags(), n_log, set_log_level(), and wheel_then_click().
|
static |
Build a left-button mouse event at (x, y).
| type | The ALLEGRO_EVENT_MOUSE_* type. |
| x | Cursor x. |
| y | Cursor y. |
| dz | Wheel notches, positive up. |
Definition at line 88 of file ex_gui_combobox_wheel.c.
References type().
Referenced by click_and_report(), click_at(), click_at(), drag_right(), main(), main(), move_to(), press_at(), and wheel_then_click().
|
static |
The screen y of the middle of one row of the open list.
| row | Row, 0 the top one shown. |
Definition at line 116 of file ex_gui_combobox_wheel.c.
References CB_H, CB_Y, and row().
Referenced by _popup_row_at(), n_gui_tree_draw_overlay(), and wheel_then_click().
|
static |
Open the list, turn the wheel over one row, then click that row.
| gui | GUI context. |
| cb | The combobox. |
| row | Which row the pointer rests on. |
| notches | Wheel notches, positive down the list. |
Definition at line 128 of file ex_gui_combobox_wheel.c.
References CB_H, CB_W, CB_X, CB_Y, click_at(), gui, mouse_event(), n_gui_combobox_get_selected(), n_gui_process_event(), row(), and row_y().
Referenced by main().
|
static |
Count of failed assertions.
Definition at line 52 of file ex_gui_combobox_wheel.c.