Page 1 of 1

Jiwa And Infragistics Styles

PostPosted: Mon Dec 04, 2017 6:35 pm
by SBarnes
I am aware that Jiwa get its style (colours etc) from the file JiwaStyle.isl in the program directory and that the app stylist in installed along with Jiwa.

Is there a way to change this per database so that a customer could make their QA database looked markedly different say from their production one and avoid the danger that someone completes a whole heap of work in the wrong database?

Re: Jiwa And Infragistics Styles

PostPosted: Mon Dec 04, 2017 7:43 pm
by Mike.Sheen
Hi Stuart,

Yes - you can set the style in a plugin at any time (you'll probably want to add a handler for the LoggedOn event in the ApplicationManagerPlugin class) and in there you can set the style to any .isl file using the ApplyStyling method of the Manager.

There are a bunch of pre-defined styles in Program Files (x86)\Jiwa Financials\Jiwa 7\Styles - or you can copy one of those and edit the style using the style editor (Infragistics4.Win.AppStylist.v13.1.exe) in Program Files (x86)\Jiwa Financials\Jiwa 7\Styles\Appstylist.

Mike

Re: Jiwa And Infragistics Styles

PostPosted: Mon Dec 04, 2017 8:18 pm
by Mike.Sheen
Actually - I've just tried this myself and it is not working.

I did have this working a few years ago - as a POC I had styles switching per warehouse via a plugin - I'll see if I can dig that up and work out what I'm missing!

Re: Jiwa And Infragistics Styles

PostPosted: Mon Dec 04, 2017 10:22 pm
by SBarnes
Hi Mike,

Yes I was aware of the app stylist under the Jiwa directory and the isl files I had tried swapping files around to test that it worked before making the post.

I had a go also but the following doesn't work, so if you figure out what's needed to make it work please let me know, I did however out of the exercise figure out how to do a file open dialog to set the system setting when you make it a lookup field which makes it somewhat user friendly.

Code: Select all
   public void Setup(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
      JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.LoggedOn += LoggedOn;
   
    }
   
   private void LoggedOn()
   {
      //System.Windows.Forms.MessageBox.Show(JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData("Attkey Style Setting", "StyleFile", "").ToString());
      if (System.IO.File.Exists(JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData("Attkey Style Setting", "StyleFile", "").ToString()))
      {
         //System.Windows.Forms.MessageBox.Show(JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData("Attkey Style Setting", "StyleFile", "").ToString());
         JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.ApplyStyling(JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData("Attkey Style Setting", "StyleFile", "").ToString().Trim());
      }
      
   }

Re: Jiwa And Infragistics Styles  Topic is solved

PostPosted: Tue Dec 05, 2017 7:27 am
by SBarnes
Hi Mike,

Your actual warehouse change of style plugin is in the standard plugins.

I got it to go on login by doing the following:

1. In the logged on event I added a form shown event handler for the MDI Parent itself
2. In that event handler I applied the style file

It must be that the main code applies its style after logged on event has happened

My only remaining question is how do you get the MDI Parent under 7.1 so I can make this work in both versions?


Code: Select all
JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.MDIParentForm.Shown += FormShown;


and
Code: Select all
   private void FormShown(object sender,EventArgs e)
   {
      if (System.IO.File.Exists(JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData("Attkey Style Setting", "StyleFile", "").ToString()))
      {
         JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.ApplyStyling(JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData("Attkey Style Setting", "StyleFile", "").ToString().Trim());
      }
   }

Re: Jiwa And Infragistics Styles

PostPosted: Tue Dec 05, 2017 9:18 am
by Mike.Sheen
SBarnes wrote:Your actual warehouse change of style plugin is in the standard plugins.


Lol - I knew I'd done it previously!

SBarnes wrote:My only remaining question is how do you get the MDI Parent under 7.1 so I can make this work in both versions?


The Manager has a property, MDIParentForm.

Mike

Re: Jiwa And Infragistics Styles

PostPosted: Tue Dec 05, 2017 9:36 am
by SBarnes
Hi Mike,

Yeah I found that after the post the whole thing works in both versions now.

Although in 7.1 I had to add a variable to the plugin to hold the manager so the so the shown event could get at it.

Thanks for the help as always.