OpenCPN Partial API docs
Loading...
Searching...
No Matches
ui_utils.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2025 NoCodeHummel *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 **************************************************************************/
19
24#include <wx/window.h>
25#include <wx/scrolwin.h>
26#include <wx/event.h>
27
28// Declare custom events
29wxDECLARE_EVENT(EVT_LAYOUT_RESIZE, wxCommandEvent);
30
34namespace GUI {
35
36// Screen breakpoints.
37enum class Breakpoint : int {
38 kExtraSmall = 1, // extra small
39 kSmall = 480, // small
40 kMedium = 767, // medium
41 kLarge = 1024, // large
42 kExtraLarge = 1440 // extra large
43};
44
49static const int kSpacing = 6;
50
58int GetSpacing(wxWindow* ctx, int factor);
59
64void LayoutResizeEvent(wxWindow* ctx);
65
71Breakpoint GetScreenSize(wxRect* rect);
72} // namespace GUI
Organizes constant variables and methods.
Definition ui_utils.h:34
void LayoutResizeEvent(wxWindow *ctx)
Trigger window layout event.
int GetSpacing(wxWindow *ctx, int factor)
Multiply default spacing with a factor, and calculate device independent pixels.
Breakpoint GetScreenSize(wxRect *rect)
Get screen size breakpoint.