Lazarus

Programming => Widgetset => Cocoa => Topic started by: syntonica on December 07, 2019, 06:13:50 pm

Title: isFlipped isn't
Post by: syntonica on December 07, 2019, 06:13:50 pm
I've only been here a week, so I don't feel comfortable reporting a bug quite yet as I'm still finding my way around the forum, the bug tracker, and Pascal. So...

In Lazarus, some windows (NSViews) do not have their isFlipped property set correctly.  My example, attached, is of the Help Selector window.

Edit: Preview doesn't apparently show your attachment. :(




Title: Re: isFlipped isn't
Post by: wp on December 07, 2019, 07:23:22 pm
"IsFlipped" -- this is for right-to-left mode, isn't it? So the control that you show is flipped vertically instead of horizontally, right? This control is a TTreeView. Are the other controls which do not flip correctly TreeViews as well? Treeviews are used, for example, in the object tree above the object inspector, the project inspector, IDE options ("Tools" > "Options"), Project group etc.
Title: Re: isFlipped isn't
Post by: syntonica on December 07, 2019, 07:52:24 pm
isFlipped handles the coordinate system in a view. Cocoa standard is Cartesian with 0,0 in the bottom right. You must set isFlipped to get 0,0 in the upper right. 

Other treeviews seem to show up fine in Lazarus. There's probably subclassed views and one subclass is not set up properly compared to the others.
Title: Re: isFlipped isn't
Post by: Alextp on December 07, 2019, 08:55:38 pm
Pls tell us how do you call that Help Selector dlg, I cannot find such dlg in my IDE.
Title: Re: isFlipped isn't
Post by: syntonica on December 07, 2019, 09:18:24 pm
Pls tell us how do you call that Help Selector dlg, I cannot find such dlg in my IDE.
Put cursor over a word in the Source Editor and press F1 to get help.

Now that's really bizarre... When I went back (i.e. the Help window was redrawn), it was right-side up!

There's some wackiness afoot here!
Title: Re: isFlipped isn't
Post by: syntonica on December 07, 2019, 09:24:53 pm
I was able to get the Help window open despite the many warnings only to find this!

(Also, please note the ?'s for umlauts.)
Title: Re: isFlipped isn't
Post by: syntonica on December 07, 2019, 10:33:14 pm
I've been playing with different windows.  It appears that the views are drawn first upside down, and then flipped. Usually.

This is backwards--the flipped property should be overridden as part of the subclassing, not set after the view has been populated.

Code: C  [Select][+][-]
  1. -(BOOL) isFlipped                               {       return YES;     }

Title: Re: isFlipped isn't
Post by: syntonica on December 08, 2019, 05:58:49 am
I'm having no luck on the Cocoa front. Closed windows are not being disposed of.
Title: Re: isFlipped isn't
Post by: trev on December 08, 2019, 07:16:42 am
Quote
I'm having no luck on the Cocoa front. Closed windows are not being disposed of.

When this happens I quit and restart which fixes the issue.
Title: Re: isFlipped isn't
Post by: Alextp on December 08, 2019, 11:26:08 am
Try to update Lazarus ("svn up" in lazarus folder) and recompile. Cocoa bugs are being fixed..
Title: Re: isFlipped isn't
Post by: Alextp on December 08, 2019, 11:28:02 am
Cocoa treeview was fixed in May 2019
https://bugs.freepascal.org/view.php?id=34334
Title: Re: isFlipped isn't
Post by: syntonica on December 08, 2019, 11:06:15 pm
Try to update Lazarus ("svn up" in lazarus folder) and recompile. Cocoa bugs are being fixed..
My Lazarus install did not have the .svn folder, so I pulled the lazarus_2_0 branch and did "make all". It selected "Target OS: Darwin for x86_64" and did fine until it hit Carbon, where it errored out with "Error: User defined: only cpu i386 is supported" and failed. "Make" is on my short list of things I need to learn as I wean myself off of Eclipse/XCode (I'm currently using Geany as a crutch) , so which switches do I need to use to get a full, working x64 Cocoa IDE?  Thanks in advance.
Title: Re: isFlipped isn't
Post by: trev on December 09, 2019, 01:13:41 am
This is the script I use on macoS 10.14.x:

Code: [Select]
#!/bin/sh
make clean LCL_PLATFORM=cocoa CPU_TARGET=x86_64 bigide

Note: bigide adds the same packages as the release version.
Title: Re: isFlipped isn't
Post by: syntonica on December 09, 2019, 02:02:48 am
Thanks! I was able to compile the latest.  However, I am still seeing both issues. Well, I was, but then I wasn't... :/


Also, I'm not getting a crash report, but lhelp takes down Lazarus, who reports this message:
"Service exited due to SIGPIPE".  It makes it a little harder for me to learn if I have to hunt through 6 huge PDFs.


As soon as I get my sea legs, I'll start poking around to see what's going on with these...
Title: Re: isFlipped isn't
Post by: Alextp on December 09, 2019, 10:34:24 am
@syntonica
Do you mean that mentioned bugreport is not fixed for you?
https://bugs.freepascal.org/view.php?id=34334
Do you see Treeview flipped anyway?
Title: Re: isFlipped isn't
Post by: syntonica on December 09, 2019, 10:37:39 am
Sometimes. On initial viewing, it can be flipped, but after closing and reopening Lazarus, it comes up correctly.  Same with the window not being properly disposed of.  It's all very random and odd, which makes me suspect a threading issue.
Title: Re: isFlipped isn't
Post by: Alextp on December 09, 2019, 10:52:23 am
Maybe you can make small demo with treeview, which shows the bug on 1st form show? then post it the that Mantis issue.
Title: Re: isFlipped isn't
Post by: syntonica on December 09, 2019, 06:45:08 pm
I'm afraid that's still above my pay grade at the moment. I haven't looked at Forms at all as I won't be using them. Give me another month or two until I'm more comfortable with Pascal grammar.  I'm still fighting with := for assignment!

Edit: It looks like I'm going to start porting my C++/ObjC++ code to FP, so I'll be around for a while.  When I have a spare hour, I'll start on a basic Form to see how it all works.  It looks like Java Swing/Matisse to me. Is it kind of the same idea?
Title: Re: isFlipped isn't
Post by: Alextp on December 14, 2019, 11:39:36 pm
LCL is not the same idea as Java Swing, maybe Swing is the same idea, or partly the same.
Title: Re: isFlipped isn't
Post by: Leledumbo on December 22, 2019, 10:17:03 pm
Edit: It looks like I'm going to start porting my C++/ObjC++ code to FP, so I'll be around for a while.  When I have a spare hour, I'll start on a basic Form to see how it all works.  It looks like Java Swing/Matisse to me. Is it kind of the same idea?
Not the same idea, not the same principle, not the same design, certainly not the same implementation.
LCL has more balanced OO-event driven approach, while Swing is all OOP (you don't assign event handlers in Swing, you create a class instance implementing interfaces describing the events instead).
LCL strives to be as native as possible to the chosen widgetset, Swing takes a unified look approach (more like fpGUI).
LCL is modeled after VCL 6, Swing is original design from Sun based on their earlier AWT (now this one is much closer to LCL's native approach).
Title: Re: isFlipped isn't
Post by: VTwin on January 05, 2020, 12:22:14 am
The "flipped" text was indeed a TreeView bug, but it seems to have been fixed in both trunk and fixes branches. Are you using the latest 64 bit fixes, 2.0.7 r64479?
Title: Re: isFlipped isn't
Post by: syntonica on January 05, 2020, 03:43:41 am
The "flipped" text was indeed a TreeView bug, but it seems to have been fixed in both trunk and fixes branches. Are you using the latest 64 bit fixes, 2.0.7 r64479?
I just updated to the very latest and the tree is growing in the proper direction now.  Thanks to whomever fixed it!

The text is still kind of funky: it draws upside-down and then flips when complete. It's not always noticeable, but on a slow day...

Anyway, everything now ends up to where I do not have to hang from the chandelier to read it, so I'm happy!

As an aside, I just did "svn update" and got r62496.
TinyPortal © 2005-2018