Keep an HTA window from resizing - hta

I have an HTA which I always want to have the same size. I've already kept the window from being maximized by using <hta:application maximizebutton="no" but I also want to keep it from being resised by dragging the mouse from the border of the window.

Add this below:
<HTA:APPLICATION
MAXIMIZEBUTTON="NO"
SCROLL="NO"
BORDER="DIALOG"
/>
Note - If you want to allow user to scroll, change SCROLL string from NO to YES

Try like this :
<HTA:APPLICATION ID="sample"
APPLICATIONNAME="sample"
BORDER="dialog"
MAXIMIZEBUTTON="no"
SCROLLFLAT="yes"
CAPTION="yes"
SELECTION="no"
INNERBORDER="no"
ICON=""
SCROLL="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
WINDOWSTATE="normal" />

Related

How to set the scroll property in the tabbedpage

I've created a tabbedpage to create a horizontal menu at the bottom of the page, but I can't set the scroll property.
This is my code:
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="GET_SOUND.Views.MenuPage"
xmlns:local="clr-namespace:GET_SOUND.Views"
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
android:TabbedPage.ToolbarPlacement="Bottom"
android:TabbedPage.IsSmoothScrollEnabled="True"
BarBackgroundColor="{StaticResource Primary}"
SelectedTabColor="Orange"
UnselectedTabColor="#95FFFFFF">
<!--Pages can be added as references or inline-->
<local:Dashboard Title="Dashboard" Icon="dashboard" />
<local:Marchi Title="Marchi" Icon="marchi" />
<local:Isrc Title="Isrc" Icon="matrici" />
<local:Documenti Title="Documenti" Icon="documenti" />
<local:Documenti Title="Impostazioni" Icon="imp" />
<local:Anagrafica Title="Anagrafica" Icon="anagrafica" />
<local:OpereTutelate Title="Opere Tutelate" Icon="opere" />
I tried to insert -> App: tabmode = "Scrollable" and the assembly, as suggested in this question, but it gives me an error and I don't understand why
As a suggestion, you can try use
Shell Tab,As it says in documents:
When there are more than five tabs on a TabBar, a More tab will
appear, which can be used to access the additional tabs
And Xamarin.Community is also an option, you can set the scrollable tab on the bottom with TabStripPlacement="Bottom".you can see more in https://github.com/xamarin/XamarinCommunityToolkit/blob/main/samples/XCT.Sample/Pages/Views/TabView/ScrollTabsPage.xaml

PrimeFaces Dialog Incorrect Header Size

PrimeFaces 4.0 Dialog headers fit well to dialog window in IE and Firefox but not in Chrome unless i move mouse cursor over the dialog header. When I move the cursor to dialog header it scales and fits the dialog window by itself. I get this problem for all dialogs I use not just the one I posted below. I only have this problem in Chrome. Do you know why this is happening in Chrome and how can I fix this?
The dialog codes and screenshots are below :
This is the status of dialog header when it's opened first
This is the status of dialog header when I move mouse cursor over it.
You see it got normal size.
Dialog codes :
<p:dialog header="#{graphAnalysis.charts.chartTitle} Distribution"
closeOnEscape="true" width="800" dynamic="true"
height="550" widgetVar="lineChartDialog" closable="true"
onShow="loadLineChart()" minimizable="true" position="center"
id="distChartDialogId" >
<h:form style="margin-top: 20px;" id="chartForm">
<p:lineChart id="lineChartId" value="#{graphAnalysis.charts.currentChart}"
style="height: 450px;width: 750px" animate="true" legendPosition="e"
widgetVar="lineChartWg" yaxisLabel="Fraction of Proteins"
xaxisLabel="#{graphAnalysis.charts.chartTitle}"
title="#{graphAnalysis.charts.chartTitle} Distribution" zoom="true" />
<p:remoteCommand name="loadLineChart" update="lineChartId" async="true" process="#this" />
<p:commandButton type="button" value="Export" icon="ui-icon-extlink" onclick="exportLineChart()"/>
</h:form>
</p:dialog>
Another dialog code :
<p:dialog width="800" height="500" widgetVar="graphVis" dynamic="true"
closable="true" draggable="true" minimizable="true" position="center"
closeOnEscape="true" header="Graph Visualization" onShow="updateGraph()">
<h:form>
<p:panel style="border: none;height:450px" id="graphPanel">
<p:mindmap value="#{browse.graph.root}" style="width: 800px;height: 600px">
<p:ajax event="select" listener="#{browse.graph.onNodeSelect}" />
<p:ajax event="dblselect" listener="#{browse.graph.onNodeDblselect}"
oncomplete="details.show()"/>
</p:mindmap>
</p:panel>
<p:remoteCommand name="updateGraph" update="graphPanel" async="true" process="#this" />
</h:form>
</p:dialog>
My page structure is like that :
<html>
<f:view>
<h:head>
...
</h:head>
<h:body>
<p:layout>
<p:layoutUnit>
HEAD
</p:layoutUnit>
<p:layoutUnit>
BODY
</p:layoutUnit>
<p:layoutUnit>
FOOTER
</p:layoutUnit>
</p:layout>
DIALOG CODES HERE
</h:body>
</f:view>
</html>
My solution is very nasty and there are some scenarios, in which it won't work, but in most cases header is displayed correctly now.
Add code to your JavaScript file:
function waitForDialogToLoad(dialog, initialWidth, counter){
//if there was less then 50 tries, try again
if(counter<50){
//if dialog hasn't changed its width, it means it hasn't appeared
if(dialog.width()==initialWidth){
//increase counter
counter ++;
//and try again
setTimeout(waitForDialogToLoad,10,dialog,initialWidth, counter);
}
else{
//set final width of header
var header = dialog.find(".ui-dialog-titlebar");
header.width(dialog.width());
}
}
}
function showDlg(dialog) {
$.browser.chrome = /chrom(e|ium)/.test(navigator.userAgent.toLowerCase());
//if the browser is chrome
if($.browser.chrome){
//find dialog object
var dialogDOM = $("#"+dialog.id.replace(/\:/g,"\\:"));
//set initial width of header
var header = dialogDOM.find(".ui-dialog-titlebar");
header.width(dialogDOM.width());
//remember width of header
var currentWidth = dialogDOM.width();
//show dialog
dialog.show();
//set entry counter
var counter = 0;
//after 10 miliseconds check if dialog has appeared
setTimeout(waitForDialogToLoad,10,dialogDOM,currentWidth, counter);
}
else{
dialog.show();
}
}
Then in view, instead of
dialog.show();
call
showDlg(dialog);

Create high-resolution charts with Flot on Retina displays

I want to show some simple chart in my web application, but using Flot on an Apple device with Retina display looks blurry.
I use the 'normal' viewport settings:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
and this container for Flot to draw in:
<div id="placeholder" style="width: 300px;height:400px;"></div>
This is what I get:
So obivously Flot doesn't use window.devicePixelRatio by default, so I wanted to help out with some custom code:
var newWidth = $(chart.getCanvas()).attr("width") * window.devicePixelRatio;
var newHeight = $(chart.getCanvas()).attr("height") * window.devicePixelRatio;
$(chart.getCanvas()).attr("width", newWidth);
$(chart.getCanvas()).attr("height", newHeight);
chart.setupGrid();
chart.draw();
This in fact changes the canvas' dimensions and they keep that way even after the drawing. On the iPhone 4S it tells me the canvas dimensions are now 600 * 800 (after the drawing), but it still doesn't look crisp.

Problems with zooming of my website on iPad

I developed the following webpage: www.projekt-meine-zukunft.at
It is shown quite well in Safari, the problem is that two-finger zooming doesn't work. Now I have no idea why I can't make the webpage smaller with two-finger gesture like it works with other webpages. I would like to show you code-snippets, but I don't know which would help you.
Could it be a css-problem maybe?
The page is developed with Drupal by the way.
You have the following JavaScript code, which is presenting users from scaling by setting minimum-scale = 1, maximum-scale = 1:
// In Safari, the true version is after "Safari" or after "Version"
else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
browserName = "Safari";
document.writeln('<meta name="viewport" id="view" content="user-scalable=yes, width=device-width minimum-scale = 1, maximum-scale = 1" />');
document.writeln('<link rel="stylesheet" media="all and (orientation:portrait)" href="/themes/pmz/css/portrait.css" />');
}

change HTA application window size

is there any way to change the size of an HTA application?
thanks
<script type="text/javascript">
window.resizeTo(300,290);
</script>
Javascript and VBScript ways to size the HTA on loading, to 1/4 the screen area (half the height, half the width) and center it - using screen.availWidth and screen.availHeight :
<SCRIPT LANGUAGE="javascript">
function Window_onLoad(){ // resize to quarter of screen area, centered
window.resizeTo(screen.availWidth/2,screen.availHeight/2);
window.moveTo(screen.availWidth/4,screen.availHeight/4);
}
window.onload=Window_onLoad;
</SCRIPT>
In VBSScript a Window_onLoad sub will automatically get called any time the HTA starts up (or is refreshed) :
...
</head>
<SCRIPT LANGUAGE="VBScript">
Sub Window_onLoad
' resize to quarter of screen area, centered
window.resizeTo screen.availWidth/2,screen.availHeight/2
window.moveTo screen.availWidth/4,screen.availHeight/4
End Sub
</SCRIPT>
<BODY>
...
I've just tested it (Win XP on an old laptop) and there's a quick flicker of the initial larger window before it shrinks to the smaller size, but it's not that bad.
Here is a tip. If the HTA needs to be resized/moved when the hta is opened, then put the resizeTo and moveTo in its own script tag right after the HEAD tag. Then you won't see the flash that happens as a result of the resize/move.
<HTML>
<HEAD>
<SCRIPT type="text/vbscript" language="vbscript">
' Do the window sizing early so user doens't see the window move and resize
Window.resizeTo 330, 130
Call CenterWindow
Sub CenterWindow()
Dim x, y
With Window.Screen
x = (.AvailWidth - 330 ) \ 2
y = (.AvailHeight - 130 ) \ 2
End With
Window.MoveTo x, y
End Sub
</SCRIPT>
....
Try setting the HTA Attribute windowstate to minimize
windowstate="minimize"
your resize routine will then set the size you want and force the window display.
first set focus to your window:
window.focus()
window.resizeTo(500,500)
window.moveTo(screen.availWidth-500,0)

Resources