Go Back   WowAce Forums > Addon Chat > AddOn HELP!
AddOn HELP! Requests for assistance and misc bug reports go here.

Reply
 
Thread Tools
Old 01-18-2012   #1
Animoral
Member
 
Join Date: Aug 2009
Posts: 15
Default Making a frame with History scrolling text

Hello,

I'm quite new to addon design, and I'm making my addon an Ace3 addon.
One of the features I want to implement is "whisper history window", which will do the following:

1. The history window will be a dragable window with a "close" button.
2. The window will be openned by a slash command or a button in the addon config panel.
3. The window will contain rows of text taken from the savedVariable. each row will be history of a chat whisper, and will include 3 fields: date/time, sender, message.
4. The window will contain a scrolling bar, in case there are too many whispers to show.

Can it be done using Ace3 libs?
I will be thankfull for any help, guidance or links to a relevant doc.

Thanks
Animoral is offline   Reply With Quote
Old 01-18-2012   #2
ace329281301
Member
 
ace329281301's Avatar
 
Join Date: Jan 2012
Posts: 15
Default Re: Making a frame with History scrolling text

1. you need this
2.&4. read about this and AceConfig
3. AceDB , and you need do some research on "CHAT_MSG_BN_WHISPER" & "CHAT_MSG_WHISPER" 2 events, which will fired when you got wisper message

Last edited by ace329281301; 01-18-2012 at 05:00 PM.
ace329281301 is offline   Reply With Quote
Old 01-18-2012   #3
Animoral
Member
 
Join Date: Aug 2009
Posts: 15
Default Re: Making a frame with History scrolling text

Hi,

Thank you for your answer.
I'm already read these documents. I know how to collect the whispers data. What I'm missing is how to use the ACE GUI: how to actually draw the window, how to display the text lines in it (assuming I already have it in a table), how to make it scrollable.

Thanks
Animoral is offline   Reply With Quote
Old 01-18-2012   #4
Morgalm
Hero Member
 
Join Date: Sep 2006
Posts: 802
Default Re: Making a frame with History scrolling text

Whisp does alot of the same things you could check it's code out.
Morgalm is offline   Reply With Quote
Old 01-19-2012   #5
Phanx
Seal Cub Clubbing Club
 
Phanx's Avatar
 
Join Date: May 2005
Location: United States
Posts: 8,197
Default Re: Making a frame with History scrolling text

Don't use AceGUI. There is pretty much no reason for anyone to ever use AceGUI directly. If what you want to do can't be done with an options table through AceConfig, just build your own GUI using the standard widget API.

- http://www.wowpedia.org/Widget_API
- http://www.wowpedia.org/Widget_Handlers
__________________
Author/maintainer of Grid, PhanxChat, and many more. | PM me on CurseForge
Troubleshoot an addon | Turn any code into an addon | More addon resources
Need help with your code? Attach or paste your whole, real files.
Please don't PM me about addon bugs, requests, or code help. Post a comment, ticket, or thread instead!
Phanx is offline   Reply With Quote
Old 01-20-2012   #6
Animoral
Member
 
Join Date: Aug 2009
Posts: 15
Default Re: Making a frame with History scrolling text

Hi,

I tried working with the standard API, but making a scrollframe for text was a bit complex for me. Other addons I looked at did it with XML. So I ended up using Ace-GUI, and it worked.

Only problem is the window is not being closed when hitting "escape", and this is very annoying. Any idea how to make it close with "escape"?
This is my code:
Code:
local historyFrame = AceGUI:Create("Frame")
	historyFrame:SetTitle(L["History"])
	historyFrame:SetStatusText("")
	historyFrame:SetCallback("OnClose", function(widget) AceGUI:Release(widget) end)		
	historyFrame:SetLayout("Fill")
		
	local historyEditbox = AceGUI:Create("MultiLineEditBox")
	historyEditbox:SetText(historyText) 	
	historyEditbox:SetWidth(800)
	historyEditbox:DisableButton(true)
	historyEditbox:SetLabel("")
	historyEditbox:SetNumLines(20)
	historyEditbox:SetMaxLetters(999999)
	historyFrame:AddChild(historyEditbox)
Thanks!
Animoral is offline   Reply With Quote
Old 01-20-2012   #7
Dridzt
Hero Member
 
Dridzt's Avatar
 
Join Date: Nov 2005
Posts: 873
Default Re: Making a frame with History scrolling text

http://www.wowpedia.org/Make_Frames_..._%22Esc%22_Key
Dridzt is offline   Reply With Quote
Old 01-20-2012   #8
Animoral
Member
 
Join Date: Aug 2009
Posts: 15
Default Re: Making a frame with History scrolling text

Quote:
Originally Posted by Dridzt View Post
I saw that before posting here, but it didn't work. I guess I didn't manage to add
Code:
tinsert(UISpecialFrames,"MainFrameName");
to my code correctly.

What is the exact line I should add?
Animoral is offline   Reply With Quote
Old 01-20-2012   #9
Farmbuyer
Amazing Member
 
Farmbuyer's Avatar
 
Join Date: Feb 2005
Posts: 1,114
Default Re: Making a frame with History scrolling text

Give a name in the CreateFrame call, and then pass that string name in the line above.
__________________
In wizardry, one must often be willing to consider serendipitous events as unqualified successes. -Vaarsuvius
Farmbuyer is offline   Reply With Quote
Old 01-20-2012   #10
Animoral
Member
 
Join Date: Aug 2009
Posts: 15
Default Re: Making a frame with History scrolling text

I looked into Libs\AceGUI-3.0\widgets\AceGUIContainer-Frame.lua and I don't think they use a name:
Quote:
local frame = CreateFrame("Frame", nil, UIParent)
Can I override it from my addon and give the frame a name?

Last edited by Animoral; 01-20-2012 at 02:10 AM.
Animoral is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

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

Forum Jump


All times are GMT. The time now is 07:54 PM.