Script (.bat) file that will extend display and arrange displays - cmd

I'm trying to create a script that will 1) extend display and 2)rearrange like the below.
I think DisplaySwitch.exe /extend will extend cannot figure out how to arrange with screen 2 above screen 1.
Rearrange Display

Related

PyQt: Creating simple men with images

I'm creating a simple GUI menu with 2X3 ImageButtons using PyQt4. It should look like this, except there should be images instead of text:
I followed this tutorial: http://popdevelop.com/2010/05/an-example-on-how-to-make-qlabel-clickable/
for creating image buttons out of QLabels and I put them in grid layout.
It works fine, but my problem is that my application is supposed to be used using keyboard arrows (without mouse), so I want to make visible which label is focused before being selected.
Is it possible to do in PyQt? Thanks in advance
One way of capturing keyboard events is done by installing an event filter in your app with installEventFilter ( QObject * filterObj ) and then filter with something like:
if event.type() == QEvent.KeyPress:
print "Key pressed!"

How to get touch pointer inside a specific Grid

I have a layout like the following:
grid-1
grid-2
grid-3
...
one nested inside of another.
Within Grid-3, there are 10x10 matrix of images. What I'd like to know is how do I know a touch is within grid-3 and which image is touched? I read the example from eBook and code:
primaryTouchPoint.TouchDevice.DirectlyOver == txtblk
I tries to use it with my grid-3 name, the touch pointer only at the very top line of grid-3. And I don't want to write 100 line of if-else statement for each image. And also when I use
grid-3.Width, actualWidth, these method all return 0. How do I know the size of this grid-3 on screen?
-Henry
One way would be to wrap each image inside a control that has a click event, like a button. Point all the click event handlers to a single method and grab the child image from this.

Edit onClipEvent Actionscript

I am a beginner so please take it easy. First some history, I am trying to modify a flash movie (not created by me) that has 4 images in it.
I have to now add 2 more images (pic5.png and pic6.jpg) to the "slideshow" as shown in the attachment, I have added the 2 images to the library. The problem I am having (as I understand, I may be incorrect) is that _root.count = 4 causes the movie to jump back to the first image after it displays the 4th one which does not display the 5th & 6th image.
My question, how do I edit the value of _root.count to 6, so that it will show all the 6 images. Additionally how do I create a hyperlink on each image.
Please can someone guide me.
Many thanks.
Looking at your screen shot, Layer 2 (which contains the slideshow movieclip) is locked. If you unlock the layer by clicking on the padlock icon you should then be able to edit the script.
To edit the script double-click on the script in the Movie Explorer panel and the Actions panel should open. You can edit the script here.
The second part of your question - how to create a hyperlink - is very broad and there are many different ways to approach it. The most elegant approach would depend on how your project was structured.
The simplest way might be to define a variable to hold the path to the current image and add another onClipEvent handler.
So in the existing onLoad you would add…
this.path_to_image = http://your-domain.com/images/your-first-big-image.jpg;
Then add the new event handler
onClipEvent(mouseUp){
getURL (this.path_to_image);
}
You would then have to update the path_to_image variable whenever the image changed.
slideshow.path_to_image = http://your-domain.com/images/your-next-big-image.jpg;

Excel - Open Multiple Windows and Tile on Sheet Tab Click

I'm trying to write a macro and I have the 2nd half done (tile windows showing specific sheets) but not sure how to do the first half.
There are some sheets that when displayed I would like to look at two other sheets at the same time (multiple window tiling). This is easy to set up manually, but I'd like it to happen automatically when I click on any of the 3 sheet tabs that are in the spreadsheet. There are other sheets that should be handled normally and have only 1 window open.
I'm thinking that I need to set up some sort of onClick event, but I haven't ran into it before in Excel and didn't see anything initially in Google.
Google figured it out once I rephrased my question. In VBA, select the Sheet object (not a module) and use this code:
Private Sub Worksheet_Activate()
'Your code goes here
End Sub
The code will be executed when the sheet is activated.
My reference: http://www.mrexcel.com/forum/showthread.php?t=71663

Applescript, multiple monitors and maximum window sizes

I'm looking into windows management on OS X (trying to achieve something like WinSplit Revolution), and I need to use applescript to pull out the maximum size of a window on a given monitor. Currently I've found:
tell application "Safari"
set screen_width to (do JavaScript "screen.availWidth" in document 1)
set screen_height to (do JavaScript "screen.availHeight" in document 1)
end tell
This works for the main monitor on a multiple monitor setup, but doesn't provide at all for secondary monitors. I've also read into the method detailed here, and this obviously doesn't work for multiple displays in an efficient manner. Is there an effective way to get the maximum window size of multiple displays with applescript?
There have been many attempts to get monitor dimensions by reading system plist files. See http://macscripter.net/viewtopic.php?id=15425
If you have access to AppleScript studio (ASS) terms, you can make method calls into NSScreen to get all the monitors then ask them for their sizes. The easiest way to use ASS terms in a plain AppleScript is to compile an empty ASS application in Xcode. In this example, I've created a simple ASS app name ASSAccess which gives me access to ASS terms:
tell application "ASSAccess"
-- The first item in this list will be your main monitor
set screensArray to call method "screens" of class "NSScreen"
set Displays to {}
if {} is not screensArray then
repeat with displayNo from 1 to (count screensArray)
-- call visibleFrame instead to take into account the Dock and menubar
set dims to call method "frame" of (item displayNo of screensArray)
copy dims to end of Displays
end repeat
end if
end tell
Now, the issue I run into with these dimensions is the coordinate system. NSScreen's frame method gives you a rectangle with the origin in the LOWER left hand corner of the main monitor. Then, any secondary screens are given relative to that origin. If you are trying to determine if a window is within these bounds, window position is giving within a coordinate system with the origin at the UPPER left hand corner. This is a whole mess of conversion that I haven't figure out yet.

Resources