All Answers

0 votes

Hi Nic,

I’m glad that you are playing with the extensions. They really show the flexibility of Wisej.

In general, when adding a control or a property to a control you are dealing with 3 aspects: 1) client side in javscript; 2) server side in .NET; 3) designer. Fortunately you can use all the Visual Studio designer features and Wisej connects the client with server so you can focus the programming to very clear responsibilities.

In this case you are looking at adding an array of objects. You can create a .NET class CustomSector with the properties Lo, Hi and Color. Capitalize the first character to be consistent with .NET names. Make the CustomSector class implement IWisejSerializable to set the CamelCase option to true (we should probably make this the default – it’s already the default for enumerations).

The Lo, Hi, and Color properties can be simple {get; set;} and can declare any of the designer specific attributes if needed.

This is the simple IWisejSerializable implementation to turn on camel casing:

#region IWisejSerializable

// Serialize using camel case to be javascript compatible.
 bool IWisejSerializable.CamelCase { get { return true; } }

string[] IWisejSerializable.IgnoreList { get { return null; } }

bool IWisejSerializable.Serialize(TextWriter writer, WisejSerializerOptions options) { return false; }

#endregion

Once you have the CustomSector class, add a property to the control like this:

[DefaultValue(null)]
[MergableProperty(false)]
[TypeConverter(typeof(ArrayConverter))]
[Editor("System.ComponentModel.Design.ArrayEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
public CustomSector[] CustomSectors

{

  get;

  set;

}

Now you have the property and you need to send it back to the client. JustGage is one of the three ways we have to implement a Wisej control and it’s the most integrated since it actually creates a javascript class “wisej.web.ext.JustGage”.

In JustGage.OnWebRender, add:

config.customSectors = this.CustomSectors;

You also have to add a corresponding property to the javascript side, in wisej.web.ext.JustGage.js inside the properties: {} block add:

customSectors: {init: null, check:”Array”},

Then in __createJustGageElement, add the property to the config object:

var config = {
 id: elementId,
 value: this.getValue(),
 min: this.getMinimum(),
 max: this.getMaximum(),
 showMinMax: showLabels,
 title: showTitle ? this.getTitle() : " ",
 customSectors: this.getCustomSectors(),
 label: showLabels ? this.getLabel() : " ",
 titleFontColor: this.__resolveColor(this.getTextColor()),
 labelFontColor: this.__resolveColor(this.getLabelColor()),
 gaugeColor: this.__resolveColor(this.getBackgroundColor()),
 };

This should be all.

If you want the new CustomSectors propery to update the widget when it’s changed, modify the property to this:

[DefaultValue(null)]
[MergableProperty(false)]
[TypeConverter(typeof(ArrayConverter))]
[Editor("System.ComponentModel.Design.ArrayEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
public CustomSector[] CustomSectors

{

  get
  {
     return this._customSectors.
  }

  set
  {
     this._customSectors = value;
     Update();
 }
}
private CustomSector[] _customSectors;
Otherwise you can call justGage1.Update() after changing the custom sectors.
If you change only a property of an existing CustomSector array element you still need to call Update(). Unless you
connect the CustomSector instanced to the owner and call Update from the property setters in there.

This is mostly Visual Studio .NET designer and component model coding and not specific for Wisej.

HTH. If you need more help, send me the project you have extended. And if you want to, we can incorporate it and publish the updated JastGage that you have done.

Best,
Luca

 

  • Luca answered Jul 1, 2016 - 1:57 pm
0 votes

So it does – my bad. I should have looked.

Nic

  • Nic Adams answered Jul 1, 2016 - 7:16 am
0 votes

It’s enhancement WJ-7387. Will probably be in the next update.

  • Luca answered Jun 30, 2016 - 5:04 pm
0 votes

It should already include it. This is the initialization of the features map from the client passed in together with the first load request.

 

 var data = {
 hash: location.hash.substr(1),
 browserSize: this.browserSize,
 screenSize: { width: screen.width, height: screen.height },
 os: this.platform.getSystemName(),
 device: this.platform.getDeviceType(),
 browser: this.platform.getBrowserName(),
 version: this.platform.getBrowserVersion(),
 fullScreen: window.fullScreenApi ? window.fullScreenApi.isFullScreen() : false,
 features: {
 webSocket: ("WebSocket" in window),
 arrayBuffer: ("ArrayBuffer" in window),
 notification: ("Notification" in window),
 geolocation: ("geolocation" in navigator),
 localStorage: ("Storage" in window),
 speechSynthesis: (window.speechSynthesis) != null,
 fullScreen: window.fullScreenApi ? window.fullScreenApi.supportsFullScreen : false,
 speechRecognition: (window.speechRecognition || window.webkitSpeechRecognition || window.mozSpeechRecognition) != null,
 },
 language: language
 };
  • Luca answered Jun 30, 2016 - 4:05 pm
0 votes

You are right! Logged as WJ-7386. Looks like the framework returns a PNG instead of a GIF.

  • Luca answered Jun 30, 2016 - 3:12 pm
0 votes

Thanks. It’s caused by the grid trying to read the coordinates of the cell after the columns have been deleted. Logged as WJ-7385. Fixed in an interim build already.

  • Luca answered Jun 30, 2016 - 3:09 pm
0 votes

Hi Frank,

Firstly, thanks for the quick reply, appreciated.

I have run your test project and of course it works fine, the difference is I think they way I was assigning the image.  There seems to be a sublte difference between:

pictureBox1.Image = global::TestAnimatedGIF.Properties.Resources._36DVbRG;

and

pictureBox1.ImageSource = “36DVbRG.gif”;

Where 36DVbRG.gif is the GIF file that I couldn’t get to work.  But it does work using .ImageSource and not if using .Image

Perhaps this is a bug, or perhaps I shouldn’t using the .Image property?

Hope this help,

Mark

  • Mark McCormack answered Jun 30, 2016 - 9:29 am
0 votes

Thanks Luca.

The big problem was fixing the “other” buttons. Believe or not, I had to define Active before Hovered to get everything working as it should.

I attach the result of my efforts.

  • Tiago Freitas Leal answered Jun 29, 2016 - 11:26 pm
  • last active Jun 29, 2016 - 11:28 pm
0 votes

Hi Mark,

first of all, thanks for your kind words about Wisej.

I have quickly build a simple sample trying to reproduce the issue you described,
but my sample appears to work fine (see attachment).

Can you please test it on your side and also share a few more infos about your setup
(browser, OS).

Thanks in advance !

Best regards
Frank

0 votes

You need to change the activeCaption color?

If yes, this is what you need to do with the ThemeBuilder. For the Close Button:

  • Select Window/Close Button/Icon
  • Delete the inherit string (set it blank) now it should say “icon-dark”
  • Delete Window/Close Button/Icon/Hovered
  • Add Window/Close Button/Icon/Default/Properties/height=22
  • Add Window/Close Button/Default/Properties/textColor=iconDark
  • Add Window/Close Button/Hovered/Properties/textColor=white
  • Add the state Window/Close Button/Active
  • Add Window/Close Button/Active/Properties/textColor=white

The other buttons are the same but the hovered color is different.

 

  • Luca answered Jun 29, 2016 - 8:30 pm
0 votes
In reply to: Download Files

Hi Cris,

Download(Stream) has been added in Wisej build 1.2.14 (as logged in WJ-7380)

Best regards
Frank

0 votes

Hi Nic,

issue WJ-7368 is fixed in Wisej build 1.2.14.

Best regards
Frank

0 votes

Hi Nic,

WJ-7381 is resolved in build 1.2.14.

Best regards
Frank

0 votes

Hi Nic,

this regression and also the problem with the pointer on disabled buttons (WJ-7379) have been fixed in 1.2.14.

Best regards
Frank

0 votes
In reply to: Beta Updates

A new build (1.2.14) with the following fixes/additions has been uploaded:

Item Type Priority Severity Title Resolution
WJ-7368 Bug Low Trivial Showing a form with window.ShowDialog does not focus its first control Complete
WJ-7379 Bug Low Trivial Disable pointer on diabled buttons. Complete
WJ-7380 Enhancement Low Trivial Add Application.Download(Stream). Complete
WJ-7381 Regression High Major Controls dropped on a tab control page are not visible at design time. Complete
0 votes

And the reason was an incomplete check in.

  • Luca answered Jun 28, 2016 - 5:54 pm
0 votes

Frank can reproduce and now I can. Weird, earlier I had the same identical test and it was working fine. I must have been loading a previous build since this is a regression and very easy to reproduce…

  • Luca answered Jun 28, 2016 - 5:34 pm
0 votes

Luca,

Sorry yes I managed to completely screw up the upload. I’ve tried again – apologies.

Basically its a form with two buttons. Pressing the first should enable the second. On my machine I see the message box but button 2 remains disabled.

Nic

  • Nic Adams answered Jun 28, 2016 - 4:55 pm
0 votes

Hi Nic,

this seems to be a regression. It´s logged as WJ-7381 and will be fixed in the next release.

Thanks for reporting it.

Best regards
Frank

0 votes

Hi Nic,

The attached test project seems to be an empty window with a checkbox.

Best,

Luca

  • Luca answered Jun 28, 2016 - 2:52 pm
Showing 11041 - 11060 of 11k results