mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-24 00:27:06 +02:00
added UniCode keyvals
git-svn-id: trunk@5803 -
This commit is contained in:
parent
17b062c027
commit
3e8038ec1a
@ -604,7 +604,7 @@ type
|
||||
{$IFDEF SYN_COMPILER_4_UP}
|
||||
function ExecuteAction(ExeAction: TBasicAction): boolean; override;
|
||||
{$ENDIF}
|
||||
procedure ExecuteCommand(Command: TSynEditorCommand; AChar: char;
|
||||
procedure ExecuteCommand(Command: TSynEditorCommand; AChar: TCharacter;
|
||||
Data: pointer); virtual;
|
||||
function GetBookMark(BookMark: integer; var X, Y: integer): boolean;
|
||||
function GetHighlighterAttriAtRowCol(XY: TPoint; var Token: string;
|
||||
@ -5807,7 +5807,36 @@ begin
|
||||
DoOnCommandProcessed(Command, AChar, Data);
|
||||
end;
|
||||
|
||||
procedure TCustomSynEdit.ExecuteCommand(Command: TSynEditorCommand; AChar: char;
|
||||
{$IFDEF USE_WCHAR_LCL}
|
||||
function UnicodeToUtf8(aWideChar:WideChar):String[3];
|
||||
var
|
||||
w:Word;
|
||||
begin
|
||||
w:= Word(aWideChar);
|
||||
case w of
|
||||
0..$7f:
|
||||
begin
|
||||
Result[1]:=char(w);
|
||||
SetLength(Result,1);
|
||||
end;
|
||||
$80..$7ff:
|
||||
begin
|
||||
Result[1]:=char($c0 or (w shr 6));
|
||||
Result[2]:=char($80 or (w and $3f));
|
||||
SetLength(Result,2);
|
||||
end;
|
||||
else
|
||||
begin
|
||||
Result[1]:=char($e0 or (w shr 12));
|
||||
Result[2]:=char($80 or ((w shr 6)and $3f));
|
||||
Result[3]:=char($80 or (w and $3f));
|
||||
SetLength(Result,3);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
{$ENDIF USE_WCHAR_LCL}
|
||||
|
||||
procedure TCustomSynEdit.ExecuteCommand(Command: TSynEditorCommand; AChar: TCharacter;
|
||||
Data: pointer);
|
||||
const
|
||||
ALPHANUMERIC = DIGIT + ALPHA_UC + ALPHA_LC;
|
||||
@ -5849,8 +5878,8 @@ var
|
||||
SelectionMode);
|
||||
SetSelText('');
|
||||
end;
|
||||
{end} //mh 2000-10-30
|
||||
|
||||
{end}
|
||||
//mh 2000-10-30
|
||||
begin
|
||||
IncPaintLock;
|
||||
try
|
||||
@ -6284,8 +6313,13 @@ begin
|
||||
if bChangeScroll then Include(fOptions, eoScrollPastEol);
|
||||
StartOfBlock := CaretXY;
|
||||
if fInserting then begin
|
||||
{$IFDEF USE_WCHAR_LCL}
|
||||
System.Insert(UnicodeToUtf8(AChar), Temp, CaretX);
|
||||
CaretX := CaretX + length(UnicodeToUtf8(AChar));
|
||||
{$ELSE USE_WCHAR_LCL}
|
||||
System.Insert(AChar, Temp, CaretX);
|
||||
CaretX := CaretX + 1;
|
||||
{$ENDIF USE_WCHAR_LCL}
|
||||
TrimmedSetLine(CaretY - 1, Temp); //JGF 2000-09-23
|
||||
fUndoList.AddChange(crInsert, StartOfBlock, CaretXY, '',
|
||||
smNormal);
|
||||
|
@ -3431,10 +3431,15 @@ procedure TCollectionPropertyEditorForm.PropagateList;
|
||||
var
|
||||
I : Longint;
|
||||
CurItem: String;
|
||||
Cnt: Integer;
|
||||
begin
|
||||
CollectionList.Items.BeginUpdate;
|
||||
if Collection<>nil then
|
||||
Cnt:=Collection.Count
|
||||
else
|
||||
Cnt:=0;
|
||||
// add or replace list items
|
||||
for I:= 0 to Collection.Count - 1 do begin
|
||||
for I:=0 to Cnt - 1 do begin
|
||||
CurItem:=Collection.Items[I].DisplayName;
|
||||
if i>=CollectionList.Items.Count then
|
||||
CollectionList.Items.Add(CurItem)
|
||||
@ -3442,7 +3447,7 @@ begin
|
||||
CollectionList.Items[I]:=CurItem;
|
||||
end;
|
||||
// delete unneeded list items
|
||||
while CollectionList.Items.Count>Collection.Count do begin
|
||||
while CollectionList.Items.Count>Cnt do begin
|
||||
CollectionList.Items.Delete(CollectionList.Items.Count-1);
|
||||
end;
|
||||
CollectionList.Items.EndUpdate;
|
||||
@ -3582,12 +3587,17 @@ begin
|
||||
end;
|
||||
|
||||
Procedure TCollectionPropertyEditor.Edit;
|
||||
var
|
||||
TheCollection: TCollection;
|
||||
begin
|
||||
TheCollection := TCollection(GetObjectValue);
|
||||
if TheCollection=nil then
|
||||
raise Exception.Create('Collection=nil');
|
||||
If Assigned(CollectionForm) then
|
||||
CollectionForm.Free;
|
||||
CollectionForm := TCollectionPropertyEditorForm.Create(Application);
|
||||
with CollectionForm do begin
|
||||
Collection := TCollection(GetObjectValue);
|
||||
Collection := TheCollection;
|
||||
PropertyName := GetPropInfo^.Name;
|
||||
PersistentName := '';
|
||||
Caption := 'Editing ' + GetPropInfo^.Name;
|
||||
|
@ -2052,9 +2052,15 @@ begin
|
||||
else Msg.msg := LM_CHAR;
|
||||
end;
|
||||
|
||||
if Event^.Length = 0
|
||||
then Msg.CharCode := Event^.KeyVal // non ASCII key was pressed
|
||||
else Msg.CharCode := ord(EventString^);
|
||||
if Event^.Length = 0 then begin
|
||||
// non ASCII key was pressed
|
||||
{$IFDEF GTK2}
|
||||
Msg.CharCode := gdk_keyval_to_unicode(Event^.KeyVal);
|
||||
{$ELSE}
|
||||
Msg.CharCode := Event^.KeyVal;
|
||||
{$ENDIF}
|
||||
end else
|
||||
Msg.CharCode := ord(EventString^);
|
||||
Msg.Result:=0;
|
||||
// send the message directly (not queued) to the LCL
|
||||
Result := DeliverMessage(TargetData, Msg) = 0;
|
||||
@ -7105,6 +7111,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.292 2004/08/16 16:03:52 mattias
|
||||
added UniCode keyvals
|
||||
|
||||
Revision 1.291 2004/08/12 15:50:46 mazen
|
||||
+ add support for passing non ASCII key values
|
||||
* need to check for $F000 if it is the correct value
|
||||
|
@ -994,9 +994,9 @@ begin
|
||||
end;
|
||||
Result := wawType;
|
||||
end;
|
||||
|
||||
{$IFDEF GTK1}
|
||||
function Laz_GTK_OBJECT_CONSTRUCTED(AnObject: PGtkObject): gboolean; cdecl;external gtkdll name 'gtk_object_constructed';
|
||||
|
||||
{$ENDIF GTK1}
|
||||
function GTKAPIWidget_new: PGTKWidget;
|
||||
var
|
||||
APIWidget: PGTKAPIWidget;
|
||||
@ -1146,6 +1146,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.62 2004/08/16 16:03:52 mattias
|
||||
added UniCode keyvals
|
||||
|
||||
Revision 1.61 2004/08/15 16:11:32 mattias
|
||||
replaced rotten gtk_widget_newv by gtk_type_new
|
||||
|
||||
|
@ -34,7 +34,7 @@ if [ `which rsync` ]; then
|
||||
--exclude=".#*" --exclude="*.~*" --exclude="*.bak" \
|
||||
--exclude="*.orig" --exclude="*.rej" --exclude="*.bak" \
|
||||
--exclude=".xvpics" --exclude="*.compiled" --exclude="killme*" \
|
||||
--exclude=".gdb_hist*"
|
||||
--exclude=".gdb_hist*" \
|
||||
$SrcDir $DestDir
|
||||
else
|
||||
cp -a $SrcDir $DestDir
|
||||
|
@ -34,7 +34,7 @@ if [ `which rsync` ]; then
|
||||
--exclude=".#*" --exclude="*.~*" --exclude="*.bak" \
|
||||
--exclude="*.orig" --exclude="*.rej" --exclude="*.bak" \
|
||||
--exclude=".xvpics" --exclude="*.compiled" --exclude="killme*" \
|
||||
--exclude=".gdb_hist*"
|
||||
--exclude=".gdb_hist*" \
|
||||
$LazSrcDir $LazDestDir
|
||||
else
|
||||
cp -a $LazSrcDir $LazDestDir
|
||||
|
Loading…
Reference in New Issue
Block a user