Thread Tools Display Modes
07-26-06, 11:21 AM   #1
hop
A Murloc Raider
Join Date: May 2006
Posts: 6
Accessing ScrollingMessageFrame

I'm sure there is some basic thing I'm not doing here, but I've searched for examples and haven't found any.

I'm using wowuides and created an XML form. I added a button that hides the form, events for moving, etc. and all works fine. I then drew a ScrollingMessageFrame on my form, and tried to add a message to it from my LUA, and I got an error, so I read the fact and tried using the suggestion local label = getglobal("ProjectForm".."VersionText".."Label") *changing the names of course* and now I get the error attempt to index local `myobj' (a nil value) .

The name of the ScrollingMessageFrame is $parentScrollingMessageFrame1 and the form is HopWorksTools01. Here is how I tried to access it from my LUA code

Code:
function print(text)
    DEFAULT_CHAT_FRAME:AddMessage(text)
    local myobj = getglobal("HopworksToolsForm01".."ScrollingMessageFrame1".."ScrollingMessageFrame")
    myobj:AddMessage(text)
end
I also tried
Code:
local myobj = getglobal("HopworksToolsForm01".."ScrollingMessageFrame1")
because I didn't know what that third field was for. From the example, I assume it's for the type of the object.

Can someone tell me what I'm missing here?
Thanks!
__________________
"My Grill is my Sidewalk"
Lifelong Arizona Resident

Last edited by hop : 07-26-06 at 11:38 AM.
  Reply With Quote
07-26-06, 06:20 PM   #2
Nulkris
A Cobalt Mageweaver
 
Nulkris's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 214
The form:
Code:
local myobj = getglobal("HopworksToolsForm01".."ScrollingMessageFrame1")
is correct as you can access the frame directly. To be sure, name your ScrollingMessageFrame something like HopworksToolsSMF1, and do a call
Code:
HopworksToolsSMF1:AddMessage(text)
to see if that works (no need for a getglobal call).
__________________
Nulkris - A80 Rogue - Proudmoore
(Also Drukris, Hamkris on Proudmoore; Hulkris on Jubei'Thos & Khaz Modan)
  Reply With Quote
07-27-06, 01:44 PM   #3
hop
A Murloc Raider
Join Date: May 2006
Posts: 6
Hey Nulkris! Thanks for responding.

I tried what you suggested and it worked just fine. I must have had $parent in front of the name last time, and I thought it had to be there to make the object visible. It didn't make sense to me, but I'm still new at XML and LUA, although LUA is a bit like PHP to me.

Anyway, thanks for clearing up that noob question for me. =)

Hop
__________________
"My Grill is my Sidewalk"
Lifelong Arizona Resident
  Reply With Quote
07-27-06, 03:26 PM   #4
hop
A Murloc Raider
Join Date: May 2006
Posts: 6
Now I'm having another issue with that scrolling message frame object...

I can't seem to get it to display more lines. I put in 100 for maximum lines in the behavior properties, but it always reverts back to 8 lines. I save it, exit wowuides, start it again, and load my project, and again it is set to 8 lines. What am I doing wrong there?

Sorry to keep beating a dead horse here, but I want to use this control to display output from my functions, and filtered chat data, and 8 lines isn't gonna do it. =)

Thanks again for all the help!

Hop
__________________
"My Grill is my Sidewalk"
Lifelong Arizona Resident
  Reply With Quote
07-27-06, 07:41 PM   #5
Nulkris
A Cobalt Mageweaver
 
Nulkris's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 214
New Basic Skin file

Ok, looks like I missed out a few things on the skin file, you can unzip the attachment to this message, and overwrite the BasicSkin.xml file in the skins directory to get it working properly.
Attached Files
File Type: zip BasicSkin27Jul06.zip (4.5 KB, 841 views)
__________________
Nulkris - A80 Rogue - Proudmoore
(Also Drukris, Hamkris on Proudmoore; Hulkris on Jubei'Thos & Khaz Modan)
  Reply With Quote
07-28-06, 01:03 PM   #6
hop
A Murloc Raider
Join Date: May 2006
Posts: 6
Yes sir! That did it! Thanks for the personal attention!

Now one last thing, and I wouldn't ask it except a wowwiki search on this control turned up very little info.

How do you attach a scroll bar? Hmm. Come to think of it, the original chat windows don't have scroll bars.

Sigh. I guess I could use a slider. The important thing is I can see more lines now. Thank you!

Can I get your thoughts on that scroll bar idea though?

If I haven't said it sooner, I really love this application. It's throwing an exception error when I close a project and then reopen it, but it's not lethal. Here's the info on the error...

Code:
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at WeifenLuo.WinFormsUI.DockPaneTabCollection.IndexOf(DockPaneTab tab)
   at WeifenLuo.WinFormsUI.DockPaneStripVS2003.CalculateTabs_Document()
   at WeifenLuo.WinFormsUI.DockPaneStripVS2003.CalculateTabs()
   at WeifenLuo.WinFormsUI.DockPaneStripVS2003.OnRefreshChanges()
   at WeifenLuo.WinFormsUI.DockPaneStripBase.RefreshChanges()
   at WeifenLuo.WinFormsUI.DockPane.RefreshChanges(Boolean bPerformLayout)
   at WeifenLuo.WinFormsUI.DockPane.RefreshChanges()
   at WeifenLuo.WinFormsUI.DockContentHandler.RefreshDockPane(DockPane pane)
   at WeifenLuo.WinFormsUI.DockContentHandler.SetDockState(Boolean isHidden, DockState visibleState, DockPane oldPane)
   at WeifenLuo.WinFormsUI.DockContentHandler.set_DockState(DockState value)
   at WeifenLuo.WinFormsUI.DockContentHandler.Show(DockPanel dockPanel, DockState dockState)
   at WeifenLuo.WinFormsUI.DockContentHandler.Show(DockPanel dockPanel)
   at WeifenLuo.WinFormsUI.DockContent.Show(DockPanel dockPanel)
   at wowuides.MainForm.OpenFile(FileInfo fi, Int32 line, Int32 column, Int32 offset, Type designer)
   at wowuides.MainForm.RecentFile_OpenClick(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
wowuides
    Assembly Version: 1.0.300.0
    Win32 Version: 1.0.300.8
    CodeBase: file:///C:/Program%20Files/WoW%20UI%20Designer/wowuides.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
WeifenLuo.WinFormsUI.Docking
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/WoW%20UI%20Designer/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
9pcddovt
    Assembly Version: 1.0.300.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
tr_fyzqv
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
ActiproSoftware.SyntaxEditor.Net20
    Assembly Version: 3.1.211.0
    Win32 Version: 3.1.211.0
    CodeBase: file:///C:/Program%20Files/WoW%20UI%20Designer/ActiproSoftware.SyntaxEditor.Net20.DLL
----------------------------------------
ActiproSoftware.Shared.Net20
    Assembly Version: 1.0.81.0
    Win32 Version: 1.0.81.0
    CodeBase: file:///C:/Program%20Files/WoW%20UI%20Designer/ActiproSoftware.Shared.Net20.DLL
----------------------------------------
LuaInterfaceNet2
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.4
    CodeBase: file:///C:/Program%20Files/WoW%20UI%20Designer/LuaInterfaceNet2.DLL
----------------------------------------
System.Design
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Design/2.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
mwc-1zce
    Assembly Version: 0.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
rgjamhzc
    Assembly Version: 0.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
__________________
"My Grill is my Sidewalk"
Lifelong Arizona Resident
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Accessing ScrollingMessageFrame


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