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 


Dialog Element Mover

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 6 Source Code
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1710
Location: Space and Time

PostPosted: Sat May 14, 2011 4:06 pm    Post subject: Dialog Element Mover Reply with quote

I had a big dialog with a lot of elements and I wanted to move all of them over. I didn't want to go and do the math or use dialog designer and move each element. I decided to make a quick app that did the moving for me.

Just copy your dialog code and paste it into the edit box. Use the TOP and LEFT spin elements to "move" the elements. You can enter negative number to move them LEFT or UP.

EDIT: Small bug in %%TheRest fixed

Code:

#Created by Chris Gingerich (AKA LiquidCode)
option decimalsep,"."
option scale,96
Title Dialog Element Mover
  DIALOG CREATE,Dialog Element Mover,-1,0,540,292
REM *** Modified by Dialog Designer on 5/14/2011 - 10:58 ***
  DIALOG ADD,GROUP,GROUP1,5,4,533,233,Dialog code to "move"
  DIALOG ADD,EDIT,code,21,11,519,211,,,MULTI,SCROLL
  DIALOG ADD,TEXT,TEXT2,245,5,,,Top:
  DIALOG ADD,SPIN,top,242,45,70,24,,0
  DIALOG ADD,TEXT,TEXT4,247,133,,,Left:
  DIALOG ADD,SPIN,left,242,176,70,24,,0
  DIALOG ADD,BUTTON,Move,255,269,64,24,Move!
  DIALOG ADD,TEXT,TEXT1,270,47,,,Negative values can be entered
  DIALOG ADD,LINE,LINE1,238,347,1,54
  DIALOG ADD,BUTTON,Copy,241,381,133,24,Copy to clipboard
  DIALOG ADD,BUTTON,paste,266,381,133,24,Paste from clipboard
  DIALOG SHOW
 
  :evloop
  wait event
  %e = @event()
  goto %e
 
  :Close
  stop
 
  :PasteBUTTON
  dialog set,code,@clipbrd()
  goto evloop
 
  :CopyBUTTON
  clipboard set,@dlgtext(code)
  goto evloop
 
  :MoveButton
  if @not(@dlgtext(code))
     Warn Please copy and paste only code of elements to move.
     goto evloop
  end
  %%left = @dlgtext(left)
  %%top = @dlgtext(top)
  %%oc = @new(list)
  %%NewCode = @new(list)
  list assign,%%oc,@trim(@dlgtext(code))
  option fieldsep,","
  %x = 0
  repeat
     parse "%a;%b;%c;%d;%e;%f;%g",@item(%%oc,%x)
     %%TheRest = @trim(@strslice(@item(%%oc,%x),%a","%b","%c","%d","%e","%f","%g","))
     if @equal(@trim(%a),Dialog Add)
        %d = @sum(%%top,%d)
        %e = @sum(%%left,%e)
        list add,%%NewCode,%a","%b","%c","%d","%e","%f","%g","%%TheRest
     else
        list add,%%NewCode,@item(%%oc,%x)
     end
     %x = @succ(%x)
  until @equal(%x,@count(%%oc))
  dialog set,code,@text(%%NewCode)
  list close,%%NewCode
  List close,%%oc
  goto evloop

_________________
Chris
Http://vdsfreak.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 6 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 cannot attach files in this forum
You cannot download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group