Thread Tools Display Modes
04/25/14, 12:05 PM   #1
Artajörn
Join Date: Apr 2014
Posts: 19
Question How can I add an horizontal line?

Hi,

I would like to add an horizontal line under the header in the window of my addon (like those which appears in the windows of the main menu). Does anyone know how can I do it?

Regards and thanks in advance.
  Reply With Quote
04/25/14, 12:28 PM   #2
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
I believe you will need something like (sorry only working with LUA not xml)

Lua Code:
  1. local line  = CreateControl(nil, <youraddonwindowobject>,  CT_LINE)
  2. line:SetAnchor(TOPLEFT, <youraddonwindowobject>, TOPLEFT, 0, 10)
  3. line:SetAnchor(TOPRIGHT, <youraddonwindowobject>, TOPRIGHT, 0, 10)

to see methods of line http://wiki.esoui.com/Controls#LineControl
  Reply With Quote
04/25/14, 12:38 PM   #3
mra4nii
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
If is about menu window LibAddonMenu have this, you should use it and make your live easier
If not for menu, try this for header control of your window:
control.controlType = OPTIONS_SECTION_TITLE

Last edited by mra4nii : 04/25/14 at 12:46 PM.
  Reply With Quote
04/27/14, 01:05 PM   #4
Artajörn
Join Date: Apr 2014
Posts: 19
I have tried with:

Code:
<Line name="HeaderSeparator">
	<Anchor offsetY="77" point="CENTER" relativeTo="$(parent)"/>
	<Dimensions x="780" y="10"/>
</Line>
But it's useless.
  Reply With Quote
04/27/14, 01:52 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
The default UI just uses a regular texture control.
  Reply With Quote
04/27/14, 02:56 PM   #6
Stormknight
 
Stormknight's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 128
There's a number of line textures. I'll post them tomorrow after work.
  Reply With Quote
04/27/14, 04:15 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
Or, if you just want a solid color, don't set a texture path and just change the color to what you want it to be.
  Reply With Quote
04/28/14, 04:33 PM   #8
Stormknight
 
Stormknight's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 128
Here's the line textures I found:

/esoui/art/miscellaneous/wide_divider_left.dds
/esoui/art/miscellaneous/wide_divider_right.dds
/esoui/art/progression/ability_line.dds
/esoui/art/quest/questjournal_divider.dds

So to create the line I do something like (assuming a top level control of MyAddonTLC:
Lua Code:
  1. TopDivider = WINDOW_MANAGER:CreateControl("MyAddonTopDivider", MyAddonTLC, CT_TEXTURE)
  2. TopDivider:SetDimensions(760, 5)
  3. TopDivider:SetAnchor(TOPLEFT, AIResearchGrid, MyAddonTLC, 0, 32)
  4. TopDivider:SetTexture("/esoui/art/quest/questjournal_divider.dds")
  Reply With Quote
05/02/14, 05:10 AM   #9
Artajörn
Join Date: Apr 2014
Posts: 19
Hi,

First of all, thank you very much for your answers.

I'm trying with:

Code:
<Line name="IFTESO_ResearchHeaderSeparator" textureFile="esoui/art/quest/questjournal_divider.dds">
	<Anchor offsetY="77" point="TOP" relativeTo="$(parent)"/>
	<AnchorFill/>
	<Dimensions x="780" y="5"/>
</Line>
Now the line is shown but it is shown diagonally rather than horizontally. Does anyone know how to fix it?

Thanks in advance!

Last edited by Artajörn : 05/02/14 at 06:26 AM.
  Reply With Quote
05/02/14, 05:15 AM   #10
Stormknight
 
Stormknight's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 128
Could you post your code that creates the line, so we can see it?
  Reply With Quote
05/02/14, 06:27 AM   #11
Artajörn
Join Date: Apr 2014
Posts: 19
Sorry I forgot to put the code, hehehehe.
  Reply With Quote
05/02/14, 07:06 AM   #12
Stormknight
 
Stormknight's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 128
I've not tried using the line control before, so can't offer advice on that.

When I needed a line, I just used the texture control.
  Reply With Quote
05/02/14, 08:09 AM   #13
Artajörn
Join Date: Apr 2014
Posts: 19
Originally Posted by Stormknight View Post
I've not tried using the line control before, so can't offer advice on that.

When I needed a line, I just used the texture control.
And how do you do that?
  Reply With Quote
05/02/14, 08:29 AM   #14
Halja
 
Halja's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 111
Put a second anchor for the bottom right. That will help set the bounds for the textures height and width of you divider line.
--Halja
  Reply With Quote
05/02/14, 01:07 PM   #15
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
You added two anchors in your XML. Remove the AnchorFill line.
  Reply With Quote
05/04/14, 07:28 AM   #16
Artajörn
Join Date: Apr 2014
Posts: 19
When I remove the AnchorFill line, nothing is displayed.

However I'm going to remake my addon to create a better project and I will create the GUI in Lua. I'll post here if I find problems to implement the horizontal line in Lua.

Regards and thank you very much for your answers!
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » How can I add an horizontal line?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off