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 


flowlayout.dsu freeware/open source

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Units
View previous topic :: View next topic  
Author Message
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Mon Apr 25, 2011 7:20 pm    Post subject: flowlayout.dsu freeware/open source Reply with quote

Hey folks!

This DSU FULLY implements a flowlayout similar to Java or HTML into Visual Dialogscript 5, and probably works with Visual DialogScript 6.

For the download, please use the tab key to follow the button flow.

Features:

    Get horizontal padding
    Set horizontal padding
    Get vertical padding
    Set vertical padding
    flow down
    flow up
    flow left
    flow right
    get width for horizontal by number of items
    get width for horizontal by percentage
    get height for vertical by number of items
    get height for vertical by percentage
    reset variables for resize.




The only life this language has is what we breathe into it.

Freeware.

Code:

#define function,flowlayout
#define command,flowlayout

:flowlayout

if @equal(%1,gethpadding)
exit %%flowhpadding
end

if @equal(%1,sethpadding)
%%flowhpadding = %2
exit
end

if @equal(%1,getvpadding)
exit %%flowvpadding
end

if @equal(%1,setvpadding)
%%flowvpadding = %2
exit
end

if @equal(%1,down)
%%flowtop = @sum(%%flowtop,%2,%%flowvpadding)
exit %%flowtop
end

if @equal(%1,right)
%%flowleft = @sum(%%flowleft,%2,%%flowhpadding)
exit %%flowleft
end

if @equal(%1,up)
%%flowtop = @sum(%%flowtop,-%2,-%%flowvpadding)
exit %%flowtop
end

if @equal(%1,left)
%%flowleft = @sum(%%flowleft,-%2,-%%flowhpadding)
exit %%flowleft
end

if @equal(%1,ph)

if @equal(%3,items)
%%flowreturn = @diff(@name(@fdiv(@dlgpos(,h),%2)),%%flowvpadding)
exit %%flowreturn
end

if @equal(%3,percent)
%2 = @fdiv(100,%2)
%%flowreturn = @diff(@name(@fdiv(@dlgpos(,h),%2)),%%flowvpadding)
exit %%flowreturn
end

%%flowreturn = @diff(@name(@fdiv(@dlgpos(,h),%2)),%%flowvpadding)
exit %%flowreturn

end

if @equal(%1,pw)
if @equal(%3,items)
%%flowreturn = @diff(@name(@fdiv(@dlgpos(,w),%2)),%%flowhpadding)
exit %%flowreturn
end

if @equal(%3,percent)
%2 = @fdiv(100,%2)
%%flowreturn = @diff(@name(@fdiv(@dlgpos(,w),%2)),%%flowhpadding)
exit %%flowreturn
end

%%flowreturn = @diff(@name(@fdiv(@dlgpos(,w),%2)),%%flowhpadding)
exit %%flowreturn

end

if @equal(%1,reset)
%%flowvpadding = 0
%%flowhpadding = 0
%%flowtop = 0
%%flowleft = 0
end




flowlayout (2).zip
 Description:

Download
 Filename:  flowlayout (2).zip
 Filesize:  3.93 KB
 Downloaded:  791 Time(s)

Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Sun May 01, 2011 8:29 pm    Post subject: Reply with quote

Wanna see something cool?

Change the window create command in the example.

Code:
 DIALOG CREATE,New Dialog,-1,0,800,400,,resizable,notitle
REM *** Modified by Dialog Designer on 4/25/2011 -08:07 ***
%%k = @strdel(@winexists(@dlgtext()),1,1)
LOADLIB user32.dll
  %%knockout = @lib(user32,SetWindowLongA,INT:,%%k,-16,$40000)
FREELIB user32.dll
dialog show


Edit

Well...if you've tried to close this bad boy you realize....the buttons disappear on alt.

The trick to fix that is to add a alt hotkey to your program that forces a redraw.

Code:
  :hotkey
loadlib user32.dll
%P = @lib(user32,InvalidateRect,BOOL:,INT:%%k,0,1)
%P = @lib(user32,UpdateWindow,BOOL:,INT:%%k)
freelib user32.dll
goto evloop


Granted you catch alt for all windows now, but you do not interrupt it or interfere with the user interaction so the damage is minimal.

EDIT 2
SCREW hotkeys.

Do it right.

Double buffer the window.

Code:
LOADLIB user32.dll
  %%knockout = @lib(user32,SetWindowLongA,INT:,%%k,-16,$40000)
%%knockout = @lib(user32,SetWindowLongA,INT:,%%k,-20,INT: $2000000)
FREELIB user32.dll


WARNING: Do not buffer windows that have children or child windows.
Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Tue Aug 28, 2012 7:17 pm    Post subject: Reply with quote

Good grief. I guess if I can't figure out how to use this (over my head at this time) maybe I should have documented it better.
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 Units 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