34#include <NDEVR/Dictionary.h>
35#include <NDEVR/ApplicationOptions.h>
36#include <NDEVR/String.h>
56 class NDEVR_WIDGETS_API
Keypad :
public QWidget
The equivelent of std::vector but with a bit more control.
A hash-based key-value store, useful for quick associative lookups.
Generic Settings for keypad including scales and when to show the keypad.
static bool IsKeypadInitialized()
Checks whether the global default keypad has been initialized.
QLineEdit * m_line_edit
The currently attached QLineEdit target.
bool isFullKeyboard() const
Checks whether the keypad is currently showing a full QWERTY keyboard.
void setCurrentInputHints(Qt::InputMethodHints hints)
Sets the input method hints that determine which keys are available.
void setupButton(Button *b, char insert_char, bool add_to_lookup=true)
Configures a button to insert a specific character when pressed.
void mousePressEvent(QMouseEvent *event) override
Handles mouse press events on the keypad.
void updateWindowTitle()
Updates the window title to reflect the current input context.
static Keypad * DefaultKeypad()
Returns the global default Keypad instance.
void focusPreviousWidget()
Moves focus to the previous widget in the tab order.
void onFocusObjectDeleted()
Slot called when the current focus object is destroyed.
Dictionary< String, Button * > m_symbols_b
Second page of symbol buttons.
bool m_is_folder
Whether the input context is a folder path.
void updateUppercase()
Updates the case state of keyboard letter buttons.
void updateCurrentText()
Updates the displayed text to match the current target widget content.
void focusInEvent(QFocusEvent *focus) override
Handles focus-in events for the keypad widget.
Buffer< Button * > m_buttons
All buttons on the keypad.
void updateFocusGroups()
Updates the focus chain groups for tab navigation.
void requestHideSignal()
Emitted to request that the keypad popup be hidden.
void setTextEdit(QTextEdit *line_edit)
Attaches the keypad to a QTextEdit for input.
void showSettings(PopupInfo info)
Shows the keypad settings dialog as a popup.
void setupButton(Button *b)
Configures a button with its default behavior.
bool m_is_file
Whether the input context is a file path.
String m_original_text
The original text before keypad editing began.
QSize minimumSizeHint() const override
Returns the minimum size hint for the keypad.
void setLineEdit(QLineEdit *line_edit)
Attaches the keypad to a QLineEdit for input.
bool m_is_full_keyboard
Whether the full QWERTY keyboard layout is active.
void setUpperCase(bool uppercase)
Sets whether the keypad displays uppercase characters.
void clear()
Clears the current input text.
void addChar(char value)
Appends a character to the current input.
void complete()
Accepts the current input and closes the keypad.
Qt::InputMethodHints m_input_hints
The current input method hints controlling available keys.
void requestPopupSignal()
Emitted to request that the keypad popup be shown.
void unsetCurrent()
Detaches the keypad from its current target widget.
void backspace()
Removes the last character from the current input.
KeypadSettings * m_keypad_settings
The keypad settings dialog.
QTextEdit * m_text_edit
The currently attached QTextEdit target.
void focusNextWidget()
Moves focus to the next widget in the tab order.
Ui::KeypadUI * ui
The auto-generated UI form.
QCustomLineEdit * editor() const
Returns the internal QCustomLineEdit used by the keypad for editing.
Keypad(QWidget *parent=nullptr)
Constructs a Keypad widget.
void requestPopupSlot()
Slot that triggers the keypad popup to appear.
Dictionary< String, Button * > m_symbols_a
First page of symbol buttons.
void slideInKeyboard(uint04 value)
Slides in a specific keyboard layout page.
QSize sizeHint() const override
Returns the preferred size hint for the keypad.
QTimer * m_visibility_check_timer
Timer that periodically checks whether the keypad should be visible.
QWidget * m_last_widget
The last widget that had keypad focus.
QWidget * lastWidget() const
Returns the last widget that had keypad focus.
void requestHideSlot()
Slot that triggers the keypad popup to hide.
QWidget * currentWidget() const
Returns the widget currently receiving keypad input.
Dictionary< char, Button * > m_button_ids
Mapping from characters to their corresponding buttons.
static bool IsCurrentKeypadFocus(const QWidget *widget)
Checks whether the given widget currently has keypad focus.
QString m_original_window_title
The original window title before keypad was shown.
String m_current_text
The current text being edited in the keypad.
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
The core String class for the NDEVR API.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...