|
09-10-14, 06:18 AM | #1 |
Editbox under slider
Hi. Can I create a slider like this, with the yellow title at the top and the editbox bottom without ace libraries ? If so, how should I proceed?
|
|
09-10-14, 06:43 AM | #2 |
Yeah sure. Just create a slider first and after that editbox under it.
Combine: local slider = CreateFrame("Slider", "MySlider", nil, "OptionsSliderTemplate") slider:SetWidth(144) slider:SetHeight(17) slider:SetOrientation("HORIZONTAL") slider:SetThumbTexture("Interface\\Buttons\\UI-SliderBar-Button-Horizontal") slider:SetMinMaxValues(1,100) slider:SetValueStep(1) slider:SetValue(1) slider.tooltipText = 'Set the size of the note' getglobal(slider:GetName() .. 'Low'):SetText('Left') getglobal(slider:GetName() .. 'High'):SetText('Right') getglobal(slider:GetName() .. 'Text'):SetText('Text!') slider:SetScript("OnValueChanged", function(self, newvalue) UpdateMySlider() end) and local editbox = CreateFrame("EditBox", "MyEditBox", nil) editbox:SetPoint("TOP") editbox:SetPoint("LEFT") editbox:SetPoint("RIGHT") editbox:SetHeight(100) editbox:SetFontObject(GameFontHighlightSmall) editbox:SetTextInsets(2,2,2,2) editbox:SetMultiLine(false) editbox:SetAutoFocus(true) editbox:SetScript("OnEscapePressed", function() editbox:ClearFocus() end) editbox:SetScript("OnEditFocusLost", function(self) editbox:ClearFocus() end) editbox:SetScript("OnShow", function(self) self:SetText("") self:SetFocus() end) Tweak and tune the rest. |
|
09-10-14, 08:49 AM | #3 |
As I build four similar slider in xml, there is a container (frame?) where put everything inside to be used as a model to inherit?
|
|
09-10-14, 10:05 AM | #4 |
Create a new <frame> tag, add the virtual attribute, and place your stuff into <Frames></Frames> within the new frame.
Then use the new frame to inherit from. |
|
09-10-14, 10:18 AM | #5 |
The editbox beneath the slider in ace3 libraries what inherits? I would reproduce the same smooth frame , but I have no idea how to do it
|
|
09-10-14, 10:41 AM | #6 |
It doesn't inherits from something. They build those widgets from a scratch:
Lua Code:
|
|
09-11-14, 08:18 PM | #7 |
From this page: "Backdrops are deprecated in favour of the new tiling mechanisms". What it the new tiling mechanism?
|
|
09-11-14, 11:45 PM | #8 |
Backdrops weren't deprecated after all (they're still widely used in the default UI, and work just as they always have) but the "tiling mechanism" is the ability for textures to be tiled. Let's say you have a frame that's 400px square, and a texture file that's 100px square.
Code:
local tex = frame:CreateTexture(nil, "BACKGROUND") tex:SetAllPoints() tex:SetTexture("Path//To//The//Texture") Code:
tex:SetHorizTile(true) Code:
tex:SetVertTile(true) There's no way to control the tile size; it will always use the real pixel dimensions of the source file. The idea was that Blizzard was going to use this, plus a series of individual textures to make up the border, and they do use this system on some newer things like the battle pet tooltip, but backdrops are still a thing.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
09-12-14, 09:37 AM | #9 |
Since i'm pretty sure i'll need this in the future here is a lua only fancy slider, it's pretty basic yet but still much better then the blizzard ones.
Lua Code:
Last edited by Resike : 09-12-14 at 09:52 AM. |
|
WoWInterface » Developer Discussions » Lua/XML Help » Editbox under slider |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Hybrid Mode |
Switch to Threaded Mode |
|
|