Skip to content

Commit

Permalink
Expose ElementDocument::FindNextTabElement publicly
Browse files Browse the repository at this point in the history
  • Loading branch information
mikke89 committed Dec 8, 2024
1 parent c039669 commit bc19971
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Include/RmlUi/Core/ElementDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,28 +121,31 @@ class RMLUICORE_API ElementDocument : public Element {
/// @return True if the document is hogging focus.
bool IsModal() const;

/// Load a inline script into the document. Note that the base implementation does nothing, scripting language addons hook
/// this method.
/// Finds the next tabbable element in the document tree, starting at the given element, possibly wrapping around the document.
/// @param[in] current_element The element to start from.
/// @param[in] forward True to search forward, false to search backward.
/// @return The next tabbable element, or nullptr if none could be found.
Element* FindNextTabElement(Element* current_element, bool forward);

/// Loads an inline script into the document. Note that the base implementation does nothing, scripting language addons hook this method.
/// @param[in] content The script content.
/// @param[in] source_path Path of the script the source comes from, useful for debug information.
/// @param[in] source_line Line of the script the source comes from, useful for debug information.
virtual void LoadInlineScript(const String& content, const String& source_path, int source_line);

/// Load a external script into the document. Note that the base implementation does nothing, scripting language addons hook
/// this method.
/// Loads an external script into the document. Note that the base implementation does nothing, scripting language addons hook this method.
/// @param[in] source_path The script file path.
virtual void LoadExternalScript(const String& source_path);

/// Updates the document, including its layout. Users must call this manually before requesting information such as
/// size or position of an element if any element in the document was recently changed, unless Context::Update has
/// already been called after the change. This has a perfomance penalty, only call when necessary.
/// already been called after the change. This has a performance penalty, only call when necessary.
void UpdateDocument();

protected:
/// Repositions the document if necessary.
void OnPropertyChange(const PropertyIdSet& changed_properties) override;

/// Processes the 'onpropertychange' event, checking for a change in position or size.
/// Processes any events specially handled by the document.
void ProcessDefaultAction(Event& event) override;

/// Called during update if the element size has been changed.
Expand All @@ -154,9 +157,7 @@ class RMLUICORE_API ElementDocument : public Element {
void SetFocusableFromModal(bool focusable);

private:
/// Find the next element to focus, starting at the current element
Element* FindNextTabElement(Element* current_element, bool forward);
/// Searches forwards or backwards for a focusable element in the given substree
/// Searches forwards or backwards for a focusable element in the given subtree.
Element* SearchFocusSubtree(Element* element, bool forward);
/// Find the next element to navigate to, starting at the current element.
Element* FindNextNavigationElement(Element* current_element, NavigationSearchDirection direction, const Property& property);
Expand Down

0 comments on commit bc19971

Please sign in to comment.