Thread Tools Display Modes
07-17-11, 06:35 AM   #1
lerb
A Frostmaul Preserver
 
lerb's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 264
Requesting help with a kgPanel script :)

Hey there guys! I posted this over at MMOChampion aswell but I'm impatient and I prefer these forums, so here we go :P

The function I want is basically this;

I create a panel with kgPanels and use it as background to my chat, lets call it Background_frame. The chat-addon I'm using is Chatter. On top of the Background_frame, I create another panel, called Minimize_frame.
When you press the Minimize_frame, the Minimize_Frame itself and the Background_frame hides, and Chatter minimizes down to a single line of text.
Now, behind my minimized Chatter, I create a frame called Maximize_frame, and when you press that, Maximize_frame hides, Background_frame and Minimize_frame shows, and Chatter maximizes.

This creates a minimize/maximize function that triggers on mouseclicks. Of course, if anyone willing to help me with this figures out a better way of doing this, I'm happy aswell

Credits for help will be given on the page for my UI over here (Or, if you prefer not to, I'll just adore you in silence )
  Reply With Quote
07-17-11, 08:44 AM   #2
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
Maybe this will help: kgPanels Wiki-Resizing your panel on-the-fly

While it won't hide your panel, it will change size depending on the size of the parent object. The specific example script is for a chat frame.

It's worth a look, anyway.
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!

Last edited by jeffy162 : 07-17-11 at 08:50 AM.
  Reply With Quote
07-17-11, 03:51 PM   #3
lerb
A Frostmaul Preserver
 
lerb's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 264
Well, that worked almost! It resizes the frame, but to the centre.. My english is limited, I'll try to explain.

When i minimize the chat, i only want to pull the top border downwards, until there's only one line of text showing.

This script however, pulls both the top and the bottom border towards the middle. Would be awesome if it only pulled the top border and the bottom part was "static". I hope i explain good enough for someone to understand.

I guess that would be a whole other script.

EDIT; Nevermind, all i had to do was to anchor it to ChatFrame1 :P

Last edited by lerb : 07-17-11 at 03:57 PM.
  Reply With Quote
07-17-11, 09:26 PM   #4
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
That was going to be my question: "Did you anchor the panel to the chatframe?"

I'm glad you got it working. Your English is fine. Better than quite a few native English speakers I've seen posting on forums.
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!
  Reply With Quote
07-18-11, 05:02 AM   #5
lerb
A Frostmaul Preserver
 
lerb's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 264
Thanks

Now, a new problem surfaced :P When i minimize the chat, i set it to Height(25) so that it only shows one line of text. However, if someone writes a long message that fills say 3 lines, it shows all that text. Doesn't look very good :P

Is there a way to prevent this? I looked through Chatters settings but i couldn't find anything.
  Reply With Quote
07-18-11, 11:11 AM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
No. Messages are hidden/shown in total. Since the message is too long to display in your chat frame, the text runs out of the frame.

Now... There may be a way to suppress it from showing at all (but then you wouldn't know that there was a new message), or there may be a way to have the chat frame change sizes to fit it, but...
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-19-11, 04:15 AM   #7
lerb
A Frostmaul Preserver
 
lerb's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 264
Thanks for the answer Seerah

Basically, I'm creating buttons and stuff to press to hide different elements of the UI, much like you can in LUI (if I remember correctly). I really liked that. If I'm doing dailys or just a weekly dungeon, I don't need my map shown, and if I'm fishing i probably only want to see my chat. Like that.

So, a way to hide the text is what I'm looking for. I'm pretty sure it's possible, i just lack the knowledge
  Reply With Quote
07-19-11, 04:47 AM   #8
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
What if you set:
Code:
CHAT_FRAME_NORMAL_MIN_HEIGHT = 25
CHAT_FRAME_BIGGER_MIN_HEIGHT = 25
  Reply With Quote
07-19-11, 06:16 AM   #9
lerb
A Frostmaul Preserver
 
lerb's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 264
I'm not sure I understand Nibelheim, where should I put that and what would it do?
  Reply With Quote
07-19-11, 02:49 PM   #10
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by lerb View Post
I'm not sure I understand Nibelheim, where should I put that and what would it do?
Well, for now just whack those two lines into your minimize script, maybe where you set the chat height.
  Reply With Quote
07-19-11, 03:46 PM   #11
lerb
A Frostmaul Preserver
 
lerb's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 264
I've been puzzling and shmuzzling all night with the chat, and I've finally got something that works well.

I downloaded Chicchai, the addon that minimizes the chat down to one message and disabled all automatic maximizes/minimizes. Then I created a button to call for ChatFrame1:Minimize() and another button to call for ChatFrame2:Maximize(). In Chicchai I could set height values for both. The tricky part was to get a parented kgPanel scripted to resize height-wise according to ChatFrame1, to always fit to the chat, since the chats height is always different. But, after a few cups of coffee, I think I got it right.

Chicchai is old tho, and no longer updated. I hope someone does so soon though

Thanks for all your help guys, but I think i have what I was looking for now.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Requesting help with a kgPanel script :)


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