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