Forum Index
 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 Index -> Visual DialogScript 6 Source Code
View previous topic :: View next topic  
Author Message
Moderator Team

Joined: 05 Dec 2000
Posts: 1736
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


#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
  wait event
  %e = @event()
  goto %e
  dialog set,code,@clipbrd()
  goto evloop
  clipboard set,@dlgtext(code)
  goto evloop
  if @not(@dlgtext(code))
     Warn Please copy and paste only code of elements to move.
     goto evloop
  %%left = @dlgtext(left)
  %%top = @dlgtext(top)
  %%oc = @new(list)
  %%NewCode = @new(list)
  list assign,%%oc,@trim(@dlgtext(code))
  option fieldsep,","
  %x = 0
     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
        list add,%%NewCode,@item(%%oc,%x)
     %x = @succ(%x)
  until @equal(%x,@count(%%oc))
  dialog set,code,@text(%%NewCode)
  list close,%%NewCode
  List close,%%oc
  goto evloop

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 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