Let me think and discuss this a bit. In general, the Component class in WinForms is also used for non-visual designer-enabled components, like the menus or the property extenders, or the timer, file systems, data sources. It would have been nice to have a VisualComponent in bewteen Component and Control.
I think that Wisej and WinForms will diverge when it comes to the ToolStrip system. Meaning that we will not implement the ToolStrip classes and duplicate the ContextMenu, ContextStripMenu, etc. We’ll keep one ContextMenu, ToolBar, StatusBar. In fact we are already adding the various additional component to the toolbar (ComboBox, Label, ControlHost, …). So I think that your proposal to make the status bar, toolbar and maybe the menu items compatible is interesting. Something like an IToolItem interface (so it’s not tied to the toolbar). The child collection will have to remain as they are to preserve compatibility, which means that the current classes will have to act as base classes, which also makes sense. Something like this (I’ll pass this around):
ToolBarButton : IToolItem
ToolBarComboBox <- ToolBarButton : IToolItem
..
StatusBarPanel : IToolItem
StatusBarComboBox <- StatusBarPanel : IToolItem
You get where I’m going with this. This way the StatusBarPanel Collection still returns and always returns StatusParPanel instances, which can be a StatusBarComboBox, StatusBarIcon, etc.
/Luca
Yes, added as WJ-8377. I think it was done like that to be like WinForms, but adding the MenuItems collection like the Button and SplitButton already have is a good enhancement.
The main issue is that you didn’t set the .js and .theme files as “Embedded Resources”.
The second issue that I just discovered and didn’t know is that VB.NET builds embedded resources differently – it ignores completely the path!
Wisej searches in Platform, Resources and Themes, but VB.NET doesn’t include the path in the namespace. So I fixed your code by simply adding the prefix “Platform.” to the .js file and “Themes.” to the mixin and now it works. Another way is to edit vbproj by hand (see link above).
We’ll have to document this somewhere.
Hi Luca,
I’ve studied your example and I think I understand the methodology.
I tried translating it into VB on a new project, but the mycheckboxcolumn column1 on dtatgridview displays only False. I do not know where I’m wrong.
I attach your translated example.
Thanks
You have to exclude the startup method from obfuscation, otherwise Wisej cannot find the method named in Default.json because the name will be different.
Use the AppearanceKey property.
It’s not hard coded, it’s calculated when the content is displayed, when the size of the HtmlPanel is changed, and when the scrollbars are forces off. It’s necessary to calculate it to manage the container’s scrollbar since we use themed scroll bars.
If the internal html content runs some javascript that dynamically changes the size of the html content, it will not update the container. There is no javascript event on an element changing the size. There are two ways to do this, one is to start a timer and periodically resize, the other is to trigger the resize when the content is resize in case the javascript library (H5P?) fires some event when is rendered.
Try to increase the height of the HtmlPanel by 1 pixel after the H5P content is fully displayed and let me know if the content is resized. In case I can give you a simple javscript that triggers the resize on a timer.
I can’t reproduce, I see it. Try to compile and then reopen the image selector. Or make sure that Copy Local is set to true.
When the browser refreshes the page, everything is lost from the browser’s perspective. It’s just like navigating to another page. Wisej takes care of the state of all its controls, including GoogleMaps, but not for its internal objects. The GoogleMaps Wisej widget will restore the options, that’s probably why it centers at the original null. If you set the center in the options that it will persist.
To handle the Application.ApplicationRefresh event (or ApplicationExit, BeginRequest, etc.) attach to it in the Form’s constructor or in the Load event. ApplicationRefresh is fired when the browser reloads. When the handler is in the form, it’s a local method like any other in the form.
HTH
/Luca
I realize there is Application_ApplicationRefresh event, but this fires in Program.vb and not frmMapView.vb — so if I were to use this event, I’m not sure how to check for an existing instance of the form containing the map, and then call a public method to redraw the map markers…
Thank you for that excellent explanation. I will read more about anonymous objects. The code is working.
Hi Eric,
I also noticed that issue and I never understood whether it was a VS issue or a Wisej issue.
Ok
Now it works perfect.
I confirm that the problem was the single quote
Thank you very much
Hello,
I’m trying to deploy on an offline server, but can’t find/generate the wisej-server.lic file.
In the doc it is stated :
Local Servers Without Internet Access
If you need to deploy a Wisej application to a server that doesn’t have internet access and cannot activate the server license, you can activate the server license on a developer machine with internet access and deploy the wisej-server.lic file with the application, in the root project folder.
wisej-server.lic is automatically generated the first time the server activates a server license.
On this post you say :
To generate the server lic file, simply run the app once on the connected development machine.
I have inserted the received “server Wise Web Server License” key in the Application Web.config
<?xml version=”1.0″?>
<!–
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
–>
<configuration>
<appSettings>
<add key=”Wisej.LicenseKey” value=”XXXXXXXXXXXXXXXXXXXXXXX”/>
<add key=”Wisej.DefaultTheme” value=”Blue-1″/>
</appSettings>
The development PC has direct acces to the Internet.
From that PC I tried :
The wise-server.lic file doesn’t get generated ???
The product version is the latest 1.3.75 Dev Build.
Any idea ?
Regards.
Nb: It’s a really great product. Continue that way.
Luca, thanks for clarifying.
I have also detected a strange effect with the Javascript execution.
If you take your sample Wisej.DesktopStartPanel code, and you simply a Splitcontainer control to the Windows1 (Form1).
With nothing more then the splitcontainer added, the javascript isn’t executed and the button isn’t relocated.
If windows1 isn’t shown at startup, but later, then everything is working OK.
It’s WJ-8376 and fixed in the current build. FireFox is still non-standard with the event object.
It’s possible for all Wisej controls. For most it’s as easy as setting the appearance key. You don’t have to create a new theme, you can use a theme mixin to add or modify whatever theme is loaded.
However for some complex controls it’s a bit more difficult since they have child elements that are also styled but are not actual controls. DGV columns and cells are the most complex. We have a system of cell renderers that can be overridden to do just about anything, but it’s not simple. We are simplifying it as requirements come our way from projects.
I have attached a small sample that creates a custom renderer overriding the checkbox cell and includes a mixin theme to make the checkbox red. You can change any aspect you like in the mixin or the renderer. To see the full wisej javascript source code you can download the wisej.js from from the browser, when in debug mode it’s not minified.
Overriding the cell renderer is one of those things being simplified…
The problem is that to close the popup you have to click outside of it. If you click the button it closes and reopens it. It’s a nuisance that we are trying to solve.
