Jump to content

Simple TIP: AlwaysOnTop feature for windows and forms


Recommended Posts

Hi,


This is a simple workaround to include in UniGUI framework the fantastic work done by Eirik Lorentsen and published at http://www.eirik.net/Ext/ux/util/AlwaysOnTop.html.

For us, this is a must have feature needed as the developed application starts to get more and more complicated with more and more options, filters and parameters.

With some time and dedication, it might be possible to achieve similar functionality provided by floating panels within professional applications like Photoshop or Lightroom...

Attached, there is a simple project to show the how-to. Use it under your own risk so we don't know if there are significant inteferences with UniGUI framework.

We hope that Farshad could consider to include this functionality within UniGUI framework as a "AlwaysOnTop" property of standard forms.

Tested with UniGUI v0.93.0.996. IE8 and FF18 browsers.

Regards,

AlwaysOnTop.rar

  • Upvote 3
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

I tried to compile and run the project, but Avira detected a virus inside the generated .exe (false positive, i guess..)  'TR/Fraud.Gen7' [trojan]

 

By the way, very important feature, in my opinion.

 

This is a known bug in Avira .... Just renaming the project "Project1" to a different name then it runs.

 

- ... Any program with names "Project 1" is detected as a virus

Link to comment
Share on other sites

I tried to create another project using this workaround for AlwaysOnTop, but I failed.

Here is what I did:

  • Copy-Paste AlwaysOnTop.js in the project root
  • ServerModule->CustomFiles="AlwaysOnTop.js"
  • Form->TUniClientEvents->ExtEvents->OnBeforerender :
function window.OnBeforerender(sender)
{
   Ext.apply(sender, {
			alwaysOnTop: true
   });
}

Unfortunately, this was not enough the form shows as a regular form. I've also tried to put the full path to AlwaysOnTop.js under ServerModule.CustomFiles: nothing changes.

What am I missing here?

Link to comment
Share on other sites

I tried to create another project using this workaround for AlwaysOnTop, but I failed.

Here is what I did:

  • Copy-Paste AlwaysOnTop.js in the project root
  • ServerModule->CustomFiles="AlwaysOnTop.js"
  • Form->TUniClientEvents->ExtEvents->OnBeforerender :
function window.OnBeforerender(sender)
{
   Ext.apply(sender, {
			alwaysOnTop: true
   });
}

Unfortunately, this was not enough the form shows as a regular form. I've also tried to put the full path to AlwaysOnTop.js under ServerModule.CustomFiles: nothing changes.

What am I missing here?

 

I think that was all... It could be the following: be sure that you are writing code within OnBeforerender of Ext.Window, not of Ext.form.FormPanel...

Link to comment
Share on other sites

I think that was all... It could be the following: be sure that you are writing code within OnBeforerender of Ext.Window, not of Ext.form.FormPanel...

 

Are you sure that this (taken from AlwaysOnTop.js)

Ext.application({
			name: 'AlwaysOnTopDemo',
			controllers: [
				'Ext.ux.util.AlwaysOnTop'
			]
});

is the proper way to get the controller? I inspected my generated page source and this is the order in which the scripts are loaded:

...
<script src="ext-4.1.1a/ext-all.js"></script>
<script src="ext-4.1.1a/uni-0.93.0.995/ext-sync-min.js"></script>
<script type="text/javascript">

Ext.Loader.setConfig({enabled:true,paths:{"Ext.uni":"ext-4.1.1a/uni-0.93.0.995"}});

</script>

<link rel=stylesheet href="ext-4.1.1a/uni-0.93.0.995/css/uni-xtheme-common.css" />
<link rel=stylesheet href="ext-4.1.1a/uni-0.93.0.995/css/uni-xtheme-blue.css" />
<script src="/AlwaysOnTop.js"></script>
<script src="ext-4.1.1a/uni-0.93.0.995/ext-treenode-plugin.js"></script>
<script src="ext-4.1.1a/uni-0.93.0.995/unicanvas-min.js"></script>
<script src="ext-4.1.1a/examples/ux/form/MultiSelect.js"></script>
<script src="ext-4.1.1a/uni-0.93.0.995/ext-unigui-min.js"></script>
...

maybe the alwaysontop controller gets lost :D

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...