Difference between revisions of "Lua:Class:MemoryView"

From Cheat Engine
Jump to navigation Jump to search
(Created page with "Category:Lua '''MemoryView Class''' (Inheritance ''Form''-> ''ScrollingWinControl''->''Lua:Class:CustomControl...")
 
(Major overhaul of the post.)
 
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''MemoryView Class''' (Inheritance ''[[Lua:Class:Form|Form]]''-> ''[[Lua:Class:ScrollingWinControl|ScrollingWinControl]]''->''[[Lua:Class:CustomControl|CustomControl]]''->''[[Lua:Class:WinControl|WinControl]]''->''[[Lua:Class:Control|Control]]''->''[[Lua:Class:Component|Component]]''->''[[Lua:Class:Object|Object]]'')
+
{{Class|'''class''' Memoryview ''':''' Form}}
  
The MemoryView class is a window/form
+
The Memoryview class represents a memory viewer window.
  
'''getMemoryViewForm'''()
+
A new memory viewer window can be created with [[Lua:createMemoryView|createMemoryView]]. This created window will not receive debug events. To access the main memory viewer window, use [[Lua:getMemoryViewForm|getMemoryViewForm]].
Returns the main memoryview form class object which can be accessed using the Form_ class methods and the methods of the classes it inherits from. There can be multiple memory views, but this will only find the original/base
 
  
'''createMemoryView'''()
+
===Inheritance===
Creates a new memoryview window. This window will not receive debug events. Use getMemoryViewForm() function to get the main memoryview window
+
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Class
 +
!align="left"|Inherits From
 +
!style="width: 80%;background-color:white;" align="left"|Description
 +
|-
 +
|Memoryview
 +
|Form
 +
|Represents a memory viewer window.
 +
|-
 +
|Form
 +
|ScrollingWinControl
 +
|Base class for forms and windows.
 +
|-
 +
|ScrollingWinControl
 +
|CustomControl
 +
|Base class for controls with scrolling support.
 +
|-
 +
|CustomControl
 +
|WinControl
 +
|Base class for custom windowed controls.
 +
|-
 +
|WinControl
 +
|Control
 +
|Base class for controls that can receive focus and contain child controls.
 +
|-
 +
|Control
 +
|Component
 +
|Base class for visible GUI controls.
 +
|-
 +
|Component
 +
|Object
 +
|Base class for components.
 +
|-
 +
|Object
 +
|None
 +
|Base class for Lua-exposed objects.
 +
|}
  
 +
== Creation ==
 +
 +
{{CodeBox|'''function''' createMemoryView() ''':''' Memoryview}}
 +
 +
Creates a new memory viewer window.
 +
 +
The created memory viewer window will not receive debug events. Use [[Lua:getMemoryViewForm|getMemoryViewForm]] to get the main memory viewer window.
 +
 +
===Function Parameters===
 +
This function has no parameters.
 +
 +
===Returns===
 +
[[Lua:Class:MemoryView|MemoryView]] — The created memory viewer window.
  
 
== Properties ==
 
== Properties ==
; DisassemblerView
 
: The disassemblerview class of this memoryview object
 
 
; HexadecimalView
 
: The hexadecimalview class of this memoryview object
 
  
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Property
 +
!align="left"|Type
 +
!style="width: 80%;background-color:white;" align="left"|Description
 +
|-
 +
|DisassemblerView
 +
|[[Lua:Class:DisassemblerView|DisassemblerView]]
 +
|The disassembler view object of this memory viewer.
 +
|-
 +
|HexadecimalView
 +
|[[Lua:Class:HexadecimalView|HexadecimalView]]
 +
|The hexadecimal view object of this memory viewer.
 +
|}
  
 
== Methods ==
 
== Methods ==
  
 +
This class does not define additional methods.
  
 +
Inherited methods are available through [[Lua:Class:Form|Form]] and its parent classes.
  
 
== Examples ==
 
== Examples ==
  
 +
===Create a new Memoryview window===
 +
<syntaxhighlight lang="lua" line highlight="1">
 +
local memoryView = createMemoryView()
  
 +
memoryView.Caption = "Custom Memory Viewer"
 +
memoryView.show()
 +
</syntaxhighlight>
 +
 +
===Get the main Memoryview window===
 +
<syntaxhighlight lang="lua" line highlight="1">
 +
local memoryView = getMemoryViewForm()
 +
 +
print(memoryView.ClassName)
 +
</syntaxhighlight>
 +
 +
===Access the DisassemblerView===
 +
<syntaxhighlight lang="lua" line highlight="1,3">
 +
local memoryView = getMemoryViewForm()
 +
 +
local disassemblerView = memoryView.DisassemblerView
 +
 +
print(disassemblerView.ClassName)
 +
</syntaxhighlight>
 +
 +
===Access the HexadecimalView===
 +
<syntaxhighlight lang="lua" line highlight="1,3">
 +
local memoryView = getMemoryViewForm()
 +
 +
local hexadecimalView = memoryView.HexadecimalView
 +
 +
print(hexadecimalView.ClassName)
 +
</syntaxhighlight>
 +
 +
===Create a separate Memoryview and access its views===
 +
<syntaxhighlight lang="lua" line highlight="1,5,6">
 +
local memoryView = createMemoryView()
 +
 +
memoryView.Caption = "Secondary Memory Viewer"
 +
 +
local disassemblerView = memoryView.DisassemblerView
 +
local hexadecimalView = memoryView.HexadecimalView
 +
 +
print(disassemblerView.ClassName)
 +
print(hexadecimalView.ClassName)
 +
 +
memoryView.show()
 +
</syntaxhighlight>
 +
 +
===Use the main Memoryview safely===
 +
<syntaxhighlight lang="lua" line highlight="1">
 +
local memoryView = getMemoryViewForm()
 +
 +
if memoryView ~= nil then
 +
  print("Main memory viewer: " .. tostring(memoryView.Caption))
 +
end
 +
</syntaxhighlight>
 +
 +
===Close a created Memoryview===
 +
<syntaxhighlight lang="lua" line highlight="1,7">
 +
local memoryView = createMemoryView()
 +
 +
memoryView.Caption = "Temporary Memory Viewer"
 +
memoryView.show()
 +
 +
-- Later:
 +
memoryView.destroy()
 +
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
 +
 +
{{Forms}}

Latest revision as of 19:52, 26 June 2026

{} Class

class Memoryview : Form

The Memoryview class represents a memory viewer window.

A new memory viewer window can be created with createMemoryView. This created window will not receive debug events. To access the main memory viewer window, use getMemoryViewForm.

Inheritance[edit]

Class Inherits From Description
Memoryview Form Represents a memory viewer window.
Form ScrollingWinControl Base class for forms and windows.
ScrollingWinControl CustomControl Base class for controls with scrolling support.
CustomControl WinControl Base class for custom windowed controls.
WinControl Control Base class for controls that can receive focus and contain child controls.
Control Component Base class for visible GUI controls.
Component Object Base class for components.
Object None Base class for Lua-exposed objects.

Creation[edit]

<> Lua API Reference

function createMemoryView() : Memoryview

Creates a new memory viewer window.

The created memory viewer window will not receive debug events. Use getMemoryViewForm to get the main memory viewer window.

Function Parameters[edit]

This function has no parameters.

Returns[edit]

MemoryView — The created memory viewer window.

Properties[edit]

Property Type Description
DisassemblerView DisassemblerView The disassembler view object of this memory viewer.
HexadecimalView HexadecimalView The hexadecimal view object of this memory viewer.

Methods[edit]

This class does not define additional methods.

Inherited methods are available through Form and its parent classes.

Examples[edit]

Create a new Memoryview window[edit]

1 local memoryView = createMemoryView()
2 
3 memoryView.Caption = "Custom Memory Viewer"
4 memoryView.show()

Get the main Memoryview window[edit]

1 local memoryView = getMemoryViewForm()
2 
3 print(memoryView.ClassName)

Access the DisassemblerView[edit]

1 local memoryView = getMemoryViewForm()
2 
3 local disassemblerView = memoryView.DisassemblerView
4 
5 print(disassemblerView.ClassName)

Access the HexadecimalView[edit]

1 local memoryView = getMemoryViewForm()
2 
3 local hexadecimalView = memoryView.HexadecimalView
4 
5 print(hexadecimalView.ClassName)

Create a separate Memoryview and access its views[edit]

 1 local memoryView = createMemoryView()
 2 
 3 memoryView.Caption = "Secondary Memory Viewer"
 4 
 5 local disassemblerView = memoryView.DisassemblerView
 6 local hexadecimalView = memoryView.HexadecimalView
 7 
 8 print(disassemblerView.ClassName)
 9 print(hexadecimalView.ClassName)
10 
11 memoryView.show()

Use the main Memoryview safely[edit]

1 local memoryView = getMemoryViewForm()
2 
3 if memoryView ~= nil then
4   print("Main memory viewer: " .. tostring(memoryView.Caption))
5 end

Close a created Memoryview[edit]

1 local memoryView = createMemoryView()
2 
3 memoryView.Caption = "Temporary Memory Viewer"
4 memoryView.show()
5 
6 -- Later:
7 memoryView.destroy()

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Form Related Classes