forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Tab and Delete in Browser

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code
View previous topic :: View next topic  
Author Message
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Tue Apr 12, 2011 9:34 pm    Post subject: Tab and Delete in Browser Reply with quote

Relies on VDSDOM50.DSU
http://www.vdsworld.com/forum/viewtopic.php?p=36186

Demonstrates 2 new functions and 3 new commands.

UPDATED 4/13/2011 Please replace your old repository if you saved this example. The new version releases the hotkeys back to the operating system entirely when the window is not active rather than handling the operation globally for all windows, which was't very smart.

Code:
external vdsbrw50.dll
 #include vdsdom50.dsu
#define command,browser
#define function,browser
title Browser Tab Example
  DIALOG CREATE,Browser TAB Example,-1,0,341,225,class cnodnarb
REM *** Modified by Dialog Designer on 4/10/2011 - 22:48 ***
  DIALOG ADD,browser,Browser1,0,0,336,220,""
  DIALOG SHOW
 
    loadlib "psapi.dll"
  %t = @lib("psapi.dll","EmptyWorkingSet",INT:,-1)
  freelib "psapi.dll"
 
%%hot = 0
  directory change,@path(%0)
  dialog set,browser1,<html><body><input><br><input><br><input><br><input><br><input></body></html>
  browser savefile,browser1,@curdir(%0)test.html
  dialog set,browser1,@curdir(%0)test.html 
  rem  setattribute browser1,tag,body,contentEditable,True,0
  repeat
  until @not(@browser(browser1,busy))
 
createfocused browser1

:timer
if @equal(@winactive(),@dlgtext())
  if @equal(%%hot,0)
  hotkey add,hottab,TAB
  hotkey add,delnow,DEL
    %%hot = 1
  end
  else
  if @equal(%%hot,1)
  %%hot = 0
  hotkey remove,hottab
  hotkey remove,delnow
  end
end
 

  :evloop
 wait event,.1
 goto @event()
 
 :close
 exit
 
  :hotkey
  %%hotkey = @hotkey()
  if @equal(%%hotkey,hottab)
  goto hottab
  end
 
  if @equal(%%hotkey,delnow)
  goto delnow
  end
 
  :hottab
  %%x = @getelementcount(browser1,tag,input)
  %%y = 0
repeat
  if @equal(@getattribute(browser1,tag,input,focused,%%y),true)
%%z = %%y
  end
%%y = @succ(%%y)
until @equal(%%y,%%x)
        if @equal(@succ(%%z),%%x)
%%z = -1
        end
 setfocus browser1,tag,input,@succ(%%z)
  goto evloop
 
  :delnow
   execcommand browser1,"'Delete'"
 goto evloop

   
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group