View Single Post
02-18-11, 11:49 AM   #9
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
i got the scroll frames down that was easy... now im fighting with my old nemesis again... tables and creating lots of frames based on table entry's...

What im trying to do now is make it so that i add buttons and their corresponding big chunk of text within a table so i can add buttons and change text within the table and never mess with anything else again. So of course i need to have it set up the buttons in the left scrollframe according to number of table entry's... the tricky part starts to be when i try to later have it do the settext stuff...

my real problem lies within the use of names in the global space because i still seem to be confused about what doing something.something.something = something.something:createsomething(blahblahblah, itsname, blahblah) does and how come i cant make changes to the frame later by the name in the itsname location and can only use the something.something.something to call it again and when im forced to use the something.something.something is it possible to put variables into the .somethings somehow?

this is what i have it doesnt not work this way or at lest this is the chunk im playing with if i showed the whole thing you'd see lots of commented out stuff and nonsense from me trying to figure it out. You can see the table at the top. right now im just trying to get the text to show up and figure out what method of something.something = createsomething(name) i need to use in order to use the names later outside of that for statement... i did get it to work by writing out each button but... thats a pain and lots of unnecessary lines of code...
Obi-Vrul-Kanobi is prolly gonna show up and shake his head at me considering hes tried to explain this to me a few times lol.

lua Code:
  1. local HelpHeaders = {
  2.     ['General'] = 'blahblahgeneral',
  3.     ['Buttons'] = 'blahblahbuttons',
  4.     ['Frame Mover'] = 'blahblahmover',
  5.     ['Chat'] = 'blahblahchat',
  6.     ['Tooltips'] = 'blahblahtooltips',
  7.     ['Unit Frames'] = 'blahblahunitframes',
  8.     ['Backpack'] = 'blahblahbakpak',
  9.     ['DashBoard'] = 'blahblahdashboard',
  10.     ['HUD'] = 'blahblahhud',
  11.     ['Development'] = 'blahblahdevtools',
  12. }
  13.  
  14. local LeftScrollBar = CreateFrame("Frame", "LeftScrollBar", GUIHelpFrame)
  15. LeftScrollBar:SetPoint("TOPLEFT", GUIHelpFrame, "TOPLEFT", 0, 0)
  16. LeftScrollBar:SetHeight("440")
  17. LeftScrollBar:SetWidth("170")
  18.  
  19. LeftScrollBar.scrollSize = 600
  20. LeftScrollBar.scrollFrame = CreateFrame( "ScrollFrame", "$parent_ScrollFrame", LeftScrollBar, "UIPanelScrollFrameTemplate" );
  21. LeftScrollBar.scrollFrame:SetHeight(LeftScrollBar:GetHeight())
  22. LeftScrollBar.scrollBar = _G[LeftScrollBar.scrollFrame:GetName() .. "ScrollBar"];
  23. LeftScrollBar.scrollFrame:SetWidth( LeftScrollBar:GetWidth());
  24. LeftScrollBar.scrollFrame:SetPoint( "TOPLEFT", 10, -30 );
  25. LeftScrollBar.scrollFrame:SetPoint( "BOTTOMRIGHT", -30, 10 );
  26.  
  27. LeftScrollBar.scrollChild = CreateFrame( "Frame", "$parent_ScrollChild", LeftScrollBar.scrollFrame );
  28. LeftScrollBar.scrollChild:SetHeight( LeftScrollBar.scrollSize );
  29. LeftScrollBar.scrollChild:SetWidth( LeftScrollBar.scrollFrame:GetWidth() );
  30. LeftScrollBar.scrollChild:SetAllPoints( LeftScrollBar.scrollFrame );
  31. LeftScrollBar.scrollFrame:SetScrollChild( LeftScrollBar.scrollChild );
  32.  
  33. local RightScrollBar = CreateFrame("Frame", "RightScrollBar", GUIHelpFrame)
  34. RightScrollBar:SetPoint("TOPRIGHT", GUIHelpFrame, "TOPRIGHT", -50, 0)
  35. RightScrollBar:SetHeight("420")
  36. RightScrollBar:SetWidth("380")
  37. RightScrollBar.scrollSize = 600
  38.  
  39. RightScrollBar.scrollFrame = CreateFrame( "ScrollFrame", "$parent_ScrollFrame", RightScrollBar, "UIPanelScrollFrameTemplate" );
  40. RightScrollBar.scrollFrame:SetHeight(RightScrollBar:GetHeight())
  41. RightScrollBar.scrollBar = _G[RightScrollBar.scrollFrame:GetName() .. "ScrollBar"];
  42. RightScrollBar.scrollFrame:SetWidth( RightScrollBar:GetWidth());
  43. RightScrollBar.scrollFrame:SetPoint( "TOPRIGHT", 10, -30 );
  44. RightScrollBar.scrollFrame:SetPoint( "BOTTOMRIGHT", -30, 10 );
  45.  
  46. RightScrollBar.scrollChild = CreateFrame( "Frame", "$parent_ScrollChild", RightScrollBar.scrollFrame );
  47. RightScrollBar.scrollChild:SetHeight( RightScrollBar.scrollSize );
  48. RightScrollBar.scrollChild:SetWidth( RightScrollBar.scrollFrame:GetWidth() );
  49. RightScrollBar.scrollChild:SetAllPoints( RightScrollBar.scrollFrame );
  50. RightScrollBar.scrollFrame:SetScrollChild( RightScrollBar.scrollChild );
  51.  
  52.  
  53. for bnid = 1, #HelpHeaders do
  54.    
  55.     LeftScrollBar.scrollChild.button = CreateFrame('button', "HHeaderButton" .. bnid, LeftScrollBar.scrollChild)
  56.        
  57.     LeftScrollBar.scrollChild.button.text = LeftScrollBar.scrollChild.button:CreateFontString("HHeaderButtonText" .. bnid, 'DIALOG')
  58.     LeftScrollBar.scrollChild.button.text:SetFont([[Fonts\FRIZQT__.TTF]], 14)
  59.     LeftScrollBar.scrollChild.button.text:SetPoint("CENTER", LeftScrollBar.scrollChild.button, "CENTER", 0, 0)
  60.     LeftScrollBar.scrollChild.button.text:SetTextColor(.50, .90, .80, 1)
  61.    
  62. end
  63.  
  64. HHeaderButtonText1:SetText("General")
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 02-18-11 at 12:01 PM.
  Reply With Quote