Skip to content

Commit

Permalink
📦 v0.2.9
Browse files Browse the repository at this point in the history
ADDED:
* Added a new widget: ItemSelector.
* Added a new Medium option for the ItemSelector.
* Implemented dynamic cursors. (ARROW, HAND, IBEAM, PIPETTE, MOVE)
* Added 3 return states for the KeyBinder: HOLD, CLICK and TOGGLE. (You can select the default style by using the Style function of the builder pattern. (See: KEY_BINDER_STYLE struct)
The KeyBinder default style (behavior) will be set to HOLD.)
* Now you can toggle CheckBoxes by clicking on it's title.
* Added a new widget flag: DRAW_FIRST. (Every widget with this flag, will be drawned before all others.)
* Added a new widget flag exclusively for Containers: LIMIT. (This flag will clamp the Container position to the viewport boundaries.)
* Added options to check for specific widgets status. (HOVERED, etc)

CHANGED:
* Improved focusing system.
* Removed ColorList widget.
* Improved CheckBox behavior.
* Improved ColorPicker behavior.
* Improved KeyBinder behavior.
* Improved ComboBox behavior.
* Improved TextBox behavior.
* Improved Slider behavior.
* Improved MultiBox behavior.
* Improved ListBox behavior.
* Improved Container behavior.
* Improved the behavior of some internal functions.
* Improved the behavior of the builder pattern.
* Partially fixed a bug with ColorPickers being drawned behind other GroupBoxes.
  • Loading branch information
otvv committed Sep 20, 2020
1 parent 50b592c commit d0d80ba
Show file tree
Hide file tree
Showing 35 changed files with 1,501 additions and 1,247 deletions.
2 changes: 1 addition & 1 deletion FGUI/FGUI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// widgets
#include "widgets/button.hpp"
#include "widgets/checkbox.hpp"
#include "widgets/colorlist.hpp"
#include "widgets/colorpicker.hpp"
#include "widgets/combobox.hpp"
#include "widgets/container.hpp"
#include "widgets/itemselector.hpp"
#include "widgets/keybinder.hpp"
#include "widgets/label.hpp"
#include "widgets/listbox.hpp"
Expand Down
2 changes: 1 addition & 1 deletion FGUI/internal/aliases.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace FGUI
pIsCursorInArea IsCursorInArea;

// @brief: set the input type
// @params: FGUI::INPUT_TYPE = input type (NONE, WIN_32, INPUT_SYSTEM or CUSTOM)
// @args: FGUI::INPUT_TYPE = input type (NONE, WIN_32, INPUT_SYSTEM or CUSTOM)
// @note: make sure to set this when you initialize your widgets
void SetInputType(FGUI::INPUT_TYPE type)
{
Expand Down
37 changes: 26 additions & 11 deletions FGUI/internal/definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ namespace FGUI
"S", "T", "U", "V", "W", "X", "Y", "Z", "NUM0",
"NUM1", "NUM2", "NUM3", "NUM4", "NUM5", "NUM6", "NUM7",
"NUM8", "NUM9", "/", "*", "-", "+", "NUMENTER", ",", "[",
"]", "Ç", "'", "´", ",", ".", "/", "\\", "-", "=",
"ENTER", "SPACE", "BACKSPACE", "TAB", "CAPSLOCK", "NUMLCK", "ESCAPE",
"SCRLK", "INSERT", "DELETE", "HOME", "END", "PAGE UP", "PAGE DOWN",
"]", "; (Ç)", "'", "´", ",", ".", "/", "\\", "-", "=",
"ENTER", "SPACE", "BACKSPACE", "TAB", "CAPSLOCK", "NUMLOCK", "ESCAPE",
"SCROLL", "INSERT", "DELETE", "HOME", "END", "PAGEUP", "PAGEDOWN",
"PAUSE", "LSHIFT", "RSHIFT", "ALT", "RALT", "LCONTROL",
"RCONTROL", "LWIN", "RWIN", "APP", "UP", "LEFT", "DOWN",
"RIGHT", "F1", "F2", "F3", "F4", "F5", "F6", "F7",
Expand All @@ -179,7 +179,7 @@ namespace FGUI
const std::string_view m_strVirtualKeyCodes[223] = { "INVALID", "MOUSE1", "MOUSE2", "", "MOUSE3", "MOUSE4", "MOUSE5", "",
"BACKSPACE", "TAB", "", "", "", "ENTER", "", "", "SHIFT", "CONTROL", "ALT",
"PAUSE", "CAPSLOCK", "", "", "", "", "", "", "ESC", "", "", "", "",
"SPACE", "PAGE UP", "PAGE DOWN", "END", "HOME", "LEFT", "UP", "RIGHT",
"SPACE", "PAGEUP", "PAGEDOWN", "END", "HOME", "LEFT", "UP", "RIGHT",
"DOWN", "", "", "", "", "INS", "DEL", "", "0", "1", "2", "3",
"4", "5", "6", "7", "8", "9", "", "", "", "", "", "", "", "A",
"B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
Expand All @@ -188,12 +188,15 @@ namespace FGUI
"NUM6", "NUM7", "NUM8", "NUM9", "*", "+", "_", "-", ".", "/", "F1",
"F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "SCROLL LOCK", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "SCROLL", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "LSHIFT", "RSHIFT", "LCONTROL", "RCONTROL", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", ";", "+", ",", "-", ".", "/?", "~", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "{", "\\", "}", "/" };

// Custom Key Codes
const std::string_view m_strCustomKeyCodes[256] = { "MAP YOUR KEYS HERE", "MAP YOUR KEYS HERE" };
};

using KEY_STRINGS = struct SKeyStrings_t
Expand Down Expand Up @@ -233,15 +236,18 @@ namespace FGUI
"", "", "", ";", "+", ",", "-", ".", "/?", "~", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "{", "\\", "}", "/" };

// Custom Key Codes
const std::string_view m_strCustomKeyCodes[256] = { "MAP YOUR KEYS HERE", "MAP YOUR KEYS HERE" };
};

using WIDGET_TYPE = enum struct ESWidgetType_t : int {
BUTTON = 0,
CHECKBOX,
COLORLIST,
COLORPICKER,
COMBOBOX,
CONTAINER,
ITEMSELECTOR,
KEYBINDER,
LABEL,
LISTBOX,
Expand All @@ -252,12 +258,21 @@ namespace FGUI
};

using WIDGET_FLAG = enum struct ESWidgetFlag_t : int {
DRAWABLE = 0x1,
CLICKABLE = 0x2,
SAVABLE = 0x4,
FOCUSABLE = 0x8,
DRAW_FIRST = 0x1,
DRAWABLE = 0x2,
CLICKABLE = 0x4,
SAVABLE = 0x8,
FOCUSABLE = 0x10,

FULLSCREEN = 0x20, // this is exclusively for window Containers
LIMIT = 0x40 // this is exclusively for window Containers
};

using WIDGET_STATUS = enum struct ESWidgetState_t : int {
NONE = 0,
HOVERED

FULLSCREEN = 0x20 // this is exclusively for window containers
// TODO: add more status flags
};

} // namespace FGUI
Expand Down
9 changes: 8 additions & 1 deletion FGUI/internal/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

// This is used to supress unused variable warnings
template <typename T>
inline void IGNORE_ARG(T&&) {};
inline void IGNORE_ARGS(T&&, ...) {};

#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
// These keys defaults to virtual key-codes from the Windows API (GetAsyncKeyState)
#define MOUSE_1 1
#define MOUSE_2 2
#define KEY_ESCAPE 27
#define KEY_ENTER 13
#define KEY_BACKSPACE 8
Expand All @@ -22,6 +23,8 @@ inline void IGNORE_ARG(T&&) {};
#define KEY_DELETE 46
#define KEY_LEFT 37
#define KEY_RIGHT 39
#define KEY_UP 38
#define KEY_DOWN 40
#define KEY_PAGEUP 33
#define KEY_PAGEDOWN 34
#define KEY_LCONTROL 162
Expand All @@ -31,7 +34,9 @@ inline void IGNORE_ARG(T&&) {};

#else
// These keys defaults to virtual key-codes from Source Engine (IInputSystem)
// but you can change to whatever you want.
#define MOUSE_1 107
#define MOUSE_2 108
#define KEY_ESCAPE 70
#define KEY_ENTER 64
#define KEY_BACKSPACE 66
Expand All @@ -40,6 +45,8 @@ inline void IGNORE_ARG(T&&) {};
#define KEY_DELETE 73
#define KEY_LEFT 89
#define KEY_RIGHT 91
#define KEY_UP 88
#define KEY_DOWN 90
#define KEY_PAGEUP 76
#define KEY_PAGEDOWN 77
#define KEY_LCONTROL 83
Expand Down
Loading

0 comments on commit d0d80ba

Please sign in to comment.