Difference between revisions of "Talk:RichMemo"

From Lazarus wiki
Jump to navigationJump to search
(updated script)
Line 3: Line 3:
 
Downloading the entire CCR and extracting just RichMemo is a slow process. This bash script will pull down just trunk into the current dir. Note it depends on file names not changing.
 
Downloading the entire CCR and extracting just RichMemo is a slow process. This bash script will pull down just trunk into the current dir. Note it depends on file names not changing.
 
<source lang=bash>
 
<source lang=bash>
#!/usr/bin/bash
+
#!/bin/bash
  
 
# Gets the trunk version of Richmemo, overwriting current version if present.
 
# Gets the trunk version of Richmemo, overwriting current version if present.
 
# NOTE : if files added or renamed, will require attention !
 
# NOTE : if files added or renamed, will require attention !
# DRB Dec 30, 2019
+
# DRB Sep 26, 2020
  
 
BASE='http://svn.code.sf.net/p/lazarus-ccr/svn/components/richmemo/'
 
BASE='http://svn.code.sf.net/p/lazarus-ccr/svn/components/richmemo/'
  
for i in wsrichmeno.pas rtfparspre211.pas rtfdata.inc richmemoutils.pas richmemortf.pas richmemoregister.pas richmemopackage.pas richmemopackage.lrs richmemopackage.lpk richmemohelpers.pas richmemofactory.pas richmemo.pas ; do
+
for i in wsrichmemo.pas rtfparspre211.pas rtfdata.inc richmemoutils.pas richmemortf.pas richmemopackage.pas richmemopackage.lpk richmemohelpers.pas richmemofactory.pas richmemo.pas ; do
 
rm "$i" 2>/dev/null
 
rm "$i" 2>/dev/null
 
wget "$BASE$i"
 
wget "$BASE$i"
 
done;
 
done;
  
mkdir -p win32
+
for i in ide cocoa gtk2 qt carbon qt5 win32; do
 +
mkdir -p "$i"
 +
done;
 +
 
 
cd win32
 
cd win32
 
rm *.pas
 
rm *.pas
Line 25: Line 28:
 
cd ..  
 
cd ..  
  
for i in carbon cocoa gtk2 qt qt5 ; do
+
 
mkdir -p "$i"
+
cd cocoa
cd "$i"
+
rm *.pas
rm "$i"richmemo.pas 2>/dev/null
+
wget "$BASE"cocoa/cocoarichmemo.pas
wget "$BASE""$i/$i"richmemo.pas
+
cd ..
cd ..
+
 
 +
cd qt
 +
rm *.pas
 +
wget "$BASE"qt/qtrichmemo.pas
 +
cd ..
 +
 
 +
cd carbon
 +
rm *.pas
 +
wget "$BASE"carbon/carbonrichmemo.pas
 +
cd ..
 +
 
 +
cd ide
 +
rm *.lfm *.pas *.lrs *.lpk 2>/dev/null
 +
for i in rtfeditpropdialog.lfm rtfeditpropdialog.pas richmemo_design.lpk richmemo_design.pas richmemopackage.lrs richmemoregister.pas ; do
 +
rm "$i" 2>/dev/null
 +
wget "$BASE"ide/"$i"
 
done;
 
done;
 +
cd ..
  
mkdir -p ide
+
cd gtk2
cd ide
+
rm *.pas 2>/dev/null
rm *.lfm *.pas 2>/dev/null
+
wget "$BASE"gtk2/gtk2richmemo.pas
wget "$BASE"ide/rtfeditpropdialog.lfm
+
cd ..
wget "$BASE"ide/rtfeditpropdialog.pas
+
 
 +
cd qt5
 +
rm *.pas 2>/dev/null
 +
wget "$BASE"qt5/qt5richmemo.pas
 
cd ..
 
cd ..
 +
 +
 
ls -l
 
ls -l
 
</source>
 
</source>
 
--[[User:Dbannon|Dbannon]] ([[User talk:Dbannon|talk]]) 01:36, 30 December 2019 (CET)
 
--[[User:Dbannon|Dbannon]] ([[User talk:Dbannon|talk]]) 01:36, 30 December 2019 (CET)
+
 
 
==Page Renaming==
 
==Page Renaming==
 
Arent. Recently you moved RichMemo to TRichMemo.
 
Arent. Recently you moved RichMemo to TRichMemo.

Revision as of 11:57, 26 September 2020

Downloading Trunk

Downloading the entire CCR and extracting just RichMemo is a slow process. This bash script will pull down just trunk into the current dir. Note it depends on file names not changing.

#!/bin/bash

# Gets the trunk version of Richmemo, overwriting current version if present.
# NOTE : if files added or renamed, will require attention !
# DRB Sep 26, 2020

BASE='http://svn.code.sf.net/p/lazarus-ccr/svn/components/richmemo/'

for i in wsrichmemo.pas rtfparspre211.pas rtfdata.inc richmemoutils.pas richmemortf.pas richmemopackage.pas richmemopackage.lpk richmemohelpers.pas richmemofactory.pas richmemo.pas ; do
	rm "$i" 2>/dev/null
	wget "$BASE$i"
done;

for i in ide cocoa gtk2 qt carbon qt5 win32; do
	mkdir -p "$i"
done;

cd win32
rm *.pas
for i in win32richmemo.pas win32richmemoole.pas win32richmemoproc.pas ; do
	rm "$i" 2>/dev/null
	wget "$BASE"win32/"$i"
done;
cd .. 


cd cocoa
rm *.pas
wget "$BASE"cocoa/cocoarichmemo.pas
cd ..

cd qt
rm *.pas
wget "$BASE"qt/qtrichmemo.pas
cd ..

cd carbon
rm *.pas
wget "$BASE"carbon/carbonrichmemo.pas
cd ..

cd ide
rm *.lfm *.pas *.lrs *.lpk 2>/dev/null
for i in rtfeditpropdialog.lfm rtfeditpropdialog.pas richmemo_design.lpk richmemo_design.pas richmemopackage.lrs richmemoregister.pas ; do
	rm "$i" 2>/dev/null
	wget "$BASE"ide/"$i"
done;
cd ..

cd gtk2
rm *.pas 2>/dev/null
wget "$BASE"gtk2/gtk2richmemo.pas
cd ..

cd qt5
rm *.pas 2>/dev/null
wget "$BASE"qt5/qt5richmemo.pas
cd ..


ls -l

--Dbannon (talk) 01:36, 30 December 2019 (CET)

Page Renaming

Arent. Recently you moved RichMemo to TRichMemo. Not sure why this occurred and what's the reason for it (is there a page that disclose the requirement?), but Russian page was not moved and now it is lost (from user interface!).

Here's a consideration for renaming. While the visual component itself is indeed named TRichMemo, the package is named RichMemo. It includes a little bit more than just TRichMemo component. For example it contains TCustomRichMemo, that is used as a base for a separate package TDBRichMemo!

Thus I'm thinking that the page should named after the package name rather than component name.

I moved it back (I guess I overlooked the /ru page). - Arent (talk) 12:35, 29 July 2016 (CEST)
Thanks! Why did you rename it in the first place? Skalogryz (talk) 14:10, 29 July 2016 (CEST)

Todo SetParaTabs

Add more examples and descriptions about TabStops.

The sample below adjusts RichMemo, to have tab stops for 8 characters sharp in Mono-Width text

procedure InitTabStopWithWidth(out lst: TTabstopList; width: double);
const
  ReasonableCount = 12;
var
  i : integer;
begin
  lst.Count:=ReasonableCount;
  SetLength(lst.Tabs, ReasonableCount);
  for i:=0 to ReasonableCount-1 do
    lst.Tabs[i].Offset:=width*i;
end;

procedure TForm1.FormShow(Sender: TObject);
var
  w : double;
  lst : TTabStopList;
begin
  Canvas.Font.Name:='Courier New'; // RichMemo1.Font.Name
  Canvas.Font.Size:=10;            // RichMemo1.Font.Size
  w:=Canvas.TextWidth('w')/96*72;  // should be mono-width anyway
  InitTabStopWithWidth(lst, w*8);

  RichMemo1.HandleNeeded;
  RichMemo1.SetParaTabs (0,-1, lst);
end;