搏客 Winning
After three days without programming, life becomes meaningless
posts - 46,  comments - 41,  trackbacks - 21

 <html>

<head>
<TITLE> Image View </TITLE>
<HTA:APPLICATION
 SCROLL="no"
 INNERBORDER="no"
 CONTEXTMENU="no"
 SINGLEINSTANCE="yes"
 BORDERSTYLE="sunken"
 BORDER="thin"
 WINDOWSTATE="Maximize"
 />

<style rel="stylesheet" type="text/css">
#toolBar
{
background-color:menu;
height:30px;
top:0px;
padding-left:0px;
padding-bottom:1px;
border:1px ridge #C0C0C0;
}

button
{
border-width:1pt;
width:24px;
height:24px;
font-size:12pt;
}

body
{
margin:0px;
overflow:hidden;
background-color:menu;
}
</style>

<script language="javascript">

window.onload=function()
{
  imgframe.document.write(
"<html><head><style rel=stylesheet type=text/css> body{margin:0px;overflow:hidden;background-color:#000000;}</style><script language=javascript>var dragy=0,dragx=0;var dragapproved=false;function move(){if (event.button==1&&dragapproved){window.scrollBy(dragx-event.clientX,dragy-event.clientY);document.body.style.cursor='hand';dragy=event.clientY;dragx=event.clientX;return false;}}function down(){dragy=event.clientY;dragx=event.clientX;dragapproved=true;}function up(){dragapproved=false;document.body.style.cursor='';}document.onmousemove=move;document.onmousedown=down;document.onmouseup=up;</"+"script></head><body><center><span name=ImageShow id=ImageShow></span></center></body></html>");
}


function Node(data) 

    
this.last=null
    
this.data=data; 
    
this.next=null;

 
function CrLink() 

    
this.head=new Node("");
    
this.cursor=this.head;
    
this.tail=this.head;


function doAbout()
{
    alert(
"HTA Image View CopyRight 2005 Wengmj");
}
 
CrLink.prototype.first
=function()
{
    
this.cursor=this.head; 
}

 
CrLink.prototype.end
=function()

    
this.cursor=this.tail; 


CrLink.prototype.add
=function(data) 

      
var data=new Node(data); 
      
this.tail.next=data; 
      data.last
=this.tail; 
      
this.tail=data; 
      
this.tail.next=null

 
CrLink.prototype.next
=function() 

   
if(this.cursor.next!=null)  
   { 
        
this.cursor=this.cursor.next; 
        
return true
   } 
    
return false



CrLink.prototype.last
=function()

    
if(this.cursor.last!=null
    { 
        
this.cursor=this.cursor.last; 
        
return true
    } 
    
return false



CrLink.prototype.getNode
=function()

   
return this.cursor.data; 



var myCrLink=new CrLink();
var openFile;
var scale=0;

function doExit()
{
    window.close();
}

function doNew()
{
    myCrLink
=new CrLink();
    imgframe.ImageShow.innerHTML
="";
}

function doNext() 

    
if(myCrLink.next()) showImage(); 
    
else 
    { 
        myCrLink.first(); 
        myCrLink.next(); 
        showImage(); 
    } 


function doLast() 

    
if(myCrLink.last()) 
        showImage(); 
    
else 
    { 
        myCrLink.end(); 
        showImage(); 
    } 


function doFirst() 

    myCrLink.first(); 
    
if(myCrLink.next()) showImage(); 


function doEnd() 

    myCrLink.end(); 
    
if(myCrLink.last()) showImage(); 
}

function doPrint()
{
    window.print();
}

function doOpen() 

  openFile
=showOpenFileDialog(); 
  
if(openFile==nullreturn
  
var openDirection=getOpenDirection(openFile); 
  
var fso= new ActiveXObject("Scripting.FileSystemObject"); 
  fE
=  new Enumerator(fso.GetFolder(openDirection).Files); 
  myCrLink
=new CrLink(); 
  
while(!fE.atEnd())   
  { 
      
var itemstr=(""+fE.item()).toLowerCase();
      
if(itemstr.endsWith("jpg")||itemstr.endsWith("gif"))    myCrLink.add(itemstr); 
      fE.moveNext(); 
  }

  showOpenImage(openFile);


function showOpenImage(openFile)
{
    imgframe.ImageShow.innerHTML
="<img name=demo src=\""+openFile+"\">";
}

function showImage() 


 thisFile
=""+myCrLink.getNode(); 
 
if(thisFile==""return;
 imgframe.ImageShow.innerHTML
="<img name=demo src=\""+thisFile+"\">";



function showOpenFileDialog() 

    openFileDialog.click(); 
    
var openFile=openFileDialog.value; 
    
return ((openFile=="")?null:openFile); 


function getOpenDirection(openFile) 

    lastdivderindex
=openFile.lastIndexOf("\\"); 
    
return openFile.substring(0,lastdivderindex).replace(/\\/g,"\\\\"); 



String.prototype.endsWith
=function(str) 

    
return(this.substring(this.length-str.length)==str); 
    
return false


function doZoomOut()
{
    
if(scale>2048return;
    
if(imgframe.demo==nullreturn;
    scale
=imgframe.demo.width+100;
    imgframe.demo.width
=scale;
}

function doZoomIn()
{
    
if(scale<50return;
    
if(imgframe.demo==nullreturn;
    scale
=imgframe.demo.width-100;
    imgframe.demo.width
=scale;
}

</script>
</head>

<body>
<table border="1" width="100%" cellspacing="0" id="ToolBar" cellpadding="0" bgcolor="#D4D0C8" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr>
<td>
<button style="width:4px"></button>
<button style="font-family:Wingdings" onclick="doNew()">3</button>
<button style="font-family:Wingdings" onclick="doOpen()">1</button>&nbsp;
<button style="font-family:Webdings" onclick="doFirst()">9</button>
<button style="font-family:Webdings" onclick="doLast()">7</button>
<button style="font-family:Webdings" onclick="doNext()">8</button>
<button style="font-family:Webdings" onclick="doEnd()">:</button>&nbsp;
<button onclick="doZoomOut()">+</button>
<button onclick="doZoomIn()">-</button>&nbsp;
<button style="font-family:Wingdings 2" onclick="doPrint()">6</button>
<button style="font-family:Webdings" onclick="doAbout()">N</button>
<button onclick="doExit()">×</button>

<input type="file" style="display:none" name="openFileDialog">

</td>
</tr>
</table>
 <iframe height="100%" width="100%" name="imgframe"></iframe>
</body>

</html>


AcdSee.hta 

posted on 2004-09-20 10:40 搏客 Winning 阅读(974) 评论(0)  编辑 收藏 所属分类: 玩具代码

标题  
姓名  
主页
Email (只有博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2005-05-18 10:53 编辑过
 
 




与我联系

搜索

 

常用链接

随笔分类

随笔档案

积分与排名

  • 积分 - 30421
  • 排名 - 1312

最新评论

阅读排行榜