Menu items in main menu bar show up with different font sizes.. what gives? - cocoa

I just noticed the strangest thing when updating one of my Mac applications.
The menu bar of the application when run has different font sizes (!?). Some items are in the normal system text size (13 point?) and others are a few points smaller (11 points?). What gives?
I didn't even know that you could do this.. never mind understanding how this just came about of its own volition..
I immediately zeroed in on the likely culprit XCode 4, but compiling the same project with 3.2.5 shows the same problem.
I'm rather flummoxed by this.. has anybody come across this weird phenomenon?
Best regards,
Frank

I`m used to iOS but you may have a similar issue. The UILabels have an "autoshrink" property, which reduces the font size if the text is too long, to avoid truncating it. You can turn this property off in the Interface Builder. Hope this helps!

Related

Hints on Firemonkey not displaying in Delphi Seattle

It is nice that Firemonkey got again the Hint property for controls, at least in Delphi Berlin and Seattle.
However, the implementation seems to be a bit flawed yet.
One weird issue is that the displaying of the Hint seems related to the form's BorderIcons property. If the BorderIcons are left with the default values (Maximize, Minimize, SystemMenu), the hint shows. But if I change some of the border icons, the hints don't show any more. I don't see any logic for it, so it looks like a bug. I traced some code in the FMX.Forms unit, but couldn't find any relation to the border icons. The hints in TriggerControlHint and other methods seem to be set correctly.
Has anyone had such an issue and have you solved it somehow?
There are other issue, like hints not working on a XE8 project converted to Seattle on Windows. It was mentioned in this question Firemonkey Hints don't work in Delphi Seattle, for a project converted from XE7. I fixed that by recreating the dproj file and it probably has something to do with the default manifests/themes.
Also hints for controls placed on a TLayout don't show, because the layout doesn't have the ShowHint property. Doesn't sound very logical to me, but at least it can be overcome by setting each control's ShowHint property manually.
The issue is reported on QC as RSP-13218
After more tracing through FMX.Forms I found the bug.
In the end of the TCommonCustomForm.Create method the hint object is set with
if not (csDesigning in ComponentState) then
FSharedHint := THint.CreateNewInstance(Handle);
but when the BorderIcons are changed, and also in other cases, it calls the TCommonCustomForm.Recreate method, which also recreates the window handle, so the hint is no longer linked to it.
To fix it I had to also recreate the hint by adding a few lines before the finally clause in the Recreate method:
if Visible and ([TFmxFormState.Showing] * FormState = []) then
FWinService.ShowWindow(Self);
// Added lines
if not (csDesigning in ComponentState) then
begin
FSharedHint.Free;
FSharedHint := THint.CreateNewInstance(Handle);
end;

Xcode 7.3, Swift 2.2 Storyboards Extremely Slow

I have a huge app in process, and since updating to Xcode 7.3, doing anything in storyboard is like molasses!!
About a month ago, I had about the same speed using one HUGE storyboard, so I split the project up into 5 separate storyboards, and Hallelujah, a hundred times faster!
But now, after updating, even dividing to 7; slow as can be!
I'm about to back up, then try and recreate one big one, then back up again, then divide again - to see if that does anything; but I am doubtful.
Anyone know how to fix this, or what is wrong with the latest update?
Well, not a great solution but, all I can determine is that; if the number of items and constraints in the view gets over a certain amount (using Xcode 7.3), the speed suddenly drops horribly.
So what I ended up having to do with this last storyboard (8 of 8) is to take a slide out side pane full of buttons and subviews, and place it in a container view - so that I could give it its own VC and thereby make it a stand alone 9th storyboard.
Not a great solution that's for sure, especially since I had to tie all of the buttons and methods to the parent view controller. I was lucky in this event in that the parent view (my main app map) is a single instance occurrence so I was able to reference it at launch, and merely prefix my former methods with the reference. If this was not so, I guess I would have to have done some serious protocol / delegation.
So, a proper solution (or 'fix' if it is Xcode's doing) is still wanting :)

VB6 Form will not resize when I run

I have to make some modifications to a VB6.0 project that I haven't touched in years so my memory is getting a little old.
I have a form and then I make the form bigger in the IDE. When I run the program, the size increase does not show up although it looks perfectly fine in the IDE.
What could be causing this?
If I change other stuff on the same form, the changes show up when I run. The only thing this is happening with is the size.
This form is a lot smaller that the main window so there is space to expand into.
Other forms in my project do not have this same behavior.
What else could I check for?
Look for something that sets the height and width in code at runtime. Use the IDE's search specifically to look for ".Height" and ".Width" and ".Move".
I think that an easier solution might be to set the form's height and width in the form_load event, so it initially becomes as big as desired.

Xcode: Method definition not found message on a non-existing method (?) + slight color change in XIB

I have two basic practical problems:
1) The first one is really stupid. I receive a message saying: "Method definition for 'aIncreasedSelection' not found, together with an "Incomplete Implementation".
Well, that is quite strange, because I don't have this method in neither my .m or .h file (and the class name is mentioned in the remark).
I used to implement this method, but I deleted it because it was redundant. In a certain way, it appears as if my Xcode project can't let go of the method...
2) The second question is also a very mysterious one. I have a couple of viewControllers in which I have put the identical same background, and the identical same buttons. It's really identical in size and position in the screen as well (I defined the pixels). For an unknown reason, when I switch between the views, one of the buttons changes very slightly its color (it is a Photoshop created button with mirror effect on the bottom, it's the mirror that becomes lighter). That is really annoying because it's supposed to be identical; when the user switches views now, he can see that there is a color difference in the button (supposed to be planted as a button in a dock, which should be identical over the entire app)...
Very frustrating as I cannot solve these small mistakes... Any ideas? Thanks!
Regarding your first problem, if you have verified that it no longer exists in your .h or .m file, try to cmd+shift+k and clean your project, then rebuild. This should update everything and in theory solve that issue for you.
As for the second problem, it sounds strange indeed. Is there any chance you could provide pictures somehow? Are you statically loading the image into similar buttons, or are you doing something differently?
Re - opening my project solved my first problem (unlike the refresh - cmd + shift + k, which didn't work). The color problem is not solved despite :-/
It was definitely a bug since I didn't change anything. It is in fact - very confusing!

Handle OSX Dock Drag N Drop

I looked high and low for information on how to handle drag n drop to the dock in OSX. The drag n drop documentation (http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html#//apple_ref/doc/uid/10000069) I found all deal with dragging from view to view. If anyone can point me to some code samples, that would be excellent.
I'm writing my app using the PyObjC bride, but Cocoa examples would be equally welcome :-)
Well, looks like I asked too soon. Here is a great tutorial that shows how one does it:
http://recurser.com/articles/2007/04/13/cocoa-drag-to-dock-to-open/
Basically, just set your controller to be the delegate of NSApplication and implement the openFile method.
Here's a similar question from a couple weeks ago. My answer covered dragging files, which is what you're talking about; the other answer covers dragging data, such as images and bits of text (not image files or text files, but bare data).
http://lethain.com/entry/2008/aug/06/cocoa-drag-and-drop-text-into-the-dock-icon/ covers dragging and dropping text into a dock icon with pyobjc. You can adapt this into other files reasonably easily.
Here is a newer article for Xcode 4
http://fredandrandall.com/blog/2011/09/12/how-to-open-any-file-you-drag-onto-your-apps-dock-icon
Here is an example project "DockDrop".

Resources