Adjusting Positon Of a Desktopx object.............Tell me please please please

Thursday, June 26, 2008 by swapna alice | Discussion: WinCustomize Talk

Hi friends

Please tell me how to adjust position of a desktopx object so that it remain at center for every resolution....

Is this right...........

Horizontally..........Center
Vertically..............Center


When i Applied these settings for my widget, it wasn't at center perhaps size of animation = 3200x2400 was too big for resolution supported by my pc...but why that was not at center.......

Ok I'll resize the animation, but I need to put that object at center...
Please help me out.....


Thanks in advance...........




Philly0381
Reply #1 Thursday, June 26, 2008 11:46 AM
swapna alice are you talking about an object you are building or one that you have downloaded to use on your desktop?   
swapna alice
Reply #2 Thursday, June 26, 2008 11:57 AM
I am talking about the one that i am trying to build...
Thanks for your reply
Philly0381
Reply #3 Thursday, June 26, 2008 1:05 PM
swapna alice soneone will be along to answer that question, wish I could.

I am curious though, what type of object is it, what does it do?

If you look at the ones that are in the gallery library I don't remember seeing any that have a desktop position set. They seem to be made to be put in a position that suites the desktop theme.

There is a function option in properties that allows you to set movement of the object or widget.
ZubaZ
Reply #4 Thursday, June 26, 2008 1:27 PM
I'm far from an expert but using the system virtual screen height and width and the Object positional properties you may be able to create a script that keeps everything centered (until a user moves it if you allow them to).

I wish I had the expertise to help write the script . . (and I'll hack at it a bit) . . but I hope this helps some.

System.VscreenLeft, System.VScreenTop, System.VScreenWidth, System.VScreenHeight

These are the suggested properties to use when checking the monitor coordinates, since they take in consideration the whole virtual screen area, and not only the primary monitor. This will still work in a single monitor setup but will also support multi-monitor setups.
Note that the virtual screen origin is NOT generally (0,0), but it is (VscreenLeft, VscreenTop). Because of this .VscreenWidth returns the WIDTH of the virtual screen, not the right border! To calculate the right and bottom borders use the following code:

VirtualScreenRight = System.VScreenLeft + System.VScreenWidth
VirtualScreenBottom = System.VScreenTop + System.VScreenHeight




Object.Top, Object.Bottom, Object.Left, Object.Right, Object.Move, Object.Rotation (and Object.States("name").Rotation)

With these positioning properties, you can explicitly set or retrieve the location of one side of the object.
If you want to reposition an object, the most efficient was to do it is via 'Move' To do this you specify x and y coordinates in pixels of where you want to place the object.
You can also rotate an object using Object.Rotation.

Examples:

Object.Top = 500
Object.Move 500,200

For x = 1 To 10
Object.Rotation = x*36
Object.Sleep 200
Next


Vad_M
Reply #5 Thursday, June 26, 2008 2:17 PM
Hey Zu! I see you have posted a big article about DX!   

However the necessary code here:

X = cint((system.WorkareaRight - object.width)/2)
Y = cint((system.WorkareaBottom - object.height)/2)
object.move X,Y '<== this will move your object directly into the center of your screen

Best Regards.   
ZubaZ
Reply #6 Thursday, June 26, 2008 2:27 PM
Hey Zu! I see you have posted a big article about DX!
I don't know why I even bother trying; you DX experts have forgotten more than I will ever learn.

I was so far off.   (
HG_Eliminator
Reply #7 Thursday, June 26, 2008 2:30 PM
Nice work Vad_M   
Vad_M
Reply #8 Thursday, June 26, 2008 5:50 PM
I don't know why I even bother trying; you DX experts have forgotten more than I will ever learn.


You do this because you are undoubtedly a Soul of WC Community!

I like how you try to help each of us and may be assured that your posts are very useful every time.    Just a Swapna Alice's question demands for more simple answer. Therefore I have tried to add a few lines of code to illustrate a theory posted by you.   
superman
Reply #9 Thursday, June 26, 2008 10:31 PM
Dainty Script, Sir Vad_M..

superman
Reply #10 Friday, June 27, 2008 10:10 AM
I don't know why I even bother trying; you DX experts have forgotten more than I will ever learn.I was so far off.  


Hey Zu!! Cheers!!!

you are always helpful...Whatever you say is a great help............

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01