GuiMemoSetVerticalScrollPosition: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Add missing OOP info)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{client function}}
{{client function}}
<!--
{{New feature/item|3.0156|1.5.5|13771|This function is used to set the vertical scroll position of a memo as a percentage.}}
{{New feature/item|3.0156|1.5.5|12419|This function is used to set the vertical scroll position of a memo as a percentage.}}
-->
This function is used to set the vertical scroll position of a memo as a percentage.


==Syntax==
==Syntax==
Line 9: Line 6:
bool guiMemoSetVerticalScrollPosition ( gui-memo theMemo, float position )
bool guiMemoSetVerticalScrollPosition ( gui-memo theMemo, float position )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[GuiMemo]]:setVerticalScrollPosition|verticalScrollPosition|guiMemoGetVerticalScrollPosition}}


===Required Arguments===
===Required Arguments===
*'''theMemo''': the [[guiCreateMemo|memo]] you want to change the vertical scroll position of.
*'''theMemo''': the [[guiCreateMemo|memo]] you want to change the vertical scroll position of.
*'''position''': a [[float]] ranging from 0-100.
*'''position''': a [[float]] ranging between 0 and 100.


===Returns===
===Returns===

Latest revision as of 13:57, 10 August 2021

This function is used to set the vertical scroll position of a memo as a percentage.

Syntax

bool guiMemoSetVerticalScrollPosition ( gui-memo theMemo, float position )

OOP Syntax Help! I don't understand this!

Method: GuiMemo:setVerticalScrollPosition(...)
Variable: .verticalScrollPosition
Counterpart: guiMemoGetVerticalScrollPosition


Required Arguments

  • theMemo: the memo you want to change the vertical scroll position of.
  • position: a float ranging between 0 and 100.

Returns

Returns true if the position was set, false otherwise.

Example

This example sets the position of a memo called "theMemo" created with guiCreateMemo, and outputs it to the chatbox.

local theMemo = guiCreateMemo( 0, 0, 200, 100, [[Insert
some
long
text
here]], false )

if ( theMemo ) then
    guiMemoSetVerticalScrollPosition( theMemo, 33.3 ) -- A third from the top
    local position = guiMemoGetVerticalScrollPosition( theMemo )
    outputChatBox( "Current position of scroll pane: " .. position .. "%" )
else
    outputChatBox( "Memo not found!" )
end

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI