Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0008957: add missing vertical scrollbar functions to gui memo element #248

Merged
merged 3 commits into from Jul 22, 2018
Merged

0008957: add missing vertical scrollbar functions to gui memo element #248

merged 3 commits into from Jul 22, 2018

Conversation

patrikjuvonen
Copy link
Contributor

@patrikjuvonen patrikjuvonen commented Jul 22, 2018

Mantis Bug Tracker issue:
8957

Summary:

  • Added guiMemoSetVerticalScrollPosition and guiMemoGetVerticalScrollPosition;
  • guiMemoSetVerticalScrollPosition takes in a float between 0 and 100;
  • guiMemoGetVerticalScrollPosition returns a float between 0 and 100;
  • Pretty small and simple addition, easy to test.

Note about guiMemoGetMaxVerticalScrollPosition (1a8dc0e):

  • Was about to add guiMemoGetMaxVerticalScrollPosition, which would return (document size - page size). However, @qaisjp and I ended up thinking it is unnecessary for now. If we ever want to implement it, the code is ready in 1a8dc0e.

@patrikjuvonen
Copy link
Contributor Author

Well, I could've named the commit better by adding memo to it, but oh well...

@@ -320,9 +322,15 @@ void CLuaGUIDefs::AddGuiMemoClass(lua_State* luaVM)
lua_classfunction(luaVM, "setCaretIndex", "guiMemoSetCaretIndex");
lua_classfunction(luaVM, "setReadOnly", "guiMemoSetReadOnly");

lua_classfunction(luaVM, "getVerticalScrollPosition", "guiMemoGetVerticalScrollPosition");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line should sit with getCaretIndex

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Done.

@@ -320,9 +322,15 @@ void CLuaGUIDefs::AddGuiMemoClass(lua_State* luaVM)
lua_classfunction(luaVM, "setCaretIndex", "guiMemoSetCaretIndex");
lua_classfunction(luaVM, "setReadOnly", "guiMemoSetReadOnly");

lua_classfunction(luaVM, "getVerticalScrollPosition", "guiMemoGetVerticalScrollPosition");

lua_classfunction(luaVM, "setVerticalScrollPosition", "guiMemoSetVerticalScrollPosition");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line should sit with setCaretIndex

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Done.

@qaisjp qaisjp merged commit 14cf976 into multitheftauto:master Jul 22, 2018
jushar pushed a commit that referenced this pull request Jul 22, 2018
@patrikjuvonen patrikjuvonen added the enhancement New feature or request label Aug 7, 2018
@patrikjuvonen patrikjuvonen added this to In progress in release/v1.5.6 via automation Aug 7, 2018
@patrikjuvonen patrikjuvonen added this to the 1.5.6 milestone Aug 7, 2018
@patrikjuvonen patrikjuvonen moved this from In progress to Done in release/v1.5.6 Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants