- Joined
- Jul 18, 2010
- Messages
- 2,377
This is the result of tests about Frame-Events and Frame-Levels.
FrameEvents
FRAMEEVENT_CONTROL_CLICK - when activading a Frame either by releasing the left mouse button (the original mouse click has to be inside the Button) or when a Frame has Focus and space or enter/return are pressed. This Event happens before FRAMEEVENT_MOUSE_UP.
FRAMEEVENT_MOUSE_ENTER - the mouse Cursor enters the frame
FRAMEEVENT_MOUSE_LEAVE - the mouse Cursor leaves the frame
FRAMEEVENT_MOUSE_UP - when releasing the left, right or wheel mouse button and the mouse cursor is currently inside the frame
FRAMEEVENT_MOUSE_DOWN - does nothing or no Frame accept it.
FRAMEEVENT_MOUSE_WHEEL - happens when the mouse is over the Frame and the Wheel is rolled. The direction of the rolling can be detected in the Event by checking BlzGetTriggerFrameValue
FRAMEEVENT_CHECKBOX_CHECKED - check an unchecked checkbox
FRAMEEVENT_CHECKBOX_UNCHECKED - uncheck a checked checkbox
FRAMEEVENT_EDITBOX_TEXT_CHANGED - remove or add text. By user or Code.
FRAMEEVENT_POPUPMENU_ITEM_CHANGED - user selected an Option in a popupmenu BlzGetTriggerFrameValue tells you which index.
FRAMEEVENT_MOUSE_DOUBLECLICK - does nothing or no Frame accept it.
FRAMEEVENT_SPRITE_ANIM_UPDATE - ?
FRAMEEVENT_SLIDER_VALUE_CHANGED - when altering the value of a slider or scrollbar. By user or Code.
FRAMEEVENT_DIALOG_CANCEL - When activading the cancel button of a Dialog
FRAMEEVENT_DIALOG_ACCEPT - When activading the accept button of a Dialog
FRAMEEVENT_EDITBOX_ENTER - Pressing enter/return when the Frame has Focus.
FRAMEEVENT_MOUSE_ENTER - the mouse Cursor enters the frame
FRAMEEVENT_MOUSE_LEAVE - the mouse Cursor leaves the frame
FRAMEEVENT_MOUSE_UP - when releasing the left, right or wheel mouse button and the mouse cursor is currently inside the frame
FRAMEEVENT_MOUSE_DOWN - does nothing or no Frame accept it.
FRAMEEVENT_MOUSE_WHEEL - happens when the mouse is over the Frame and the Wheel is rolled. The direction of the rolling can be detected in the Event by checking BlzGetTriggerFrameValue
+120 -> Forward
-120 -> Backwards
I would check for: bigger 0 or smaller 0-120 -> Backwards
FRAMEEVENT_CHECKBOX_CHECKED - check an unchecked checkbox
FRAMEEVENT_CHECKBOX_UNCHECKED - uncheck a checked checkbox
FRAMEEVENT_EDITBOX_TEXT_CHANGED - remove or add text. By user or Code.
FRAMEEVENT_POPUPMENU_ITEM_CHANGED - user selected an Option in a popupmenu BlzGetTriggerFrameValue tells you which index.
FRAMEEVENT_MOUSE_DOUBLECLICK - does nothing or no Frame accept it.
FRAMEEVENT_SPRITE_ANIM_UPDATE - ?
FRAMEEVENT_SLIDER_VALUE_CHANGED - when altering the value of a slider or scrollbar. By user or Code.
FRAMEEVENT_DIALOG_CANCEL - When activading the cancel button of a Dialog
FRAMEEVENT_DIALOG_ACCEPT - When activading the accept button of a Dialog
FRAMEEVENT_EDITBOX_ENTER - Pressing enter/return when the Frame has Focus.
FrameEvent Getters
JASS:
BlzGetTriggerFrame takes nothing returns framehandle
BlzGetTriggerFrameEvent takes nothing returns frameeventtype
BlzGetTriggerFrameValue takes nothing returns real
BlzGetTriggerFrameText takes nothing returns string
Frame Level
When multiple Frames are at the same space there is an rule that tells who will take the mouse Events and is displayed on top. FrameLevel set with BlzFrameSetLevel manages that, it only matters when Frames colide/overlap on the screen. Only visible Frames matter for the FrameLevel order.
FrameLevel works different for SimpleFrames and Frames.
For Frames:
FrameLevel define the order in which child-Frames are above their Parent. Frames only compete with their siblings. They are ordered descending. The childFrame with the highest Level is onTop. the one with the lowest Level is directly above the parent but below it's brothers and sisters. A Frame's children are below a sibling with a higher level.
For SimpleFrames:
The one with the highest Level is on Top parentship does not matter.
An example:
ButtonBA has a higher Level than ButtonBB hence he is on top of ButtonB.
ButtonBBA is a child of ButtonBB, but it's parent ButtonBB is lower then ButtonBA hence he is also lower than ButtonBA.
ButtonCA and ButtonCB have high levels but their parent ButtonC is the lowest in GAMEUI so they are also the lowest.
The onTop Total is ButtonBA.
The Frame ontop also takes all the mouse control.

SIMPLEBUTTON seems to be prioritized even against Frames with a higher Level.
In Warcraft 3 Versions 1.31.1 using BlzFrameSetLevel onto this FrameTypes crashes the game, there is no crash in V1.32.2.
BACKDROP
FRAME
HIGHLIGHT
MODEL
SPRITE
TEXT
TIMERTEXT
A SIMPLEFRAME with a FrameLevel of 2 or higher is displayed over unit lifebars and covers them, when created as child of GAME_UI.
FrameLevel works different for SimpleFrames and Frames.
For Frames:
FrameLevel define the order in which child-Frames are above their Parent. Frames only compete with their siblings. They are ordered descending. The childFrame with the highest Level is onTop. the one with the lowest Level is directly above the parent but below it's brothers and sisters. A Frame's children are below a sibling with a higher level.
For SimpleFrames:
The one with the highest Level is on Top parentship does not matter.
An example:
ButtonA child of GAMEUI Level 2
ButtonB child of GAMEUI Level 3
ButtonC child of GAMEUI Level 1
ButtonAA child of ButtonA Level 1
ButtonAB child of ButtonA Level 5
ButtonBA child of ButtonB Level 3
ButtonBB child of ButtonB Level 1
ButtonBBA child of ButtonBB Level 6
ButtonCA child of ButtonC Level 8
ButtonCB child of ButtonC Level 7
on top of GAMEUI is ButtonB, he has the highest Level of GAMEUI.ButtonB child of GAMEUI Level 3
ButtonC child of GAMEUI Level 1
ButtonAA child of ButtonA Level 1
ButtonAB child of ButtonA Level 5
ButtonBA child of ButtonB Level 3
ButtonBB child of ButtonB Level 1
ButtonBBA child of ButtonBB Level 6
ButtonCA child of ButtonC Level 8
ButtonCB child of ButtonC Level 7
ButtonBA has a higher Level than ButtonBB hence he is on top of ButtonB.
ButtonBBA is a child of ButtonBB, but it's parent ButtonBB is lower then ButtonBA hence he is also lower than ButtonBA.
ButtonCA and ButtonCB have high levels but their parent ButtonC is the lowest in GAMEUI so they are also the lowest.
The onTop Total is ButtonBA.
The Frame ontop also takes all the mouse control.

Lua:
do
local real = MarkGameStarted
function MarkGameStarted()
real()
local parent = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0)
--local parent = BlzGetFrameByName("EscMenuMainPanel", 0)
local buttonA = BlzCreateFrameByType("GLUETEXTBUTTON", "A", parent, "ScriptDialogButton", 0)
local buttonB = BlzCreateFrameByType("GLUETEXTBUTTON", "B", parent, "ScriptDialogButton", 0)
local buttonC = BlzCreateFrameByType("GLUETEXTBUTTON", "C", parent, "ScriptDialogButton", 0)
local buttonAA = BlzCreateFrameByType("GLUETEXTBUTTON", "AA", buttonA, "ScriptDialogButton", 0)
local buttonAB = BlzCreateFrameByType("GLUETEXTBUTTON", "AB", buttonA, "ScriptDialogButton", 0)
local buttonBA = BlzCreateFrameByType("GLUETEXTBUTTON", "BA", buttonB, "ScriptDialogButton", 0)
local buttonBB = BlzCreateFrameByType("GLUETEXTBUTTON", "BB", buttonB, "ScriptDialogButton", 0)
local buttonBBA = BlzCreateFrameByType("GLUETEXTBUTTON", "BBA", buttonBB, "ScriptDialogButton", 0)
local buttonCA = BlzCreateFrameByType("GLUETEXTBUTTON", "CA", buttonC, "ScriptDialogButton", 0)
local buttonCB = BlzCreateFrameByType("GLUETEXTBUTTON", "CB", buttonC, "ScriptDialogButton", 0)
BlzFrameSetLevel(buttonA, 2)
BlzFrameSetLevel(buttonB, 3)
BlzFrameSetLevel(buttonC, 1)
BlzFrameSetLevel(buttonAA, 1)
BlzFrameSetLevel(buttonAB, 5)
BlzFrameSetLevel(buttonBA, 3)
BlzFrameSetLevel(buttonBB, 1)
BlzFrameSetLevel(buttonBBA, 6)
BlzFrameSetLevel(buttonCB, 8)
BlzFrameSetLevel(buttonCA, 7)
BlzFrameSetText(buttonA, "A")
BlzFrameSetText(buttonB, "B")
BlzFrameSetText(buttonC, "C")
BlzFrameSetText(buttonAA, "AA")
BlzFrameSetText(buttonAB, "AB")
BlzFrameSetText(buttonBA, "BA")
BlzFrameSetText(buttonBB, "BB")
BlzFrameSetText(buttonCA, "CA")
BlzFrameSetText(buttonCB, "CB")
BlzFrameSetText(buttonBBA, "BBA")
BlzFrameSetAbsPoint(buttonC, FRAMEPOINT_CENTER, 0.24, 0.34)
BlzFrameSetAbsPoint(buttonCA, FRAMEPOINT_CENTER, 0.26, 0.36)
BlzFrameSetAbsPoint(buttonCB, FRAMEPOINT_CENTER, 0.28, 0.38)
BlzFrameSetAbsPoint(buttonA, FRAMEPOINT_CENTER, 0.3, 0.4)
BlzFrameSetAbsPoint(buttonAA, FRAMEPOINT_CENTER, 0.32, 0.42)
BlzFrameSetAbsPoint(buttonAB, FRAMEPOINT_CENTER, 0.34, 0.44)
BlzFrameSetAbsPoint(buttonB, FRAMEPOINT_CENTER, 0.36, 0.46)
BlzFrameSetAbsPoint(buttonBB, FRAMEPOINT_CENTER, 0.38, 0.48)
BlzFrameSetAbsPoint(buttonBBA, FRAMEPOINT_CENTER, 0.4, 0.5)
BlzFrameSetAbsPoint(buttonBA, FRAMEPOINT_CENTER, 0.42, 0.52)
end
end
SIMPLEBUTTON seems to be prioritized even against Frames with a higher Level.
In Warcraft 3 Versions 1.31.1 using BlzFrameSetLevel onto this FrameTypes crashes the game, there is no crash in V1.32.2.
BACKDROP
FRAME
HIGHLIGHT
MODEL
SPRITE
TEXT
TIMERTEXT
A SIMPLEFRAME with a FrameLevel of 2 or higher is displayed over unit lifebars and covers them, when created as child of GAME_UI.
FrameTypes
Which FrameTypes can have which frameevents?
BACKDROP
Test Code for FrameLevel Tests.
BACKDROP
None
BUTTONCONTROL_CLICK, MOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL
CHATDISPLAYMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL (CONTROL_CLICK with BlzFrameClick)
CHECKBOXMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL, CHECKBOX_CHECKED, CHECKBOX_UNCHECKED (CONTROL_CLICK with BlzFrameClick)
CONTROLMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP
DIALOGDIALOG_CANCEL, DIALOG_ACCEPT
EDITBOXMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL, EDITBOX_TEXT_CHANGED, EDITBOX_ENTER (CONTROL_CLICK with BlzFrameClick)
FRAMENone, (Blocks previous created Frames of Level 0)
GLUEBUTTONCONTROL_CLICK, MOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL
GLUECHECKBOXMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL, CHECKBOX_CHECKED, CHECKBOX_UNCHECKED (CONTROL_CLICK with BlzFrameClick)
GLUEEDITBOXMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL, EDITBOX_TEXT_CHANGED, EDITBOX_ENTER (CONTROL_CLICK with BlzFrameClick)
GLUEPOPUPMENUMOUSE_ENTER, MOUSE_LEAVE, MOUSE_WHEEL, CONTROL_CLICK, POPUPMENU_ITEM_CHANGED
GLUETEXTBUTTONCONTROL_CLICK, MOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL
HIGHLIGHTNone
LISTBOXMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL
MENUMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL
MODELMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL (CONTROL_CLICK with BlzFrameClick)
(Only in the screen space taken, this has nothing to do with the visual part)
POPUPMENU(Only in the screen space taken, this has nothing to do with the visual part)
MOUSE_ENTER, MOUSE_LEAVE, MOUSE_WHEEL, CONTROL_CLICK, POPUPMENU_ITEM_CHANGED
SCROLLBARMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL, SLIDER_VALUE_CHANGED
SIMPLEBUTTONCONTROL_CLICK
SIMPLECHECKBOXNone
SIMPLEFRAMENone
SIMPLESTATUSBARNone
SLASHCHATBOXMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL, EDITBOX_TEXT_CHANGED, EDITBOX_ENTER (CONTROL_CLICK with BlzFrameClick)
SLIDERMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL, SLIDER_VALUE_CHANGED (CONTROL_CLICK with BlzFrameClick)
SPRITENone
TEXTCONTROL_CLICK, MOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL
TEXTAREAMOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL
TEXTBUTTONCONTROL_CLICK, MOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL
TIMERTEXTCONTROL_CLICK, MOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_WHEEL
Test Code for FrameLevel Tests.
Lua:
do
local real = MarkGameStarted
function MarkGameStarted()
real()
local frameA = BlzCreateFrame("DebugButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
local frameAChild = BlzCreateFrame("DebugButton", frameA, 0, 0)
local frameB = BlzCreateFrame("DebugButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
BlzFrameSetAbsPoint(frameA, FRAMEPOINT_CENTER, 0.4, 0.3)
BlzFrameSetAbsPoint(frameAChild, FRAMEPOINT_CENTER, 0.4, 0.3)
BlzFrameSetAbsPoint(frameB, FRAMEPOINT_CENTER, 0.4, 0.3)
BlzFrameSetLevel(frameA, 0)
BlzFrameSetLevel(frameB, 0)
BlzFrameSetLevel(frameAChild, 0)
for index = 1, 16, 1 do
local trigger = CreateTrigger()
BlzTriggerRegisterFrameEvent(trigger, frameA, ConvertFrameEventType(index))
BlzTriggerRegisterFrameEvent(trigger, frameAChild, ConvertFrameEventType(index))
BlzTriggerRegisterFrameEvent(trigger, frameB, ConvertFrameEventType(index))
TriggerAddAction(trigger, function()
if BlzGetTriggerFrame() == frameA then
print("frameA")
elseif BlzGetTriggerFrame() == frameB then
print("frameB")
else
print("frameAChild")
end
print("Event",index)
print("TriggerValue", BlzGetTriggerFrameValue())
print("TriggerText", BlzGetTriggerFrameText())
end)
end
BlzFrameSetText(frameA, "frameA")
BlzFrameSetText(frameB, "frameB")
BlzFrameSetText(frameAChild, "frameAChild")
end
end
Other UI-Frame Tutorials
The following links might provide more insight into this subject.
UI: Change Lumber Text
[JASS/AI] - UI: Create a TextButton
[JASS/AI] - UI: Positionate Frames (important)
UI: toc-Files
UI: Reading a FDF
UI - The concept of Parent-Frames
[JASS/AI] - UI: FrameEvents and FrameTypes
UI: Frames and Tooltips
[JASS/AI] - UI: Creating a Bar
UI - Simpleframes
UI: What are BACKDROPs?
UI: GLUEBUTTON
UI: TEXTAREA the scrolling Text Frame
UI: EditBox - Text Input
[JASS/AI] - UI: Creating a Cam control
UI: Showing 3 Multiboards
UI: OriginFrames
Default Names for BlzGetFrameByName (Access to Existing game-Frames)
[JASS/AI] - UI: List - Default MainFrames (built in CreateAble)
UI: Change Lumber Text
[JASS/AI] - UI: Create a TextButton
[JASS/AI] - UI: Positionate Frames (important)
UI: toc-Files
UI: Reading a FDF
UI - The concept of Parent-Frames
[JASS/AI] - UI: FrameEvents and FrameTypes
UI: Frames and Tooltips
[JASS/AI] - UI: Creating a Bar
UI - Simpleframes
UI: What are BACKDROPs?
UI: GLUEBUTTON
UI: TEXTAREA the scrolling Text Frame
UI: EditBox - Text Input
[JASS/AI] - UI: Creating a Cam control
UI: Showing 3 Multiboards
UI: OriginFrames
Default Names for BlzGetFrameByName (Access to Existing game-Frames)
[JASS/AI] - UI: List - Default MainFrames (built in CreateAble)
Last edited by a moderator: