I love the smell of UnrealEd crashing in the morning. – tarquin
This is the superclass for all widgets that can be displayed on the UT200x GUI.
- string IniOption
- Points to the INI option to load for this component (what does that mean then?).
- string IniDefault
- The default value for a missing ini option.
- string StyleName
- Name of my Style.
- bool bBoundToParent
- Use the Parent's Bounds for all positioning.
- bool bScaleToParent
- Use the Parent for scaling.
- bool bHasFocus
- Does this component currently have input focus.
- bool bVisible
- True if this component currently visible.
- bool bAcceptsInput
- True if this control accepts input.
- bool bCaptureTabs
- This control wants tabs.
- bool bCaptureMouse
- Set this if the control should capture the mouse when pressed. Note: Setting to false on components that use the OnMouseRelease() delegate allows users to cancel the action by moving the cursor off the component before release. (which is a common standard GUI practice for Windows, Mac, Flash, etc.)
- bool bNeverFocus
- This control should never fully receive focus.
- bool bRepeatClick
- Have the system accept holding down of the mouse.
- bool bRequireReleaseClick
- If True, this component wants the click on release even if it's not active.
- GUIComponent FocusInstead
- Who should get the focus instead of this control if bNeverFocus is true.
- localized string Hint
- The hint that gets displayed for this component.
- float WinTop, WinLeft, WinWidth, WinHeight
- These set the size and position of this component relative to its parent. If a value is <= 1 then the position is calculated as WinTop * parent component's value. If this value is > 1 then a value in pixels possibly is used. Using pixels means the component will have a different size relative to the whole screen at different screen resolutions.
- int MouseCursorIndex
- The mouse cursor to use when over this control.
- bool bTabStop
- Does a TAB/Shift-Tab stop here.
- bool bFocusOnWatch
- If true, watching focuses.
- int Tag
- Not used allegedly.
- GUILabel FriendlyLabel
- My state is projected on this object's state. (as in GUIMenuOption)
- bool bMouseOverSound
- Should component bleep when mouse goes over it.
- enum OnClickSound EClickSound
- The sound the component makes if sound is required.
(See also Delegate.)
Drawing delegates return true if you want to short-circuit the default drawing code
- bool OnPreDraw (Canvas Canvas)
- Called before the component is rendered. Return True to skip the native PreDraw code.
- bool OnDraw (Canvas Canvas)
- Called whenthe component is rendered. Return True to skip the native Draw code. Only works for GUIPage and GUIPanel in UT2003.
- OnActivate ( )
- Called when the component gains focus
- OnDeActivate ( )
- Called when the component loses focus
- OnWatch ( )
- Called when the component is being watched
- OnHitTest (float MouseX, float MouseY)
- Called when Hit test is performed for mouse input
- OnRender (Canvas Canvas)
- Broken in UT2003. (never called)
- OnMessage (coerce string Msg, float MsgLife)
- When a message comes down the line
- OnInvalidate ( )
- Called when the background is clicked
Input event delegates
- bool OnClick (GUIComponent Sender)
- The mouse was clicked on this control
- bool OnDblClick (GUIComponent Sender)
- The mouse was double-clicked on this control
- bool OnRightClick (GUIComponent Sender)
- Control was right clicked.
- OnMousePressed (GUIComponent Sender, bool bRepeat)
- Sent when a mouse is pressed (initially)
- OnMouseRelease (GUIComponent Sender)
- Sent when the mouse is released.
- OnChange (GUIComponent Sender)
- Called when a component changes its value. Beware: while mouse and key delegates have native magic that calls them when things happen, this one does not appear to. Unless your custom widget inherited it, you may need to explicitly call this in at an appropriate point.
- bool OnKeyType (out byte Key, optional string Unicode) Key Strokes
- bool OnKeyEvent (out byte Key, out byte State, float delta)
- bool OnCapturedMouseMove (float deltaX, float deltaY)
- OnLoadINI (GUIComponent Sender, string s)
- Do the actual work here
- string OnSaveINI (GUIComponent Sender)
- Do the actual work here
- function InitComponent(GUIController MyController, GUIComponent MyOwner)
See GUI Class Hierarchy for a full tree.
Tarquin: There seem to be two ways to define properties of components of a window or panel: use an inline object in the default properties, or use InitComponent(). I;m baffled about this in the defaults though (it's Jailbreak code BTW)
I can't see where JBAddonProtection.JBGUIPanelProtectionConfig.ResetButton was defined. Does that statement actually create the GUIButton object and define its name?
Mychaeel: The benefit from doing it in the defaultproperties section is that it happens at compile time rather than run time. Plus, it looks neater. – As for that GUIButton, if I'm looking at the same source as you are, it's defined just above that line. (The "JBAddonProtection.JBGUIPanelProtectionConfig." part is just the full qualifier of that object template.)
Tarquin: I exported the source from UEd. I must be missing something – I have no "BeginObject" at all in there.
RealmRPGer: Like a lot of other things, GUIComponents don't work well with gamepads. The OnKeyEvent doesn't catch button releases while at the same time simultaneously receiving pressed and held events of the same button.