• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] "Added Custom User Interface functions to allow map makers to add, remove, and adjust UI frames"

Status
Not open for further replies.
Level 3
Joined
Feb 25, 2018
Messages
15
(sorry, I posted this to the wrong section earlier)

This line from the ptr patch notes particularly took my attention.

we've been given the following natives to play with in JASS, but how do we even use them?;


constant originframetype ORIGIN_FRAME_GAME_UI = ConvertOriginFrameType(0)
constant originframetype ORIGIN_FRAME_COMMAND_BUTTON = ConvertOriginFrameType(1)
constant originframetype ORIGIN_FRAME_HERO_BAR = ConvertOriginFrameType(2)
constant originframetype ORIGIN_FRAME_HERO_BUTTON = ConvertOriginFrameType(3)
constant originframetype ORIGIN_FRAME_HERO_HP_BAR = ConvertOriginFrameType(4)
constant originframetype ORIGIN_FRAME_HERO_MANA_BAR = ConvertOriginFrameType(5)
constant originframetype ORIGIN_FRAME_HERO_BUTTON_INDICATOR = ConvertOriginFrameType(6)
constant originframetype ORIGIN_FRAME_ITEM_BUTTON = ConvertOriginFrameType(7)
constant originframetype ORIGIN_FRAME_MINIMAP = ConvertOriginFrameType(8)
constant originframetype ORIGIN_FRAME_MINIMAP_BUTTON = ConvertOriginFrameType(9)
constant originframetype ORIGIN_FRAME_SYSTEM_BUTTON = ConvertOriginFrameType(10)
constant originframetype ORIGIN_FRAME_TOOLTIP = ConvertOriginFrameType(11)
constant originframetype ORIGIN_FRAME_UBERTOOLTIP = ConvertOriginFrameType(12)
constant originframetype ORIGIN_FRAME_CHAT_MSG = ConvertOriginFrameType(13)
constant originframetype ORIGIN_FRAME_UNIT_MSG = ConvertOriginFrameType(14)
constant originframetype ORIGIN_FRAME_TOP_MSG = ConvertOriginFrameType(15)
constant originframetype ORIGIN_FRAME_PORTRAIT = ConvertOriginFrameType(16)
constant originframetype ORIGIN_FRAME_WORLD_FRAME = ConvertOriginFrameType(17)

constant framepointtype FRAMEPOINT_TOPLEFT = ConvertFramePointType(0)
constant framepointtype FRAMEPOINT_TOP = ConvertFramePointType(1)
constant framepointtype FRAMEPOINT_TOPRIGHT = ConvertFramePointType(2)
constant framepointtype FRAMEPOINT_LEFT = ConvertFramePointType(3)
constant framepointtype FRAMEPOINT_CENTER = ConvertFramePointType(4)
constant framepointtype FRAMEPOINT_RIGHT = ConvertFramePointType(5)
constant framepointtype FRAMEPOINT_BOTTOMLEFT = ConvertFramePointType(6)
constant framepointtype FRAMEPOINT_BOTTOM = ConvertFramePointType(7)
constant framepointtype FRAMEPOINT_BOTTOMRIGHT = ConvertFramePointType(8)

constant textaligntype TEXT_JUSTIFY_TOP = ConvertTextAlignType(0)
constant textaligntype TEXT_JUSTIFY_MIDDLE = ConvertTextAlignType(1)
constant textaligntype TEXT_JUSTIFY_BOTTOM = ConvertTextAlignType(2)
constant textaligntype TEXT_JUSTIFY_LEFT = ConvertTextAlignType(3)
constant textaligntype TEXT_JUSTIFY_CENTER = ConvertTextAlignType(4)
constant textaligntype TEXT_JUSTIFY_RIGHT = ConvertTextAlignType(5)

constant frameeventtype FRAMEEVENT_CONTROL_CLICK = ConvertFrameEventType(1)
constant frameeventtype FRAMEEVENT_MOUSE_ENTER = ConvertFrameEventType(2)
constant frameeventtype FRAMEEVENT_MOUSE_LEAVE = ConvertFrameEventType(3)
constant frameeventtype FRAMEEVENT_MOUSE_UP = ConvertFrameEventType(4)
constant frameeventtype FRAMEEVENT_MOUSE_DOWN = ConvertFrameEventType(5)
constant frameeventtype FRAMEEVENT_MOUSE_WHEEL = ConvertFrameEventType(6)
constant frameeventtype FRAMEEVENT_CHECKBOX_CHECKED = ConvertFrameEventType(7)
constant frameeventtype FRAMEEVENT_CHECKBOX_UNCHECKED = ConvertFrameEventType(8)
constant frameeventtype FRAMEEVENT_EDITBOX_TEXT_CHANGED = ConvertFrameEventType(9)
constant frameeventtype FRAMEEVENT_POPUPMENU_ITEM_CHANGED = ConvertFrameEventType(10)
constant frameeventtype FRAMEEVENT_MOUSE_DOUBLECLICK = ConvertFrameEventType(11)
constant frameeventtype FRAMEEVENT_SPRITE_ANIM_UPDATE = ConvertFrameEventType(12)
constant frameeventtype FRAMEEVENT_SLIDER_VALUE_CHANGED = ConvertFrameEventType(13)
constant frameeventtype FRAMEEVENT_DIALOG_CANCEL = ConvertFrameEventType(14)
constant frameeventtype FRAMEEVENT_DIALOG_ACCEPT = ConvertFrameEventType(15)
constant frameeventtype FRAMEEVENT_EDITBOX_ENTER = ConvertFrameEventType(16)
 
Level 7
Joined
Apr 17, 2017
Messages
316
You use them by creating frames or manipulating origin frames: The ones that you should be looking for:


native BlzGetOriginFrame takes originframetype frameType, integer index returns framehandle
native BlzEnableUIAutoPosition takes boolean enable returns nothing
native BlzHideOriginFrames takes boolean enable returns nothing
native BlzConvertColor takes integer a, integer r, integer g, integer b returns integer
native BlzLoadTOCFile takes string TOCFile returns boolean
native BlzCreateFrame takes string name, framehandle owner, integer priority, integer createContext returns framehandle
native BlzCreateSimpleFrame takes string name, framehandle owner, integer createContext returns framehandle
native BlzCreateFrameByType takes string typeName, string name, framehandle owner, string inherits, integer createContext returns framehandle
native BlzDestroyFrame takes framehandle frame returns nothing
native BlzFrameSetPoint takes framehandle frame, framepointtype point, framehandle relative, framepointtype relativePoint, real x, real y returns nothing
native BlzFrameSetAbsPoint takes framehandle frame, framepointtype point, real x, real y returns nothing
native BlzFrameClearAllPoints takes framehandle frame returns nothing
native BlzFrameSetAllPoints takes framehandle frame, framehandle relative returns nothing
native BlzFrameSetVisible takes framehandle frame, boolean visible returns nothing
native BlzFrameIsVisible takes framehandle frame returns boolean
native BlzGetFrameByName takes string name, integer createContext returns framehandle
native BlzFrameGetName takes framehandle frame returns string
native BlzFrameClick takes framehandle frame returns nothing
native BlzFrameSetText takes framehandle frame, string text returns nothing
native BlzFrameGetText takes framehandle frame returns string
native BlzFrameSetTextSizeLimit takes framehandle frame, integer size returns nothing
native BlzFrameGetTextSizeLimit takes framehandle frame returns integer
native BlzFrameSetTextColor takes framehandle frame, integer color returns nothing
native BlzFrameSetFocus takes framehandle frame, boolean flag returns nothing
native BlzFrameSetModel takes framehandle frame, string modelFile, integer cameraIndex returns nothing
native BlzFrameSetEnable takes framehandle frame, boolean enabled returns nothing
native BlzFrameGetEnable takes framehandle frame returns boolean
native BlzFrameSetAlpha takes framehandle frame, integer alpha returns nothing
native BlzFrameGetAlpha takes framehandle frame returns integer
native BlzFrameSetSpriteAnimate takes framehandle frame, integer primaryProp, integer flags returns nothing
native BlzFrameSetTexture takes framehandle frame, string texFile, integer flag, boolean blend returns nothing
native BlzFrameSetScale takes framehandle frame, real scale returns nothing
native BlzFrameSetTooltip takes framehandle frame, framehandle tooltip returns nothing
native BlzFrameCageMouse takes framehandle frame, boolean enable returns nothing
native BlzFrameSetValue takes framehandle frame, real value returns nothing
native BlzFrameGetValue takes framehandle frame returns real
native BlzFrameSetMinMaxValue takes framehandle frame, real minValue, real maxValue returns nothing
native BlzFrameSetStepSize takes framehandle frame, real stepSize returns nothing
native BlzFrameSetSize takes framehandle frame, real width, real height returns nothing
native BlzFrameSetVertexColor takes framehandle frame, integer color returns nothing
native BlzFrameSetLevel takes framehandle frame, integer level returns nothing
native BlzFrameSetParent takes framehandle frame, framehandle parent returns nothing
native BlzFrameGetParent takes framehandle frame returns framehandle
native BlzFrameGetHeight takes framehandle frame returns real
native BlzFrameGetWidth takes framehandle frame returns real
native BlzFrameSetFont takes framehandle frame, string fileName, real height, integer flags returns nothing
native BlzFrameSetTextAlignment takes framehandle frame, textaligntype vert, textaligntype horz returns nothing
native BlzTriggerRegisterFrameEvent takes trigger whichTrigger, framehandle frame, frameeventtype eventId returns event
native BlzGetTriggerFrame takes nothing returns framehandle
native BlzGetTriggerFrameEvent takes nothing returns frameeventtype


once you have these natives, you need to look framedef, folder in war3mod folder, then look for fdf files. If you don't know what you're doing, I'd advise you to specifically look for standard templates.fdf file.
 
Disclaimer: Might include Incorrect or incomplete information.

constant originframetype
Originframetypes are built in frames which one can manipulate or use as parents for own custom created frames. They are important cause the frame creation natives provided requier each frame to have a parent.
One can get a frame out of such an originframetype with that native.
JASS:
native BlzGetOriginFrame takes originframetype frameType, integer index returns framehandle
for the first argument pick one of the constants, for the second one choose in most cases 0, if the origin frame has more that 1, you can get other ones of that originframetype by using an higher number.
ConstantInfo1info2

ORIGIN_FRAME_GAME_UI
without it nothing will be displayed.

ORIGIN_FRAME_WORLD_FRAME
the visible playground, units items effects fog ... every object participating in the game is displayed on it.

ORIGIN_FRAME_HERO_BAR

parent of all HERO_BUTTONS,
HeroButons share the same visiblity.

ORIGIN_FRAME_HERO_BUTTON
[0 to 6]
the clickable buttons of own/allied heroes on the left of the screen

ORIGIN_FRAME_HERO_HP_BAR
[0 to 6] connected to HeroButtons

ORIGIN_FRAME_HERO_MANA_BAR
[0 to 6] connected to HeroButtons

ORIGIN_FRAME_HERO_BUTTON_INDICATOR
[0 to 6] connected to HeroButtons

ORIGIN_FRAME_ITEM_BUTTON
[0 to 5]Items in the inventory. Reappear/updates every selection.


ORIGIN_FRAME_COMMAND_BUTTON
[0 to 11] the buttons to order units around, like ITEM_BUTTON, Reappear/update every selection.

ORIGIN_FRAME_SYSTEM_BUTTON
[0 to 3] {Menu, allies, Log/chat, Quest}

ORIGIN_FRAME_PORTRAIT

Face of the main selected Unit

ORIGIN_FRAME_MINIMAP

ORIGIN_FRAME_MINIMAP_BUTTON

Altering the Minimap

ORIGIN_FRAME_TOOLTIP

ORIGIN_FRAME_UBERTOOLTIP
Handles the basic tooltip Frame

ORIGIN_FRAME_CHAT_MSG
No Idea

ORIGIN_FRAME_UNIT_MSG
No Idea

ORIGIN_FRAME_TOP_MSG
Container of the UpKeep Change Warning Message, below the dayTime Clock
JASS:
function DebugOrigin takes nothing returns nothing
   local integer a = 0
   local integer b
   local integer lastHandle
   local integer current
   loop
       exitwhen a == 18
       set b = 0
       set lastHandle = 0
       loop
           set current = GetHandleId(BlzGetOriginFrame(ConvertOriginFrameType(a), b))
           exitwhen lastHandle == current
           call BJDebugMsg("["+I2S(a)+"]"+"["+I2S(b)+"]"+I2S(current))
           set lastHandle = current
           set b = b + 1
       endloop
       set a = a + 1
   endloop
endfunction

There is also an other way to get frames built in.
JASS:
native BlzGetFrameByName takes string name, integer createContext returns framehandle
BlzGetFrameByName loads an frame from an inner storage which has for each (index - name) combination one slot. Most ones use only index 0. Playerbased frames uses upto max playeramount (0 to 23). Also simpleframes do often use higher numbers then 0, the simpleFrames do that cause they reuse same frameTypes with same names. Now they increase the nr so you can access all of them with BlzGetFrameByName.
The problem with BlzGetFrameByName is, you have to get the names from the fdf warcraft 3 uses. This are 3 examples of such names.

ConsoleUI {Almost any default ingame UI-Elements is in some relation to ConsoleUI}.
UpperButtonBarFrame {Container of ORIGIN_FRAME_SYSTEM_BUTTONs}
ResourceBarFrame {Gold, Lumber, Food, Upkeep, FPS, APM, PING}

The list was generated by reading/interpreting all fdf files from warcraft 3 ptr 1.31 and reading all words in " " in each FrameHead found.
LeaderBoard/Multiboard do only work when the map created such one.​
If there is no nr next to a name, one uses "0".

HelpButton
HelpButtonText
HelpTitleText
HelpTextArea
HelpOKButton
HelpOKButtonText
CancelButtonText
LoadGameButton
LoadGameButtonText
GameSpeedLabel
GameSpeedValue
FileListFrame
OKButtonText
MapListBoxBackdrop
ButtonBackdropTemplate
ButtonPushedBackdropTemplate
ButtonDisabledBackdropTemplate
DifficultyLabel
DifficultyValue
DecoratedMapListBox
MapListScrollBar
GameSpeedSlider
PlayerNameLabel [0 to 23]
OptionsButton
OptionsButtonText
ExitButton
ExitButtonText
GameplayButton
GameplayButtonText
VideoButton
VideoButtonText
SoundButton
SoundButtonText
GameplayPanel
MouseScrollLabel
MouseScrollSlowLabel
MouseScrollSlider
MouseScrollFastLabel
MouseScrollDisableLabel
KeyScrollLabel
KeyScrollSlowLabel
KeyScrollSlider
KeyScrollFastLabel
TooltipsCheckBox
TooltipsLabel
SubgroupCheckBox
SubgroupLabel
FormationToggleCheckBox
FormationToggleLabel
CustomKeysLabel
HealthBarsCheckBox
HealthBarsLabel
VideoPanel
GammaLabel
GammaDarkLabel
GammaSlider
GammaBrightLabel
WindowModeLabel
ResolutionLabel
ModelDetailLabel
AnimQualityLabel
TextureQualityLabel
ParticlesLabel
LightsLabel
ShadowsLabel
OcclusionLabel
VSyncCheckBox
SoundPanel
SoundCheckBox
SoundVolumeLabel
SoundVolumeLowLabel
SoundVolumeSlider
SoundVolumeHighLabel
MusicCheckBox
MusicVolumeLabel
MusicVolumeLowLabel
MusicVolumeSlider
MusicVolumeHighLabel
AmbientCheckBox
AmbientLabel
MovementCheckBox
MovementLabel
SubtitlesCheckBox
SubtitlesLabel
UnitCheckBox
UnitLabel
ProviderLabel
EnviroCheckBox
EnviroLabel
PositionalCheckBox
PositionalLabel
MainPanel
AllianceDialog
AllianceBackdrop
AllianceTitle
ResourceTradingTitle
PlayersHeader
AllyHeader
VisionHeader
UnitsHeader
GoldHeader
LumberHeader
AllianceAcceptButton
AllianceAcceptButtonText
AllianceCancelButton
AllianceCancelButtonText
AlliedVictoryCheckBox
AlliedVictoryLabel
AllianceDialogScrollBar
AllianceSlot [0 to 23]
ColorBackdrop [0 to 23]
ColorBorder [0 to 23]
AllyCheckBox [0 to 23]
VisionCheckBox [0 to 23]
UnitsCheckBox [0 to 23]
GoldBackdrop [0 to 23]
GoldText [0 to 23]
LumberBackdrop [0 to 23]
LumberText [0 to 23]
CinematicPanel
CinematicBottomBorder
CinematicScenePanel
CinematicPortraitBackground
CinematicPortrait
CinematicPortraitCover
CinematicSpeakerText
CinematicDialogueText
CinematicTopBorder
ConsoleUI
EscMenuMainPanel
WouldTheRealOptionsTitleTextPleaseStandUp
InsideMainPanel
PauseButton
PauseButtonText
SaveGameButton
SaveGameButtonText
TipsButton
TipsButtonText
EndGameButton
EndGameButtonText
ReturnButton
ReturnButtonText
EndGamePanel
InsideEndGamePanel
EndGameTitleText
RestartButton
RestartButtonText
QuitButton
QuitButtonText
PreviousButton
PreviousButtonText
ConfirmQuitPanel
InsideConfirmQuitPanel
ConfirmQuitTitleText
ConfirmQuitMessageText
ConfirmQuitQuitButton
ConfirmQuitQuitButtonText
ConfirmQuitCancelButton
ConfirmQuitCancelButtonText
HelpPanel
InsideHelpPanel
TipsPanel
InsideTipsPanel
TipsTitleText
TipsTextArea
TipsBackButton
TipsBackButtonText
TipsNextButton
TipsNextButtonText
TipsOKButton
TipsOKButtonText
EscMenuBackdrop
EscMenuOptionsPanel
OptionsPanel
OptionsTitleText
NetworkButton
NetworkButtonText
OptionsPreviousButton
OptionsPreviousButtonText
GameplayTitleText
MouseScrollDisable
CustomKeysValue
VideoTitleText
VSyncLabel
ModelDetailValue
AnimQualityValue
TextureQualityValue
EscOptionsWindowModeMenu
EscOptionsWindowModePopupMenuBackdrop
EscOptionsWindowModePopupMenuDisabledBackdrop
EscOptionsWindowModePopupMenuTitle
EscOptionsWindowModePopupMenuArrow
EscOptionsWindowModePopupMenuMenu
EscOptionsResolutionMenu
EscOptionsResolutionPopupMenuBackdrop
EscOptionsResolutionPopupMenuDisabledBackdrop
EscOptionsResolutionPopupMenuTitle
EscOptionsResolutionPopupMenuArrow
EscOptionsResolutionPopupMenuMenu
EscOptionsParticlesMenu
EscOptionsParticlesPopupMenuBackdrop
EscOptionsParticlesPopupMenuDisabledBackdrop
EscOptionsParticlesPopupMenuTitle
EscOptionsParticlesPopupMenuArrow
EscOptionsParticlesPopupMenuMenu
EscOptionsLightsMenu
EscOptionsLightsPopupMenuBackdrop
EscOptionsLightsPopupMenuDisabledBackdrop
EscOptionsLightsPopupMenuTitle
EscOptionsLightsPopupMenuArrow
EscOptionsLightsPopupMenuMenu
EscOptionsShadowsMenu
EscOptionsShadowsPopupMenuBackdrop
EscOptionsShadowsPopupMenuDisabledBackdrop
EscOptionsShadowsPopupMenuTitle
EscOptionsShadowsPopupMenuArrow
EscOptionsShadowsPopupMenuMenu
EscOptionsOcclusionMenu
EscOptionsOcclusionPopupMenuBackdrop
EscOptionsOcclusionPopupMenuDisabledBackdrop
EscOptionsOcclusionPopupMenuTitle
EscOptionsOcclusionPopupMenuArrow
EscOptionsOcclusionPopupMenuMenu
SoundTitleText
ProviderValue
NetworkPanel
NetworkTitleText
NetworkLabel
LatencyInfo1
LatencyInfo2
LowLatencyRadio
HighLatencyRadio
ExtraHighLatencyRadio
LowLatencyLabel
HighLatencyLabel
ExtraHighLatencyLabel
BottomButtonPanel
OptionsOKButton
OptionsCancelButton
EscMenuSaveGamePanel
EscMenuSaveLoadContainer
SaveAndLoad
LoadOnly
LoadGameTitleText
LoadGameLoadButton
LoadGameLoadButtonText
LoadGameCancelButton
LoadGameCancelButtonText
SaveOnly
SaveGameTitleText
SaveGameSaveButton
SaveGameSaveButtonText
SaveGameDeleteButton
SaveGameDeleteButtonText
SaveGameCancelButton
SaveGameCancelButtonText
SaveGameFileEditBox
SaveGameFileEditBoxText
EscMenuOverwriteContainer
OverwriteOnly
OverwriteTitleText
OverwriteMessageText
OverwriteOverwriteButton
OverwriteOverwriteButtonText
OverwriteCancelButton
OverwriteCancelButtonText
EscMenuDeleteContainer
DeleteOnly
DeleteTitleText
DeleteMessageText
DeleteDeleteButton
DeleteDeleteButtonText
DeleteCancelButton
DeleteCancelButtonText
ButtonDisabledPushedBackdropTemplate
Leaderboard
LeaderboardBackdrop
LeaderboardTitle
LeaderboardListContainer
LogDialog
LogBackdrop
LogTitle
LogOkButton
LogOkButtonText
LogAreaBackdrop
LogArea
LogAreaScrollBar
Multiboard
MultiboardMinimizeButton
MultiboardTitleBackdrop
MultiboardTitle
MultiboardBackdrop
MultiboardListContainer
SimpleObserverPanel
ObserverVisionMenu
ObserverVisionMenuBackdrop
ObserverVisionMenuDisabledBackdrop
ObserverVisionMenuTitle
ObserverVisionMenuArrow
ObserverVisionPopupMenu
ObserverVisionPopupMenuMenuBackdropTemplate
ObserverFogCheckBox
ObserverFogString
ObserverCameraCheckBox
ObserverCameraString
ResourceBarFrame
ResourceBarGoldText
ResourceBarLumberText
ResourceBarSupplyText
ResourceBarUpkeepText
SimpleInfoPanelUnitDetail
SimpleNameValue
SimpleHeroLevelBar
SimpleProgressIndicator
SimpleBuildTimeIndicator [0 & 1]
SimpleBuildingActionLabel [0 & 1]
SimpleUnitStatsPanel
SimpleClassValue
SimpleInfoPanelCargoDetail [2]
SimpleHoldNameValue [2]
SimpleHoldDescriptionValue [2]
SimpleInfoPanelBuildingDetail [1]
SimpleBuildingNameValue [1]
SimpleBuildingDescriptionValue [1]
SimpleBuildQueueBackdrop [1]
SimpleInfoPanelItemDetail [3]
SimpleItemNameValue [3]
SimpleItemDescriptionValue [3]
SimpleInfoPanelDestructableDetail [4]
SimpleDestructableNameValue [4]
SimpleInfoPanelIconDamage [0 & 1]
InfoPanelIconBackdrop [0 to 5]
InfoPanelIconLevel [0 to 5]
InfoPanelIconLabel [0 to 5]
InfoPanelIconValue [0 to 5]
SimpleInfoPanelIconArmor [2]
SimpleInfoPanelIconRank [3]
SimpleInfoPanelIconFood [4]
SimpleInfoPanelIconGold [5]
SimpleInfoPanelIconHero [6]
InfoPanelIconHeroIcon [6]
SimpleInfoPanelIconHeroText [6]
InfoPanelIconHeroStrengthLabel [6]
InfoPanelIconHeroStrengthValue [6]
InfoPanelIconHeroAgilityLabel [6]
InfoPanelIconHeroAgilityValue [6]
InfoPanelIconHeroIntellectLabel [6]
InfoPanelIconHeroIntellectValue [6]
SimpleInfoPanelIconAlly [7]
InfoPanelIconAllyTitle [7]
InfoPanelIconAllyGoldIcon [7]
InfoPanelIconAllyGoldValue [7]
InfoPanelIconAllyWoodIcon [7]
InfoPanelIconAllyWoodValue [7]
InfoPanelIconAllyFoodIcon [7]
InfoPanelIconAllyFoodValue [7]
InfoPanelIconAllyUpkeep [7]
UpperButtonBarFrame
UpperButtonBarQuestsButton
UpperButtonBarMenuButton
UpperButtonBarAlliesButton
UpperButtonBarChatButton



The SimpleInfoPanels for units are using an rising createcontex nr.
JASS:
call BlzGetFrameByName("SimpleInfoPanelIconDamage",0)
   call BlzGetFrameByName("SimpleInfoPanelIconDamage",1)
   call BlzGetFrameByName("SimpleInfoPanelIconArmor",2)
   call BlzGetFrameByName("SimpleInfoPanelIconRank",3)
   call BlzGetFrameByName("SimpleInfoPanelIconFood",4)
   call BlzGetFrameByName("SimpleInfoPanelIconGold",5)
   call BlzGetFrameByName("InfoPanelIconHeroIcon", 6)
   call BlzGetFrameByName("SimpleInfoPanelIconAlly", 7)

The subFrame text/Label/Image names for 0 to 5 are the same.

InfoPanelIconBackdrop/Value/level/Label are the frames showing the units data if local player has selected an single unit they are all part of SimpleInfoPanelUnitDetail.
("InfoPanelIconBackdrop", 0) is Attack one.
("InfoPanelIconBackdrop", 1) is Attack two.
("InfoPanelIconBackdrop", 2) is Armor.
("InfoPanelIconBackdrop", 3) is SpellCaster rank (tech).
("InfoPanelIconBackdrop", 4) is Food provided.
("InfoPanelIconBackdrop", 5) is Gold remaning (goldmine).

Hero Stats use unique names still use createcontext 6.
The Hero Stat Panel access.
JASS:
   call BlzGetFrameByName("InfoPanelIconHeroIcon", 6)
   call BlzGetFrameByName("InfoPanelIconHeroStrengthLabel", 6)
   call BlzGetFrameByName("InfoPanelIconHeroStrengthValue", 6)
   call BlzGetFrameByName("InfoPanelIconHeroAgilityLabel", 6)
   call BlzGetFrameByName("InfoPanelIconHeroAgilityValue", 6)
   call BlzGetFrameByName("InfoPanelIconHeroIntellectLabel", 6)
   call BlzGetFrameByName("InfoPanelIconHeroIntellectValue", 6)
   call BlzGetFrameByName("SimpleInfoPanelIconHeroText", 6)
   call BlzGetFrameByName("SimpleInfoPanelIconHero", 6)


One could repos the BackDrop to move each unit-info part individual one can also use BlzFrameGet/SetText on InfoPanelIconValue to read/write the value of the text shown to the local Player. (this text is async and should not be used for anything that needs to be synced). Also values the current unit does not posses are not upgraded and will return with GetText the values for the last unit selected having possed such a value.

Another way is to jump up parents using BlzFrameGetParent framehandle fh, this is not always possible and jumping up to some parents will break the game.

Sometimes its nice to know where/which frame that is. I found that native quite useful in that case, although it did not always work or it seemd not to work if the frame was to big:
JASS:
call BlzFrameCageMouse(framehandle fh, true)
It forces the mouse into the frame.

constant framepointtype FRAMEPOINT_TOPLEFT = ConvertFramePointType(0)
constant framepointtype FRAMEPOINT_TOP = ConvertFramePointType(1)
constant framepointtype FRAMEPOINT_TOPRIGHT = ConvertFramePointType(2)
constant framepointtype FRAMEPOINT_LEFT = ConvertFramePointType(3)
constant framepointtype FRAMEPOINT_CENTER = ConvertFramePointType(4)
constant framepointtype FRAMEPOINT_RIGHT = ConvertFramePointType(5)
constant framepointtype FRAMEPOINT_BOTTOMLEFT = ConvertFramePointType(6)
constant framepointtype FRAMEPOINT_BOTTOM = ConvertFramePointType(7)
constant framepointtype FRAMEPOINT_BOTTOMRIGHT = ConvertFramePointType(8)
They are used when positionating frames.
JASS:
native BlzFrameSetPoint takes framehandle frame, framepointtype point, framehandle relative, framepointtype relativePoint, real x, real y returns nothing
native BlzFrameSetAbsPoint takes framehandle frame, framepointtype point, real x, real y returns nothing

with BlzFrameSetPoint you set frame point offset by x/y to frame relative point.

For example BlzFrameSetPoint(imgFrame, FRAMEPOINT_CENTER, mainFrame, FRAMEPOINT_CENTER, 0.0, 0.0) would place imgFrame directly onto mainFrame, if they have the same size. The abs position of mainFrame on the screen does not matter.
Another example BlzFrameSetPoint(secButton, FRAMEPOINT_LEFT, mainButton, FRAMEPOINT_RIGHT, 0.01, 0.0) would grap secButton at its LEFT and move it using LEFT as its origin to mainButtons RIGHT with an x offset of 1% of xScreensize to the right. Would result into them beeing next to each other.​

BlzFrameSetAbsPoint sets the framepoint to the absolute x/y of the screen.

It might be useful to use BlzFrameClearAllPoints takes framehandle frame to remove currently used points of a frame. Also not all FRAMEPOINTS might work for the Frames one wants to repos. In my testing for command Buttons TOPLEFT was quite successful.

For both natives x/y are factors of the 4:3 screens size: 0/0 is at the left bottom corner (4:3 Screen) and 0.8/0.6 at the right top corner (4:3 Screen). Even a hundredth has quite an impact on the result.


constant textaligntype TEXT_JUSTIFY_TOP = ConvertTextAlignType(0)
constant textaligntype TEXT_JUSTIFY_MIDDLE = ConvertTextAlignType(1)
constant textaligntype TEXT_JUSTIFY_BOTTOM = ConvertTextAlignType(2)
constant textaligntype TEXT_JUSTIFY_LEFT = ConvertTextAlignType(3)
constant textaligntype TEXT_JUSTIFY_CENTER = ConvertTextAlignType(4)
constant textaligntype TEXT_JUSTIFY_RIGHT = ConvertTextAlignType(5)
In Code one uses this native to set textalign
BlzFrameSetTextAlignment takes framehandle frame, textaligntype vert, textaligntype horz
Text Justify.jpg

Textaligntypes define the position text will take when the textFrame was given an rect beeing bigger than the space the text Needs to take by seting an Position and size or 2 Points that define a rect.

0, 1, 2 are for textaligntype vert
3, 4, 5 are for textaligntype horz

Inside fdf textalign are seperate fields.
FontJustificationH JUSTIFYCENTER,
FontJustificationV JUSTIFYMIDDLE,

frameeventtypes
frameeventtypes are the possible events one can register to custom created frames. Not all frametypes can evoke events.
One registers a frameevent with
JASS:
native BlzTriggerRegisterFrameEvent takes trigger whichTrigger, framehandle frame, frameeventtype eventId returns event
Inside a callback function executed by that trigger one has following informations:
BlzGetTriggerFrame - the frame evoking the event
BlzGetTriggerFrameEvent - the frameeventtype evoked
GetTriggerPlayer - the player evoking the event. (only tested in Single Player)


On default the toc-File "war3.w3mod\ui\framedef\framedef.toc" is loaded. Only frame definition loaded are working as intened. A toc file is a list of fdf-Files one wants to load, when Loading a toc-File each line represents one fdf. The fdf paths in the toc-File are relative to the game/map root as one is used to in warcraft 3 mapping.
A TOC File should end with an empty line.
In Ptr 1.31 "framedef.toc" does not include "UI\FrameDef\Glue\standardtemplates.fdf" nor "UI\FrameDef\UI\escmenutemplates.fdf", these 2 are defining most basic UI-Elements.​

There exist 3 Framecreating natives on 1.31 ptr. One should use "BlzCreateFrame".
Sometimes created frames take over the keyboard foucs when clicked results into disabling hotkeys. The normal game regains keyboard focus when the user is left clicking the world frame, although a forced click had no effect.
JASS:
native BlzCreateFrame takes string name, framehandle owner, integer priority, integer createContext returns framehandle
native BlzCreateSimpleFrame  takes string name, framehandle owner, integer createContext returns framehandle
native BlzCreateFrameByType takes string typeName, string name, framehandle owner, string inherits, integer createContext returns framehandle

Frames generated using BlzCreateFrame use more of the built in rules/Textures, also they create all subframes.
BlzCreateFrame can only create mainFrames beeing defined in a loaded fdf-File, fdf files are loaded over toc-files. MainFrames have a definitionHead outside of any others frame's body.
When creating a mainFrames all subFrames of that Frame are created. One can access such generated subFrames with BlzGetFrameByName(<2keyWordString after Frame>, <same Nr as used inside BlzCreateFrame>) the secondKeyWordString is the unique name of that FrameType. On default the File "war3.w3mod\ui\framedef\framedef.toc" is loaded.
BlzCreateFrame is overall the best choice of the 3 frame creation natives.

BlzCreateSimpleFrame can only create Frames having SIMPLE in their 1.Keyword of the Frame definition head, it has the same limitation as BlzCreateFrame only beeing able to create mainFrames. As written above simpleframes occupy on default some createContex indexes, if you want to not lose access to the default ones avoid colisons with your custom ones. SimpleFrames are placed below Frames.
Code:
Frame "SIMPLEFRAME" x (INHERITS y) {
1.Keyword - SIMPLEFRAME
2.Keyword - x
one uses x as name to create.

SimpleFrames can have only simple-Frames as children and can not be created by CreateFrame. There are other SubFrames only exsiting inside SimpleFrames. They can have String "name" INHERITS "x" and Texture "name" INHERITS "x". Textures and Strings are also accessed in jass with BlzGetFrameByName but they can not exist alone.

BlzCreateFrameByType can create any Frame but it has more arguments then the others and it is the one you wana use when you want to built the frame yourself. It will not generate subFrames. Does also allow to generate Frames not defined/loaded in such a case the created frame has hardly any of the wanted behaviour.
typename is the 1.Keyword
inherits is the 2.Keyword
name
createContext - no idea
Currently I think its the index of an hidden inner framehandle array your new created frame and its subframes will take. If one uses 8 then one can load the frame and its subFrames with BlzGetFrameByName(<name>, 8). If that is the case one would not need global framevariables, when one uses clean uniue indexes. I did not tests for max min values.​



"AdvancedOptionsDisplay"
"AdvancedPopupMenuTemplate"
"AdvancedOptionsPane"
"BattleNetChatActionMenu"
"IconicButtonTemplate"
"AdBanner"
"BattleNetChatPanel"
"LadderButtonBackdropTemplate"
"LadderButtonPushedBackdropTemplate"
"LadderButtonDisabledBackdropTemplate"
"BattleNetHelpDialog"
"BattleNetChatroom"
"BattleNetClanInvitation"
"BattleNetClanMateListBox"
"BattleNetClanPane"
"BattleNetClanInviteDialog"
"BattleNetCustomCreatePanel"
"FilterPopupMenuTemplate"
"BattleNetCustomJoinPanel"
"BattleNetCustomFilterDialog"
"BattleNetCustomLoadPanel"
"BattleNetFriendsListBox"
"BattleNetFriendsPane"
"BattleNetIconSelectBox"
"IconButtonTemplate"
"BattleNetMainFrame"
"BNetPopupMenuBackdropTemplate"
"BNetPopupMenuTemplate"
"PlayerSlotPopupMenu"
"BattleNetMatchmakerPanel"
"MMPlayerSlot"
"BattleNetMatchmakerTeamInviteDialog"
"BattleNetMatchmakerPendingInviteDialog"
"BattleNetNewsBox"
"TeamLabelTextTemplate"
"LadderNameTextTemplate"
"TeamValueTextTemplate"
"TeamLadderRankValueTextTemplate"
"LadderButtonDisabledPushedBackdropTemplate"
"LadderButtonFocusHighlightBackdropTemplate"
"LadderButtonMouseOverHighlightBackdropTemplate"
"LadderButtonTemplate"
"ClanButtonBackdropTemplate"
"ClanButtonPushedBackdropTemplate"
"ClanButtonDisabledBackdropTemplate"
"ClanButtonDisabledPushedBackdropTemplate"
"ClanButtonFocusHighlightBackdropTemplate"
"ClanButtonMouseOverHighlightBackdropTemplate"
"ClanButtonTemplate"
"BattleNetProfilePanel"
"BattleNetProfileListBox"
"BattleNetProfileListItem"
"BattleNetIconSelectDialog"
"BattleNetScheduledGame"
"BattleNetStandardPanel"
"BattleNetStatusBox"
"BattleNetTeamInvitation"
"TeamPopupMenuBackdropTemplate"
"TeamPopupMenuTemplate"
"TeamMemberPopupMenu"
"BattleNetTeamPanel"
"BattleNetTeamInviteDialog"
"BattleNetUserListBox"
"CampaignListBox"
"CampaignMenu"
"CheckListBox"
"CustomCampaignMenu"
"DecoratedMapListBox"
"DialogWar3"
"GameChatroom"
"ListBoxWar3"
"Loading"
"LoadingPlayerSlot"
"LoadSavedGameScreen"
"LocalMultiplayerCreate"
"LocalMultiplayerJoin"
"LocalMultiplayerLoad"
"MainMenuFrame"
"DebugButton"
"ReplayButton"
"BrowserButton"
"QuickReplayDialog"
"QuickReplayConfirmDialog"
"BattleNetPatchDialog"
"BattleNetConnectDialog"
"UserDataMigrationDialog"
"MapInfoPane"
"MapListBox"
"MapPreferenceBox"
"MapPreferenceBoxBackdrop"
"MovieScreen"
"OptionsPopupMenuBackdropTemplate"
"OptionsPopupMenuTemplate"
"OptionsMenu"
"OptionsConfirmDialog"
"PlayerSlot"
"TeamColorMenu"
"ScoreScreenTabButtonTemplate"
"ScoreScreen5ColumnButtonTemplate"
"ScoreScreen4ColumnButtonTemplate"
"ScoreScreenButtonBackdropTemplate"
"ScoreScreenBottomButtonTemplate"
"ScoreScreenBottomCheckButtonTemplate"
"ScoreScreenTabTextTemplate"
"ScoreScreenTabTextSelectedTemplate"
"ScoreScreenColumnHeaderTemplate"
"ScoreScreenFrame"
"SaveReplayPanel"
"SinglePlayerMenu"
"SkirmishPopupMenuBackdropTemplate"
"SkirmishPopupMenuTemplate"
"Skirmish"
"TeamSetup"
"ViewReplayScreen"
"AllianceDialog"
"AllianceSlot"
"BrowserFrame"
"ChatDialog"
"CinematicPanel"
"EscMenuMainPanelDialogTextTemplate"
"EscMenuMainPanel"
"EscMenuBackdrop"
"EscMenuOptionsConfirmDialog"
"EscMenuOptionsPanel"
"EscMenuSaveDialogTextTemplate"
"EscMenuSaveGamePanel"
"GameResultDialog"
"GameSaveSplashDialog"
"Leaderboard"
"LogDialog"
"Multiboard"
"QuestButtonBaseTemplate"
"QuestButtonBackdropTemplate"
"QuestButtonPushedBackdropTemplate"
"QuestButtonDisabledBackdropTemplate"
"QuestButtonDisabledPushedBackdropTemplate"
"QuestButtonMouseOverHighlightTemplate"
"QuestButtonTemplate"
"QuestCheckBox"
"QuestDialog"
"QuestListItem"
"QuestItemListItem"
"QuestCheckBox2"
"QuestCheckBox3"
"QuestMainListScrollBar"
"QuestItemListScrollBar"
"QuestConditionListScrollBar"
"ScriptDialog"
"ScriptDialogButton"
"SuspendDialog"
"SuspendPlayerSlot"
"TimerDialog"
"UnresponsiveDialog"



Frames and Multiplayer:

Frames handling user input won't sync their state. User input has only an effect on the player doing that input.
When an checkbox is displayed and for example User A clicks it; only for User A will the checkbox be in the checked state. This also applies to editboxes and sliders.
Therefore using BlzFrameGetText(Editbox) or BlzFrameGetValue(Slider) are likely to produce a disconnect, cause their values are local and differ, if any player did a change (but user input is their purpose).​

FrameEvents are synced and ptr (1.31) brought natives, to get the active frame, the player using the frame and the frames new text/value.
JASS:
native BlzGetTriggerFrame             takes nothing returns framehandle
native BlzGetTriggerFrameEvent  takes nothing returns frameeventtype
native BlzGetTriggerFrameValue  takes nothing returns real
native BlzGetTriggerFrameText  takes nothing returns string
"BlzGetTriggerFrameValue" and "BlzGetTriggerFrameText" are not included in common.j (PTR 1.31) but can be used when one uses vjass (no idea about Lua) by declaring them in the map head (write them there)

I somewhere read there is an further one, but I did not find it anymore.

Frame -> BlzCreateFrame

QuestCheckBox

DebugButton

ScriptDialog

ScriptDialogButton

SuspendDialog with Checks

ListBoxWar3

StandardDecoratedEditBoxTemplate

StandardSliderTemplate

RadioButton

Glowing Button with Tooltip Frame

Button by BlzCreateFrameByType

MyStatusBar


This is a Frame definition from "war3.w3mod/ui/framedef/glue/standardtemplates.fdf".
It is an Backdrop with an default size of (0.11 / 0.055) . It's name is "StandardMenuTinyButtonBaseBackdrop"
Code:
Frame "BACKDROP" "StandardMenuTinyButtonBaseBackdrop" {
    Width 0.11,
    Height 0.055,
    BackdropBlendAll,
    BackdropBackground  "UI\Widgets\Glues\GlueScreen-Button1-TinyBorder.blp",
}


This is a Frame definition from "war3.w3mod/ui/framedef/ui/scriptdialog.fdf".

It is a "GLUETEXTBUTTON" and its name is "ScriptDialogButton" it does takeover data from "EscMenuButtonTemplate" WITHCHILDREN means it will also copy subFrames .
"ScriptDialogButton" has a subFrame named "ScriptDialogButtonText" which is a "TEXT" which is based on a frame named "EscMenuButtonTextTemplate"
Code:
Frame "GLUETEXTBUTTON" "ScriptDialogButton" INHERITS WITHCHILDREN "EscMenuButtonTemplate" {
    UseActiveContext,
    ButtonText "ScriptDialogButtonText",
   Frame "TEXT" "ScriptDialogButtonText" INHERITS "EscMenuButtonTextTemplate" {
       Text "",
   }
}

using BlzCreateFrame for "ScriptDialogButton" would look like this:
JASS:
call BlzCreateFrame( "ScriptDialogButton", parentFrame, 0, 0)
call BlzGetFrameByName("ScriptDialogButtonText", 0)
one creates the mainFrame "ScriptDialogButton", directly after having created the mainFrame one has access to the subFrames with BlzGetFrameByName. The subframe in this case would allow to change the ButtonsText cause it is managing it.

FrameTypes:
BACKDROP
BUTTON
CHATDISPLAY
CHECKBOX
CONTROL
DIALOG
EDITBOX
FRAME
GLUEBUTTON
GLUECHECKBOX
GLUEEDITBOX
GLUEPOPUPMENU
GLUETEXTBUTTON
HIGHLIGHT
LISTBOX
MENU
MODEL
POPUPMENU
SCROLLBAR
SIMPLEBUTTON
SIMPLECHECKBOX
SIMPLEFRAME
SIMPLESTATUSBAR
SLASHCHATBOX
SLIDER
SPRITE
TEXT
TEXTAREA
TEXTBUTTON
TIMERTEXT


Inside an fdf file:
DecorateFileNames - allows to lookup paths by string constants written in gameinterface or somewhere else.
UseActiveContext - disallows clicking the space the frame takes and subframes can refer to it.
Height - define a default height used when creating that frame
Width - define a default width

BackdropEdgeFile - The File beeing used as border, setting texture (by code) overwrites that value.

FontColor 0.99 0.827 0.0705 1.0, //Red Green Blue Alpha 0.0 to 1.0
FontDisabledColor 0.99 0.827 0.0705 1.0, //Color used when Fram is SetEnable(false)

Code:
Frame "BACKDROP" "BoxedTextBackgroundTemplate" {
        DecorateFileNames, //Look-Up Names in some String table (for example gameinterface)
        BackdropTileBackground,
        BackdropBackground  "ToolTipBackground", //BackgroundFile
        BackdropCornerFlags "UL|UR|BL|BR|T|L|B|R",
        BackdropCornerSize  0.008, //higher numbers make the corners rounder.
        BackdropBackgroundInsets 0.0022 0.0022 0.0022 0.0022, //makes the background start by an offset from the outside.
        BackdropEdgeFile  "ToolTipBorder", //the border File
        BackdropBlendAll,
}




QuestCheckBox is a out of the box working checkbox with all textures need for a checkbox, when created with BlzCreateFrame. It is found in questdialog.fdf
There are also "QuestCheckBox2" and "QuestCheckBox3" which are smaller.
QuestCheckbox(2)(3) have a size defined in the fdf means, if one creates it with BlzCreateFrame they will use that size without setting BlzFrameSetSize.
As checkbox one should atleast attach the frameEvents: FRAMEEVENT_CHECKBOX_CHECKED & FRAMEEVENT_CHECKBOX_UNCHECKED to know what players toggled.
QuestCheckBox.jpg

JASS:
function TestQuestCheckbox takes nothing returns nothing
//Create an Checkbox with border and (un)checked textures
//supports FRAMEEVENT_CHECKBOX_CHECKED, FRAMEEVENT_CHECKBOX_UNCHECKED, FRAMEEVENT_MOUSE_ENTER, FRAMEEVENT_MOUSE_LEAVE
//"QuestCheckBox" is the big checkBox
//"QuestCheckBox2" is the smaller one; one could also set size, if one wants a different size then the default ones.
   local framehandle fh  = BlzCreateFrame("QuestCheckBox", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), 0,0) // one could also use "QuestCheckBox2" or "QuestCheckBox3" to spawn a smaller one
   call BlzFrameSetAbsPoint(fh, FRAMEPOINT_CENTER, 0.4,0.4)
   call TestRegisterEvents(fh)
endfunction

DebugButton is a TextButton with a blue background, border and yellow colored text. They look like the buttons in the main menu after starting the game. "BrowserButton", "ReplayButton" seem to be almost the same except for the default Text. They are found in mainmenu.fdf.
DebugButton.jpg

JASS:
function TestDebugButton takes nothing returns nothing
//Creates an TextButton having an border, a blue background yellow colored text and a glue effect when hovering
   local framehandle mainButton  = BlzCreateFrame("DebugButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), 0,0)//Create the mainButton and all its childs
   local framehandle textChild  = BlzGetFrameByName("DebugButtonText",0) //Get the Frame displaying the text for mainButton
   call BlzFrameSetAbsPoint(mainButton, FRAMEPOINT_CENTER, 0.4,0.4) //set position of the mainButton
   call BlzFrameSetSize(mainButton, 0.15,0.02) //set its x y size

   call BlzFrameSetText(textChild, "My Test Text")
   call TestRegisterEvents (mainButton) //supports FRAMEEVENT_CONTROL_CLICK, FRAMEEVENT_MOUSE_ENTER, FRAMEEVENT_MOUSE_LEAVE
endfunction


"ScriptDialog" is a box/container using players race textures and having an title.
ScriptDialog.jpg
JASS:
function TestScriptDialog takes nothing returns nothing
//Creates an container having an background, border and title background and border match the players race Textures title is yellow colored.
   local framehandle box  = BlzCreateFrame("ScriptDialog", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), 0,0)
   local framehandle boxTitle = BlzGetFrameByName("ScriptDialogText",0)
   call BlzFrameSetSize(box, 0.2,0.5) //has a default size but one can overwrite it.
   call BlzFrameSetAbsPoint(box, FRAMEPOINT_CENTER, 0.4,0.35)
   call BlzFrameSetText(boxTitle, "Mein Title")
endfunction

Is the button using players race textures.
ScriptDialogButton.jpg
JASS:
function TestScriptDialogButton takes nothing returns nothing
//Creates an Button using the races background colors having a border, yellow colored text and a glue effect when hovering
   local framehandle mainButton  = BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), 0,0)
   local framehandle buttonText = BlzGetFrameByName("ScriptDialogButtonText",0)  //Get The buttons textChild
   call BlzFrameSetSize(mainButton, 0.2,0.05) //has no default size so you have to set it.
   call BlzFrameSetAbsPoint(mainButton, FRAMEPOINT_CENTER, 0.4,0.35)
   call BlzFrameSetText(buttonText, "Mein ButtonText")
   call TestRegisterEvents (mainButton) //Supports Enter, Leave, Control Click
endfunction

This one was used pre 1.30 when an player had network issues. Simlear to ScriptDialog but it has a button at the bottom and a label above the button.
Example for an Dialog with 3 checkboxes using SuspendDialog.
Suspend with Checkboxes.jpg
JASS:
function TestRaceBoxNCheckBox takes nothing returns nothing
//Creates an container having an background, border and title background and border match the players race Textures title is yellow colored.
//Although SuspendDialog might be a better base if one wants 1 button at the bottom.
   local framehandle box  = BlzCreateFrame("SuspendDialog", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), 0,0)
   local framehandle boxTitle = BlzGetFrameByName("SuspendTitleText",0)
   local framehandle boxBottomText = BlzGetFrameByName("SuspendTimerText",0)
   local framehandle checkA = BlzCreateFrame("QuestCheckBox", box, 0,0)
   local framehandle checkB = BlzCreateFrame("QuestCheckBox", box, 0,0)
   local framehandle checkC = BlzCreateFrame("QuestCheckBox", box, 0,0)
   local framehandle mainButton  = BlzGetFrameByName("SuspendDropPlayersButton",0)
   local framehandle buttonText = BlzGetFrameByName("SuspendDropPlayersButtonText",0)  //Get The buttons textChild
   local framehandle checkALable = BlzCreateFrame("TeamLabelTextTemplate", checkA, 0,0 )
   local framehandle checkBLable = BlzCreateFrame("TeamLabelTextTemplate", checkB, 0,0 )
   local framehandle checkCLable = BlzCreateFrame("TeamLabelTextTemplate", checkC, 0,0 )
   call BlzFrameSetAbsPoint(box, FRAMEPOINT_CENTER, 0.4,0.35)
 
   call BlzFrameSetSize(box, 0.336,0.3) //has a default size but one can overwrite it.
 
   call BlzFrameSetText(boxTitle, "Mein Title")
   call BlzFrameSetText(buttonText, "ButtonText")
 
   call BlzFrameSetText(checkALable, "Checkbox A")
   call BlzFrameSetText(checkBLable, "Checkbox B")
   call BlzFrameSetText(checkCLable, "Checkbox C")
 
   call BlzFrameSetPoint(checkA, FRAMEPOINT_CENTER, box, FRAMEPOINT_CENTER, -0.1, 0)
   call BlzFrameSetPoint(checkB, FRAMEPOINT_CENTER, box, FRAMEPOINT_CENTER, 0, 0)
   call BlzFrameSetPoint(checkC, FRAMEPOINT_CENTER, box, FRAMEPOINT_CENTER, 0.1, 0)
 
   call BlzFrameSetPoint(checkALable, FRAMEPOINT_TOP, checkA, FRAMEPOINT_BOTTOM, 0,0)
   call BlzFrameSetPoint(checkBLable, FRAMEPOINT_TOP, checkB, FRAMEPOINT_BOTTOM, 0,0)
   call BlzFrameSetPoint(checkCLable, FRAMEPOINT_TOP, checkC, FRAMEPOINT_BOTTOM, 0,0)
 

   call TestRegisterEvents (checkA)
   call TestRegisterEvents (checkB)
   call TestRegisterEvents (checkC)
   call TestRegisterEvents (mainButton) //one could also use the box, although the box would only support FRAMEEVENT_EDITBOX_ENTER, when using the button one has the 3 default button events. ControlClick, Enter, Leave
endfunction

is the container/box used in the main menu, the grey background and the border.

Non default Loaded FDF (PTR 1.31): "UI\FrameDef\Glue\standardtemplates.fdf"
Editbox.jpg

EditBox is an UI-Frame handling user text input.
JASS:
function TestEditBox takes nothing returns nothing
   local framehandle fh  = BlzCreateFrame("StandardDecoratedEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), 0,0)
   call BlzFrameSetSize(fh, 0.2,0.03)
   call BlzFrameSetAbsPoint(fh, FRAMEPOINT_CENTER, 0.4,0.2)
   call TestRegisterEvents (fh)//ENTER, LEAVE, FRAMEEVENT_EDITBOX_TEXT_CHANGED -> (changed Text)
endfunction
Inside the Event one should use BlzGetTriggerFrameText to get the value the user did write into.
(PTR 1.31) BlzGetTriggerFrameText is not included in Common.j.​

Non default Loaded FDF (PTR 1.31): "UI\FrameDef\Glue\standardtemplates.fdf"
Slider.jpg
A slider is an ui Element which allows the user to choose a value between an upper and lower limit.
JASS:
function TestSlider takes nothing returns nothing
   local framehandle fh  = BlzCreateFrame("StandardSliderTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), 0,0)
   call BlzFrameSetSize(fh, 0.2,0.03)
   call BlzFrameSetAbsPoint(fh, FRAMEPOINT_CENTER, 0.2,0.2)
   call TestRegisterEvents (fh) //ENTER, LEAVE, FRAMEEVENT_DIALOG_CANCEL -> (change Value)
endfunction
Inside the Event one should use BlzGetTriggerFrameValue to get the value the user did choose.
(PTR 1.31) BlzGetTriggerFrameValue is not included in Common.j.​

Non default Loaded FDF (PTR 1.31): "UI\FrameDef\UI\escmenutemplates.fdf" or "UI\FrameDef\Glue\battlenettemplates.fdf"
BattlenetRadioBox.jpg
BattlenetRadioBoxChecked.jpg
BattleNetRadioButtonTemplate
RadioBox.jpg
RadioBoxChecked.jpg
EscMenuRadioButtonTemplate
RadioButtons in warcraft 3 are just round checkboxes.
BattlenetRadioButton is bigger but has no audio feedback when clicking.
JASS:
function TestRadio takes nothing returns nothing
   local framehandle fh =  BlzCreateFrame("EscMenuRadioButtonTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), 0,0)
   call BlzFrameSetAbsPoint(fh, FRAMEPOINT_CENTER, 0.45,0.35)
   call TestRegisterEvents (fh)
//supports FRAMEEVENT_CHECKBOX_CHECKED, FRAMEEVENT_CHECKBOX_UNCHECKED, FRAMEEVENT_MOUSE_ENTER, FRAMEEVENT_MOUSE_LEAVE
endfunction

TooltipNotVisible.jpg
TooltipVisible.jpg
Aeryn showed me this glowing buttons when ones uses the buttons from scorescreen.
I used that listbox for the tooltip because on default one can not generate a textarea, ugly (PTR 1.31). Could be solved by loading it with an imported toc.file would simple it down.
JASS:
function TestFrameEvent takes nothing returns nothing
   //call BJDebugMsg("TestFrameEvent")
   //call BJDebugMsg("Player: "+GetPlayerName(GetTriggerPlayer()))

   if BlzGetTriggerFrameEvent() ==FRAMEEVENT_CONTROL_CLICK then
       call BJDebugMsg("FRAMEEVENT_CONTROL_CLICK")

   elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_MOUSE_ENTER then
       call BJDebugMsg("FRAMEEVENT_MOUSE_ENTER")
   elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_MOUSE_LEAVE then
       call BJDebugMsg("FRAMEEVENT_MOUSE_LEAVE")
   endif
endfunction

function TestClickableButton takes nothing returns nothing
local trigger trig = CreateTrigger()
  local framehandle mainbutton = BlzCreateFrame("ScoreScreenBottomButtonTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), 0,  0)
   local framehandle imgFrame = BlzGetFrameByName("ScoreScreenButtonBackdrop",  0)
   local framehandle tooltipBox = BlzCreateFrame("ListBoxWar3", mainbutton, 0,  0)
  local framehandle tooltip = BlzCreateFrameByType("TEXT", "StandardInfoTextTemplate", tooltipBox, "StandardInfoTextTemplate",  0)

   call BlzFrameSetSize(mainbutton, 0.04, 0.04)

   call BlzFrameSetSize(tooltipBox, 0.3, 0.1)
   call BlzFrameSetSize(tooltip, 0.28, 0.08)//tooltip-Text is smaller than the box, so it wont touch the border.

  call BlzFrameSetTexture(imgFrame, "ReplaceableTextures\\CommandButtons\\BTNPeasant.blp", 0, true) //set the image of the imgFrame, with 0 the texture is streched with 1 the frame is filled with that texture.

   call BlzFrameSetAbsPoint(mainbutton, FRAMEPOINT_TOPLEFT, 0.4, 0.3) //positionate button on the screen


   call BlzFrameSetPoint(tooltip, FRAMEPOINT_CENTER, tooltipBox, FRAMEPOINT_CENTER, 0.0, 0.0) //place tooltip into tooltipBox
  call BlzFrameSetPoint(tooltipBox, FRAMEPOINT_BOTTOM, mainbutton, FRAMEPOINT_TOP, 0.0, 0.0) //place tooltipBox with its bottom to the mainButtons TOP. tooltipBox will be over the mainbutton

   call BlzFrameSetTooltip(mainbutton, tooltipBox) //show tooltipBox only when mainbutton is hovered with the mouse.
  call BlzFrameSetText(tooltip, "Sound\\Music\\mp3Music\\Credits.mp3|nSound\\Music\\mp3Music\\PH.mp3|n|cffffcc00Sound\\Music\\mp3Music\\War2IntroMusic.mp3") //text of the tooltip


   call TriggerAddAction(trig, function TestFrameEvent)
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_CONTROL_CLICK)
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_MOUSE_ENTER)
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_MOUSE_LEAVE)

endfunction

JASS:
function TestFrameEvent takes nothing returns nothing
   //call BJDebugMsg("TestFrameEvent")
   //call BJDebugMsg("Player: "+GetPlayerName(GetTriggerPlayer()))
   call BJDebugMsg(BlzFrameGetName( BlzGetTriggerFrame()))
   if BlzGetTriggerFrameEvent() ==FRAMEEVENT_CONTROL_CLICK then
       call BJDebugMsg("FRAMEEVENT_CONTROL_CLICK")
   elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_MOUSE_ENTER then
       call BJDebugMsg("FRAMEEVENT_MOUSE_ENTER")
   elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_MOUSE_LEAVE then
       call BJDebugMsg("FRAMEEVENT_MOUSE_LEAVE")
   endif
endfunction

function TestRegisterEvents takes framehandle fh returns nothing
local trigger trig = CreateTrigger()
   call TriggerAddAction(trig, function TestFrameEvent)
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_CONTROL_CLICK) //Button is clicked not supported by checkboxes
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_MOUSE_ENTER)
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_MOUSE_LEAVE)
endfunction

function TestClickableButton takes nothing returns nothing
  local framehandle mainbutton = BlzCreateFrameByType("TEXTBUTTON", "mainButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), "StandardButtonTemplate",  0)
   local framehandle imgButton = BlzCreateFrameByType("BACKDROP", "imgButton", mainbutton, "ButtonBackdropTemplate",  0)

   call BlzFrameSetSize(mainbutton, 0.04, 0.04)
   call BlzFrameSetSize(imgButton, 0.04, 0.04)
   call BlzFrameSetTexture(imgButton, "ReplaceableTextures\\CommandButtons\\BTNPeasant.blp", 0, true)

   call BlzFrameSetAbsPoint(mainbutton, FRAMEPOINT_TOPLEFT, 0.4, 0.3)
   call BlzFrameSetPoint(imgButton, FRAMEPOINT_CENTER, mainbutton, FRAMEPOINT_CENTER, 0.0, 0.0)

   call TestRegisterEvents(mainbutton)
endfunction

This is an custom fdf which is based on text from replaypanel. Cause it is a custom written fdf, one would need to import both (a toc loading it and the fdf itself) inside the toc file one has to write the path one imported the fdf into.
MyBar1.jpg
MyBar2.jpg
Progressbars.jpg
An SIMPLESTATUSBAR can have values from 0 to 100 (0 beeing empty, 100 full).

"MyStatusBar.fdf"
Code:
// -- INCLUDE FILES ---------------------------------------------------------

IncludeFile "UI\FrameDef\UI\replaypanel.fdf",

// -- LOCAL TEMPLATES -------------------------------------------------------
Frame "SIMPLESTATUSBAR" "MyStatusBarBordered" {
   DecorateFileNames,
   Width 0.158,
   Height 0.012,
   BarTexture "SimpleBuildTimeIndicator",
   //BarTexture "SimpleHpBarConsole",
   //BarTexture "SimpleXpBarConsole",
   Frame "SIMPLEFRAME" "MyStatusBarBorder" {
       SetAllPoints,
       DecorateFileNames,

       Layer "ARTWORK" {
           Texture {
               //File "SimpleBuildTimeIndicatorBorder",
               File "SimpleXpBarBorder",
           }
           String "MyStatusBarText" INHERITS "ReplayPanelStringTemplate" {
               //FontJustificationH JUSTIFYLEFT,
               Text "Text",
           }

       }
   }
}

Frame "SIMPLESTATUSBAR" "MySimpleBar" {
   //No Border, no default Texture, no overlay Text
   Width 0.158,
   Height 0.012,
}

"MyStatusBar.toc"
Code:
war3mapImported\myStatusBar.fdf

JASS:
function FillBar takes nothing returns nothing
   local framehandle fh = BlzGetFrameByName("MyStatusBarBordered",10)
   call BlzFrameSetValue(fh, BlzFrameGetValue(fh) +1)
endfunction

function Trig_CreateBar_Actions takes nothing returns nothing
   local framehandle fh = BlzCreateSimpleFrame("MyStatusBarBordered", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 10)
   local framehandle fh2 = BlzGetFrameByName("MyStatusBarText",10)
   call BlzFrameSetAbsPoint(fh, FRAMEPOINT_CENTER, 0.3, 0.3)
   call BlzFrameSetValue(fh, 0) //Start Value
   call BlzFrameSetText(fh2, "|cffffffffSuper Custom fh2")
   call BlzFrameSetTexture(fh, "Replaceabletextures\\Teamcolor\\Teamcolor04.blp", 0, true) //Make the Bars Color Yellow use 00 to 27
   call TimerStart(CreateTimer(), 0.1, true, function FillBar)

endfunction

//===========================================================================
function InitTrig_MyStatusBar takes nothing returns nothing
    set gg_trg_MyStatusBar = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_MyStatusBar, 0.01 )
    call TriggerAddAction( gg_trg_MyStatusBar, function Trig_CreateBar_Actions )
    if BlzLoadTOCFile("war3mapImported\\mystatusbar.toc") then
       call BJDebugMsg("Loaded Toc")
    endif
endfunction

 
Last edited:
Level 3
Joined
Feb 25, 2018
Messages
15
Originframetypes are built in frames which one can manipulate or use as parents for own custom created frames. They are important cause the frame creation natives provided requier each frame to have a parent.
One can get a frame out of such an originframetype with that native.
JASS:
native BlzGetOriginFrame takes originframetype frameType, integer index returns framehandle
for the first argument pick one of the constants, for the second one choose in most cases 0, if the origin frame has more that 1, you can get other ones of that originframetype by using an higher number.

  • ORIGIN_FRAME_GAME_UI,
    • The game master frame without it nothing will be displayed.
  • ORIGIN_FRAME_WORLD_FRAME
    • the visible playground, units items effects fog ... every object participating in the game is displayed on it.
  • ORIGIN_FRAME_HERO_BAR
    • masterpanel of all ORIGIN_FRAME_HERO_BUTTON,
    • if you want to hide/show all HeroButons just toggle visibility for the HERO_BAR.
  • ORIGIN_FRAME_HERO_BUTTON [0 to 6]
    • the clickable buttons of own/allied heroes on the left of the screen
    • ORIGIN_FRAME_HERO_HP_BAR, connected to HeroButtons
    • ORIGIN_FRAME_HERO_MANA_BAR
    • ORIGIN_FRAME_HERO_BUTTON_INDICATOR
  • ORIGIN_FRAME_ITEM_BUTTON [0 to 5]
    • Items in the inventory. This frames Reappear/updates every selection.
  • ORIGIN_FRAME_COMMAND_BUTTON [0 to 11]
    • the buttons to order units around, like ITEM_BUTTON, they Reappear/update every selection.
  • ORIGIN_FRAME_SYSTEM_BUTTON [0 to 3] {Menu, allies, Log, Quest}
  • ORIGIN_FRAME_PORTRAIT
    • Face of the main selected Unit
  • ORIGIN_FRAME_MINIMAP
  • ORIGIN_FRAME_MINIMAP_BUTTON
    • Altering the Minimap, I forgot amount and order.
  • ORIGIN_FRAME_TOOLTIP
  • ORIGIN_FRAME_UBERTOOLTIP
  • ORIGIN_FRAME_CHAT_MSG, No Idea
  • ORIGIN_FRAME_UNIT_MSG, No Idea
  • ORIGIN_FRAME_TOP_MSG, No Idea
JASS:
function DebugOrigin takes nothing returns nothing
   local integer a = 0
   local integer b
   local integer lastHandle
   local integer current
   loop
       exitwhen a == 18
       set b = 0
       set lastHandle = 0
       loop
           set current = GetHandleId(BlzGetOriginFrame(ConvertOriginFrameType(a), b))
           exitwhen lastHandle == current
           call BJDebugMsg("["+I2S(a)+"]"+"["+I2S(b)+"]"+I2S(current))
           set lastHandle = current
           set b = b + 1
       endloop
       set a = a + 1
   endloop
endfunction

There is also an other way to get frames built in.
JASS:
native BlzGetFrameByName takes string name, integer createContext returns framehandle
The problem with BlzGetFrameByName is there is no nice clean list of valid names. Until now I found 3 which are not directly accessable with origingframetypes:

ConsoleUI {Many built in UI-Elements are in some relation to this one}.
UpperButtonBarFrame
ResourceBarFrame {Gold, Lumber, Food, Upkeep, FPS, APM, PING}

Another way is to jump up parents using BlzFrameGetParent framehandle fh, this is not always possible and jumping up to some parents will break the game.

Sometimes its nice to know where/which frame that is. I found that native quite useful in that case, although it did not always work or it seemd not to work if the frame was to big:
JASS:
call BlzFrameCageMouse(framehandle fh, true)
It forces the mouse into the frame.


They are used when positionating frames.
JASS:
native BlzFrameSetPoint takes framehandle frame, framepointtype point, framehandle relative, framepointtype relativePoint, real x, real y returns nothing
native BlzFrameSetAbsPoint takes framehandle frame, framepointtype point, real x, real y returns nothing

with BlzFrameSetPoint you set frame point offset by x/y to frame relative point.

For example BlzFrameSetPoint(Frame imgButton FRAMEPOINT_CENTER, mainButton FRAMEPOINT_CENTER, 0.0, 0.0) would place imgButton directly onto mainButton, if they have the same size. The abs position of mainButton on the screen does not matter here.


BlzFrameSetAbsPoint sets the framepoint to the absolute x/y of the screen.

For both natives x/y are factors of the screens size: 1 = 100% of the screens size of that dimension. 0/0 is at the left bottom corner and 1/1 at the right top corner. Even a hundredth has quite an impact on the result.


I have not used them yet, but they often mentioned in fdf (frame definition files) which are found in UI/Framedef/Glue or UI/Framedef/UI.

These fdf files contain frame templates one can create using the ui natives.


frameeventtypes are the possible events one can register to custom created frames. Not all frametypes can evoke events.
One registers a frameevent with
JASS:
native BlzTriggerRegisterFrameEvent takes trigger whichTrigger, framehandle frame, frameeventtype eventId returns event
Inside a callback function executed by that trigger one has following informations:
BlzGetTriggerFrame - the frame evoking the event
BlzGetTriggerFrameEvent - the frameeventtype evoked
GetTriggerPlayer - the player evoking the event. (only tested in Single Player)

to create custom Frames you need a fdf and know its content, the warcraft 3 built in are automatically loaded for custom ones one need to load a custom written toc file listing it.

There exist 3 Framecreating natives on 1.31 ptr.
JASS:
native BlzCreateFrame takes string name, framehandle owner, integer priority, integer createContext returns framehandle
native BlzCreateSimpleFrame  takes string name, framehandle owner, integer createContext returns framehandle
native BlzCreateFrameByType takes string typeName, string name, framehandle owner, string inherits, integer createContext returns framehandle
As one sees all 3 requier an owner framehandle. The difference between them is what the can create.
BlzCreateSimpleFrame can only create Frames having SIMPLEFRAME as 1.Keyword of the Frame definition head:
Code:
Frame "SIMPLEFRAME" x (INHERITS y) {
1.Keyword - SIMPLEFRAME
2.Keyword - x
one uses x as name to create.

BlzCreateFrameByType can create any Frame but it has more arguments then the others.
typename is the 1.Keyword
inherits is the 2.Keyword
name is a name you give this specific framehandle ,its for you.
createContext - no idea

I did no real tests with BlzCreateFrame.


Some Frames define subFrames when creating such a masterFrame you should also create sub Frames, if you want the behaviour that subFrames offer.

Code:
Frame "MENU" "StandardSmallPopupMenuMenuTemplate" {
    Height 0.048,
    DecorateFileNames,
    FrameFont "MasterFont",0.009,"",
    MenuTextHighlightColor 0.99 0.827 0.0705 1.0,
    MenuItemHeight 0.011,
    MenuBorder 0.009,

    ControlBackdrop "StandardPopupMenuMenuBackdropTemplate",
    Frame "BACKDROP" "StandardPopupMenuMenuBackdropTemplate" INHERITS "StandardBorderedButtonBackdropTemplate" {
    }
}
using BlzCreateFrameByType would look like that
JASS:
set mainFrame = BlzCreateFrameByType("MENU", "My PopUpMenu", parentFrame, "StandardSmallPopupMenuMenuTemplate",0)
set subFrame = BlzCreateFrameByType("BACKDROP", "My PopUpMenu", mainFrame, "StandardPopupMenuMenuBackdropTemplate",0)
one creates the mainFrame "StandardSmallPopupMenuMenuTemplate" and its children StandardPopupMenuMenuBackdropTemplate.
Normaly one would also have to set position and size of both to make them visible and useable.

Example for creating a clickable Button having an Icon.
JASS:
function TestFrameEvent takes nothing returns nothing
   //call BJDebugMsg("TestFrameEvent")
   //call BJDebugMsg("Player: "+GetPlayerName(GetTriggerPlayer()))
   call BJDebugMsg(BlzFrameGetName( BlzGetTriggerFrame()))
   if BlzGetTriggerFrameEvent() ==FRAMEEVENT_CONTROL_CLICK then
       call BJDebugMsg("FRAMEEVENT_CONTROL_CLICK")
   elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_MOUSE_ENTER then
       call BJDebugMsg("FRAMEEVENT_MOUSE_ENTER")
   elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_MOUSE_LEAVE then
       call BJDebugMsg("FRAMEEVENT_MOUSE_LEAVE")
   elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_MOUSE_DOWN then
       call BJDebugMsg("FRAMEEVENT_MOUSE_DOWN")
   elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_CHECKBOX_CHECKED then
       call BJDebugMsg("FRAMEEVENT_CHECKBOX_CHECKED")
   elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_CHECKBOX_UNCHECKED then
       call BJDebugMsg("FRAMEEVENT_CHECKBOX_UNCHECKED")
   endif
endfunction

function TestRegisterEvents takes framehandle fh returns nothing
local trigger trig = CreateTrigger()
   call TriggerAddAction(trig, function TestFrameEvent)
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_CONTROL_CLICK) //Button is clicked not supported by checkboxes
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_MOUSE_ENTER)
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_MOUSE_LEAVE)
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_CHECKBOX_CHECKED)
   call BlzTriggerRegisterFrameEvent(trig, fh, FRAMEEVENT_CHECKBOX_UNCHECKED)
endfunction

function TestClickableButton takes nothing returns nothing
   local framehandle mainbutton = BlzCreateFrameByType("TEXTBUTTON", "mainButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0), "StandardButtonTemplate",  0)
   local framehandle imgButton = BlzCreateFrameByType("BACKDROP", "imgButton", mainbutton, "ButtonBackdropTemplate",  0)
 
   call BlzFrameSetSize(mainbutton, 0.04, 0.04)
   call BlzFrameSetSize(imgButton, 0.04, 0.04)
   call BlzFrameSetTexture(imgButton, "ReplaceableTextures\\CommandButtons\\BTNPeasant.blp", 0, true)

   call BlzFrameSetAbsPoint(mainbutton, FRAMEPOINT_TOPLEFT, 0.4, 0.3)
   call BlzFrameSetPoint(imgButton, FRAMEPOINT_CENTER, mainbutton, FRAMEPOINT_CENTER, 0.0, 0.0)
 
   call TestRegisterEvents(mainbutton)
endfunction



This is more than I ever could have hoped for :) you are a saint!
 
Status
Not open for further replies.
Top