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 


DynPos.DSU
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Units
View previous topic :: View next topic  
Author Message
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Thu Apr 20, 2006 8:25 pm    Post subject: DynPos.DSU Reply with quote

DynPos.dsu v0.99 Freeware Beta
Requirements: VDS v5.*

This unit will dynamically position and/or re-size dialog elements while the window is being sized manually via mouse. Unlike VDS's "Resize" event which waits until the mouse button has been release this DSU will automatically manage elements while the window is changing size.

The work of positioning/re-sizing elements is carried out on a separate thread which runs independently from your main program. This is done for two reasons: 1. VDS's v5.x runtime halts script execution while a dialog is being re-sized, which could theoretically be overridden with the "Option MsgEvent" using the "Handled" parameter however that could yield some unexpected results. 2. By using a separate process the work is divided allowing the main script to focus on its intended purpose.

This beta is being released for the purpose of testing and as such the pos/resize refresh rate has been fixed to a very conservative rate. Future releases will offer the option of changing the refresh rate at runtime to allow further performance or appearance optimization.

Please report any bugs here.. Enjoy Smile

V4 Download Link as of 9/3/2014:
https://eckles.net:5001/fbsharing/vtB1EBYp


Last edited by WidgetCoder on Wed Sep 03, 2014 9:26 pm; edited 4 times in total
Back to top
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Fri Apr 21, 2006 11:12 pm    Post subject: Reply with quote

Nice DSU WidgetCoder Very Happy

I was wondering if you can add the capability based on percentage of the window metrics or can have an arithmetic based option.

For example, I have an app that has two tables stacked one below the other were the bottom table's top attribute is always 20 pixels below the bottom of the of the upper table and the bottom is 20 pixels above the bottom of the window and the upper table's height is 1/2 window height minus 20 pixels.

Here's another example:

Code:

:RESIZE
  %w = @dlgpos(,W)
  %h = @dlgpos(,H)
  DIALOG SETPOS,QUERY,103,130,@sum(%W,-136),@sum(%H,-357)
  DIALOG SETPOS,SubQUERY,@sum(%H,-250),130,@sum(%W,-136),200


I hope that made sense Sticking Out Tounge
Back to top
View user's profile Send private message Send e-mail
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Sat Apr 22, 2006 12:19 am    Post subject: Reply with quote

Aslan wrote:

Code:

:RESIZE
  %w = @dlgpos(,W)
  %h = @dlgpos(,H)
  DIALOG SETPOS,QUERY,103,130,@sum(%W,-136),@sum(%H,-357)
  DIALOG SETPOS,SubQUERY,@sum(%H,-250),130,@sum(%W,-136),200



The corresponding DynPos code would be:

Code:
 
  Dynpos Add,QUERY,WH
  DynPos Add,SubQUERY,TW
Back to top
View user's profile Send private message Send e-mail
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Sat Apr 22, 2006 2:17 am    Post subject: Updated DynPos.DSU + Source Code Reply with quote

v1.1 w/source

Changes:
1. Addressed a major bug which would allow more than one instance of the helper process for a given window to be launched causing the CPU usage to jump. The process now checks to see if the window is already being managed and if so quits.
2. The helper process now runs from a hidden file
3. Increased the resize refresh rate with no measurable impact on the CPUs usage.

Ive included the source code incase anyone would like to tinker with it. The readme file in the source folder explains an alternate method of using this code which will drastically reduce your final EXEs file size. If you make any improvements to code please post it for the rest of us. Thank you..


V4 Download Link as of 9/3/2014:
https://eckles.net:5001/fbsharing/vtB1EBYp


Last edited by WidgetCoder on Wed Sep 03, 2014 9:27 pm; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail
LiquidCode
Moderator Team


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

PostPosted: Sun Apr 23, 2006 4:35 am    Post subject: Reply with quote

This is great!!! Love it!!! Great Job.. Very Happy
_________________
Chris
Http://vdsfreak.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Apr 23, 2006 3:48 pm    Post subject: Reply with quote

I will certainly use your DSU with some projects WidgetCoder. Great job! Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Sun Apr 23, 2006 6:27 pm    Post subject: Reply with quote

Thanks guys Very Happy
Back to top
View user's profile Send private message Send e-mail
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 159
Location: Spain

PostPosted: Sun Apr 23, 2006 6:42 pm    Post subject: Reply with quote

Great Job and an excellent idea.

I'm working that using a different structure of data entry that it allows to place elements in positions relative to others and percentage to width and height.

When this ready one I upload code.

very good work Thumbs Up
Back to top
View user's profile Send private message Visit poster's website
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Mon Apr 24, 2006 7:10 pm    Post subject: Reply with quote

uvedese wrote:

When this ready one I upload code.

Please do I'll look forward it.. Very Happy

Hopefully VDS v6 will offer some form of dynamic element resizing. Although I fear I'll be too old to care by the time it's finally released. Mad
Back to top
View user's profile Send private message Send e-mail
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 159
Location: Spain

PostPosted: Sun Apr 30, 2006 12:20 pm    Post subject: Reply with quote

Hello WidgetCoder Very Happy

Here it presents/displays my solution to the problem: ResizeDSU.dsu.
It does not have the advantages of your version but it implements possibilities such as: position relative to two elements in vertical and horizontal and percentage horizontal and vertical position.

With your permission I will raise ResizeDSU.dsu in my Web. I thank for your shining idea. Good work again

__________________

uVeDeSe
visit: http://www.uvedese.es


Last edited by uvedese on Wed Apr 02, 2008 8:51 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 159
Location: Spain

PostPosted: Sun Apr 30, 2006 12:22 pm    Post subject: Reply with quote

Oppsss Rolling Eyes

I forgot the file...

Include the source code...



ResizeDSU.zip
 Description:
Resizable Unit

Download
 Filename:  ResizeDSU.zip
 Filesize:  8.17 KB
 Downloaded:  1236 Time(s)

Back to top
View user's profile Send private message Visit poster's website
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Mon May 01, 2006 5:28 am    Post subject: Reply with quote

uVeDeSe Thats an interesting approach, nice code.

I experimented with a fairly similar approach in the DLL version of DynPos that Ive been playing with. However I found that when you resize an element by its relational proportions to another element a dependency is created that prohibits the removal one element without the other. Not a big deal but you never know what someone will do with it.

The method Im working on now would only require the user to identify how many stacked or side/side elements are being resized together in the same direction. This will allow two or more elements to be resized and/or positioned without creating any dependencies within the controlling list. The syntax will be very similar to DynPos.dsus Add command but with the following differences: 1. The flags TLWH could be followed by a number indicating the number of elements being positioned in relation i.e.: W2H (2 side/side) WH3 (3 stacked). 2. T-H or L-W will no longer be mutually exclusive so any flag combination could be used. Hopefully I'll get some free time this week to complete and post it.
Back to top
View user's profile Send private message Send e-mail
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 159
Location: Spain

PostPosted: Mon May 01, 2006 5:08 pm    Post subject: Reply with quote

Hi WidgetCoder:

I understand the limitations that you comment to me.

I will add some new possibilities to my version to replace the problems: to modify parameters and to clear elements.

I wait for your new version of DynPos.dsu Smile
Back to top
View user's profile Send private message Visit poster's website
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Fri Dec 01, 2006 6:20 pm    Post subject: Reply with quote

Does DynPos work with the Browser element in VDS? I have tested it but did not have any luck getting it to resize the browser element on my dialog. It resized other elements fine.
_________________
Joe Floyd
Back to top
View user's profile Send private message
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Fri Dec 22, 2006 6:53 pm    Post subject: Reply with quote

jwfv wrote:
Does DynPos work with the Browser element in VDS? I have tested it but did not have any luck getting it to resize the browser element on my dialog. It resized other elements fine.


I apologize for my slow response, the old version posted here will not control the browser element. This version uses "@winexists(~ElementName)" to obtain the window IDs which doesn't work for the browser window. The browser element actually places three nested windows on the dialog (CLASS: #Shell Embedding, .#Shell DocObject View, ..#Internet Explorer_Server). In order for the "Window Position" command to work on the browser you need to use the outer window's ID. The best way I have found to accurately obtain its ID is quite complex: 1. Compare @dlgpos and @winpos of the main dialog to obtain the Non-Client window border size. 2. Obtain the browser's position on the form with @dlgpos add the window offset and NC window size. 3. Use @WinAtPoint which will obtain an ID from one of the browser's child windows. 4. Create a list of the main form's child windows using @window(MainWin,Child)...NEXT... repeat on each returned window on the list until you find the window ID that matches your @winatpoint result. 5. Back down the tree from there until you find a window class that matches "#Shell Embedding" and use its ID for positioning. It can be done in VDS it's just a pain in the arsh...

I'm waiting for VDS6 to be published before I update the code in case the new version has a similar feature built-in. The updated DynPos will have the ability to control the browser and other external elements. Also it will be a DLL/DSU combination to avoid any Vista security concerns of using drop-files.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Units All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
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