dock

Can Margin be enforced even with Dock property set?

北慕城南 提交于 2019-12-06 16:32:48
问题 I have a WinForms Form with a few controls on it. All of them are GrouBox controls and I want them stacked, with a vertical margin set between them. I have set the Dock property to Top and it stacks them alright, but ignores the margin (controls are as close to each other as they can be). Can these margins still somehow be enforced? Basically, it would calculate the regular docked position (as if the margin was 0) then apply the margin. Is something like this possible? The other way I've

Events when dock is showing or hiding

我是研究僧i 提交于 2019-12-06 09:34:16
How can I get events when the Dock is showing or hiding? You can get a notification if the dock is visible or not using Carbon. I do not know of any way to do it in Cocoa. (I haven't tested this; it's from the code here ) Create your callback method: #import <Carbon/Carbon.h> static const EventTypeSpec appEvents[] = { { kEventClassApplication, kEventAppSystemUIModeChanged } }; OSStatus DockChangedHandler(EventHandlerCallRef inCallRef, EventRef event, void *userData) { OSStatus status = eventNotHandledErr; switch(GetEventClass(event)) { case kEventClassApplication: { SystemUIMode *outMode;

Getting the position of my application's dock icon using Cocoa's Accessibility API

余生颓废 提交于 2019-12-06 03:46:55
问题 How can I get the position of my application's dock icon using the Accessibility API? 回答1: Found it! Using this forum post as reference, I was able to shape the given sample code to what I needed: - (NSArray *)subelementsFromElement:(AXUIElementRef)element forAttribute:(NSString *)attribute { NSArray *subElements = nil; CFIndex count = 0; AXError result; result = AXUIElementGetAttributeValueCount(element, (CFStringRef)attribute, &count); if (result != kAXErrorSuccess) return nil; result =

Qt resize event for docks

孤街浪徒 提交于 2019-12-06 02:58:40
问题 Is there a way to catch resize events for docks in Qt? I need to be able to detect when a dock is resized (and not only when its location or 'features' change). It looks like there is no 'resized' signal for QDockWidget. 回答1: If you do not wish to subclass to just get resize event control, you can installEventFilter Small example would look like ( MainWindow.h ): (MainWindow holds DockWidget Here) protected: bool eventFilter(QObject *obj, QEvent *event); and in ( MainWindow.cc ): MainWindow:

How to tell if a modifier key is down during drop on Dock

给你一囗甜甜゛ 提交于 2019-12-06 00:53:44
My Cocoa application supports dropping files onto its Dock icon, but I'd like different behavior depending on whether a modifier key is held down (Command, Option, etc.). I tried checking the modifierFlags for the currentEvent , but they are the same regardless of whether a modifier is held down, or not (I was testing with the Option key). Code: // Code is inside my AppDelegate - (void)application:(NSApplication *)theApplication openFiles:(NSArray *)files { BOOL optDown = (([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) == NSAlternateKeyMask); NSLog(@"flags: %u, down? %@", [[NSApp

SIMBL/Bundle/dylib injection into Dock.app

血红的双手。 提交于 2019-12-05 16:19:16
I'm working on a simple SIMBL bundle to decrease the FullScreen animation time in Lion. It's no big deal to change the animation of the windows, however doing that for the menubar/desktop animation part (where the menubar+desktop slide to the left) is a problem. I think that Dock.app is responsible for that animation. However, SIMBL can't inject a bundle into Dock.app (same with Finder). I tried creating a .dylib which then would be loaded into Dock by setting the LSEnvironment in Dock's Info.plist but that failed. Is there any good way to inject a bundle/dylib into Dock.app? Thanks in Advance

How to dock a windows form in C#?

落爺英雄遲暮 提交于 2019-12-05 07:25:01
I just would like to know if it is possible to dock a windows form on top of the user screen? I have been trying to do this by manually setting the position of my form to the coordinates I want. But using this method, however, allows the user to change the position of the form just by dragging it. I want to make the form docked to the upper portion of the screen since this window form will server as a menu for the project I am making. Thanks a lot. :) I would consider using the Control.Dock property along with one of the DockStyle enumeration values. You might need to play with the Layout too,

Can Margin be enforced even with Dock property set?

那年仲夏 提交于 2019-12-04 22:15:15
I have a WinForms Form with a few controls on it. All of them are GrouBox controls and I want them stacked, with a vertical margin set between them. I have set the Dock property to Top and it stacks them alright, but ignores the margin (controls are as close to each other as they can be). Can these margins still somehow be enforced? Basically, it would calculate the regular docked position (as if the margin was 0) then apply the margin. Is something like this possible? The other way I've tried this is with FlowLayoutPanel with TopDown option. However, then I need to manually set the size and

Adding an NSProgressIndicator to the dock icon

僤鯓⒐⒋嵵緔 提交于 2019-12-04 19:37:35
问题 I'm creating an application which should show a progress bar in the dock icon. Currently I have this, but it's not working: NSProgressIndicator *progressIndicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, 10.0f, 20.0f)]; [progressIndicator setStyle:NSProgressIndicatorBarStyle]; [progressIndicator setIndeterminate:NO]; [[[[NSApplication sharedApplication] dockTile] contentView] addSubview:progressIndicator]; [progressIndicator release]; Or must I draw it on the dock

Drag messages from Mail onto Dock using Swift

别来无恙 提交于 2019-12-04 09:44:05
问题 I am trying to get my application to accept a mail message that was dropped onto my application's dock icon directly from Mail. I have followed this link Dropping Files onto Dock Icon in Cocoa and tried to convert in into Swift and the latest version of Xcode but with no joy. This is my AppDelegate.Swift file: import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { func application(sender: NSApplication, openFile filename: String) -> Bool { println(filename)