Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Cannot apply theme (Timeline view) (Read 2189 times)
Darko
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Nov 1st, 2007
Cannot apply theme (Timeline view)
Nov 21st, 2007 at 1:24pm
Print Post  
Hi again,

I'm trying to create a custom theme, but I always get an error when I try to apply it when the current view is Timeline (it works for List view, though).

This is the exception I get:

[code]System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
  Source="Calendar"
  StackTrace:
      at MindFusion.Scheduling.WinForms.Calendar.xad5e64ac35a54d10(Object xe0292b9ed559da7d, ScrollBarDrawArgs xfbf34718e704c6bc)
      at MindFusion.Controls.ScrollBar.OnDraw(ScrollBarDrawArgs e)
      at MindFusion.Controls.ScrollBar.OnPaint(PaintEventArgs e)
      at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
      at System.Windows.Forms.Control.WmPaint(Message& m)
      at System.Windows.Forms.Control.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
      at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
      at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
      at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
      at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
      at System.Windows.Forms.Application.Run(Form mainForm)
      at Test.Program.Main() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\WinTest\Test\Program.cs:line 17
      at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
      at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
      at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
      at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
      at System.Threading.ThreadHelper.ThreadStart()
[/code]

[url=https://www.eduing.net/files/Calendartheme.zip]Here[/url] is an example test project.

Am I doing anything wrong here?

Thanks,
Darko
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Cannot apply theme (Timeline view)
Reply #1 - Nov 21st, 2007 at 2:12pm
Print Post  
Have you by any chance made your custom theme by hand? It seems that the theme is not complete and the control crashes in an attempt to obtain properties that are not defined.

Check the 'Tutorial 8' in the accompanying documentation on how to create custom themes using the Theme Editor. It is very easy to do it. Besides the theme are compiled in separate assemblies and you won't have to swarm your own code with the hundreds of lines of code, which define a single theme.

Meppy

P.S.: The exact reason for the crash is that the PrintTheme.ControlAppearance property returns Custom, while the ControlStyle property returns an empty ControlStyle instance. You either have to return System from ControlAppearance or create and initialize a ControlStyle object and return it in the PrintTheme.ControlStyle property.
  
Back to top
 
IP Logged
 
Darko
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Nov 1st, 2007
Re: Cannot apply theme (Timeline view)
Reply #2 - Nov 21st, 2007 at 3:04pm
Print Post  
Thanks. I also suspected the ControlStyle property  Smiley

Actually I made the theme using Theme Editor but removed the settings for other views as I only need the theme for one view.

Thanks again,
Darko
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint