Difference between revisions of "Talk:RichMemo/WorkArounds"

From Lazarus wiki
Jump to navigationJump to search
(draft)
 
(header to table)
Line 5: Line 5:
  
 
{|  
 
{|  
|Method
+
!Method
|Carbon
+
!Carbon
|Cocoa
+
!Cocoa
 
|-
 
|-
 
|SetTextAttributes()
 
|SetTextAttributes()

Revision as of 07:27, 15 September 2017

This is a draft, something that should be taken with the proverbial "grain of salt" at least until the RichMemo author has had a chance to comment.

Status of Functions on the Mac

Method Carbon Cocoa
SetTextAttributes() OK OK
GetTextAttributes(..) Patch Patch *
SetRangeParams(..) OK Fail
GetStyleRange(..) OK Fail
GetParaMetric(..) Fail Fail ?
SetParaMetric(..) Fail Fail
GetParaRange(..) Fail Fail
SetRangeParaParams(..) Fail Fail Depends on GetParaRange()
Search() Mixed Fail Might be able to use FindText()
GetTextLen(..) OK Fail Not official function
SetLink() Fail Fail Not official function.


Notes

  • GetParaMetric() on Carbon always returns false, always fails to set vars. On Cocoa it always returns True and says indent is 0. Its not possible to set an indent of more than zero so hard to know if its working or not. Follow the code David....
  • SetParaMetric() on carbon and Cocoa makes no visible change to text.
  • Search() on Carbon sets vars properly but always returns False. But always returns true on Cocoa but does not set vars at all.
  • For GetTextAttributes(), OSX requires a different patch on Cocoa than Carbon or Linux/Windows because GetTextLen() does not work. I think something like length(Lines.Text) is going to be the answer, probably a slow one and one I need to test.
  • GetStyleRange() is a problem elsewhere too, I have a local function to do that.
  • Going to have to get a local SetRangeParams() working, possibly not too had but might be slow....

Compiling with Cocoa on the Mac

Careful how serious you take this, written by a real Mac Newbie ! Not possible to install RichMemo on at least Lazarus 1.8rc4 when using Cocoa. At Phil's suggestion (thanks Phil) is necessary to install trunk version from SVN, build a Cocoa Lazarus and then, from using command line and config for that build, make RichMemo. You can then add that newly built RichMemo into an (eg Carbon based) Lazarus and build Cocoa app using the relatively new Cocoa widgets.

Once in your existing Lazarus you need to select Cocoa (Project->ProjectOptions->ConfigAndTarget and click "select another LCL Widget Set". If you want to build a 64bit version, Tools->Options->Environment->Files and change "Compiler Executable" from /usr/local/bin/ppc386 to /usr/local/bin/ppcx64