Not able to drag my transparent window - objective-c

For my OSX application. I have a main window with some output. On a button click a new window will pop up with a drawing on its NSView. I am making this second window transparent by setting its background color as transparent with RGB values as 0.0 and also alpha 0.0. So now my second window just have this random drawing on a transparent background. I have put both the windows in the same xib file.
My problem is that, the transparent window with a drawing that pops up is not draggable. I have overriden mouseDragged: (NSEvent *) in my secondwindow:NSWindow class. But still it is not draggable. This method should work when I try to drag my transparent window using trackpad right ? Any help would be very much appreciated . Thanks in advance

Transparent window is not draggable. The only option is to add something like imageview with image, now click and drag the imageview. Total transparent will move.

Related

Add button to white background NSPopover, but the button has shadow area

all:
I have one customized NSPopover, and I set it's background color into white. Then I add one Button without border into the viewcontroller, and put the viewcontroller into the NSPopover. The question is that, there will be shadow area for the button in this NSPopover, could someone have any ideas about this?
The issus is also exist for Label.
The customized NSPopover code is as follow:
https://github.com/shergin/NSPopover-MISSINGBackgroundView
and the result is:The final result of adding button to NSPopover
This is a known bug.
Set the appearance property of the textfield to NSAppearanceNameAqua.

Zoom in and out with touch in Xamarin.Forms

I am new to Xamarin and trying to create a simple page. I have scrollLayout and grid inside. In the grid I have a frame and some text in frame. I deployed it on my andriod but when i try to enlarge the screen with touch(two fingers) it doesnt enlarge the screen. I want user to enlarge the text and read. Any help would be appreciated please..
Scroll layout doesn't have the feature for zooming in/zooming out entire view. It just scrolls your content when not fitting screen height / width.
To achieve effect you want you need two things:
Pinch zoom gesture support (https://github.com/twintechs/TwinTechsFormsLib, http://www.mrgestures.com)
Label.ScaleTo or Label.FontSize properties which are controlled with your gesture.

Facebook App Style UIImageView

I have bunch of images inside a UIScrollView and have a tap event setup on each image. When I try to make the image full screen it actually is cut off by the scroll view. I am trying to implement a Facebook style UIImageView where the image zoom in and takes over the full screen on tap.
Does anyone have suggestion on how to approach this cause the way I am doing the image is cropped to the size of the scroll view.
Well, usually you would disable clipping, but the scrollview relies on clipping to do its job so that won't work.
My suggestion would be to push a copy of the image above the scrollview, and animate that to full screen. You should be able to get the rect using convertRect:toView: and it would be pretty straightforward from there.
btw, Is there a reason not to use a tableView for this?
When tapped hide the image and add the image at the proper place in the scrollview superview and over the scrollview. Then animate it to take the full screen.
Facebook App style UIImageView is nicely implemented in below given source code, you can take a clue from this
https://github.com/michaelhenry/MHFacebookImageViewer

A Transparent window without the things inside being transparent

I have been looking all over the internet to find out how to make a window where the window itself isn't there its just a image or a button, for example a free floating image not attached to any windows. I did find the apple roundTransparentWindow page, but it is a bit confusing and really all I would like to know is a image or bu
Creating a completely transparent window is a multi-stage stage process:
Create the window using the style NSBorderlessWindowMask if you are doing it in code. If you are creating the window in a XIB then in Xcode uncheck all the boxes under "Controls" and "Appearance" in the Inspector.
In code set the window's opaque property to NO: [window setOpaque:NO]
In code set the window's background color to nothing: [window setBackgroundColor:[NSColor clearColor]]
Remember that the window will have no window controls (close, resize etc.) the user can interact with - you must manage all these things in your own code.

How do you vertically centering an image on an NSButton

I'm build a Mac application in the style of the Lion Mail.app. As part of this I'm attempting to create a simular toolbar to the one in the Mail.app but I can't seem to get the image in my toolbar button centered vertically.
Looking at the Mail.app toolbar I see a nice series of buttons with centered icons:
but when I go interface builder I can't seem to recreate the same button. What I get is:
What I've tried doing is, in Interface Builder:
Create a new window
Add a NSToolbar to that window
Add an NSButton to the toolbar with Style - 'Push', Image - 'Envelope', Position - 'NSImageOnly', Scaling - 'Proportionally Down'
As you can see the icon is clearly not centered vertically on the button like those in the Mail.app toolbar.
Anybody have any ideas???
At the moment I'm using XCode 4.2 and laying out this button with Interface Builder. I'm trying to build the toolbar button by ONLY adding the image to the button and not painting the button for each item, ie drawing the border and icon.
Any help would be greatly appreciated as this has been driving me a little nuts.
Thanks in advance - AYAL
Turns out the answer to this problem was much simpler then I had expected. After a lot of teeth gnashing, hair pulling, and twiddling pixels I came across the solution.
Instead of using a 'Push' button I simply had to switch to a 'Round Textured' button. Once I did that any image I added to the button was nicely centered. Next I just had to manually scale my image to look right.
The recipe then for a Mail.app Toolbar is as follows:
Add a button to your Toolbar
Set the button style to 'Rounded Textured'
Set the image of the button
Set the position to 'NSImageOnly'
Set the button size to 40 x 25 as well as the min and max sizes of the ToolbarItem
The result is a toolbar that can look very simular to the Mail.app toolbar.
Thanks All - AYAL
One way to do it is to have your image actually be the button i.e. take up all of the button's canvas. You will have to use the button's setBordered: method so the button's border is not drawn.
you could make the button image in something like gimp or photoshop then use that as the background or image for the button.
i feel like your going to say "this is what im doing". and maybe you made the little mail icon but i mean for you to make the whole button, outline and everything, then use that for the button image. make sense?
like here, just use this as the background