mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 20:59:36 +02:00
+ More optimizations on TCustomMemo.
* Cleared all warnings. git-svn-id: trunk@11538 -
This commit is contained in:
parent
8960c22b37
commit
71b1f100e6
@ -400,7 +400,6 @@ constructor TQtMemoStrings.Create(TextEdit: QTextEditH; TheOwner: TWinControl);
|
||||
var
|
||||
Method: TMethod;
|
||||
Hook : QTextEdit_hookH;
|
||||
Astr: WideString;
|
||||
begin
|
||||
inherited Create;
|
||||
|
||||
@ -411,8 +410,7 @@ begin
|
||||
|
||||
FStringList := TStringList.Create;
|
||||
FQtTextEdit := TextEdit;
|
||||
QTextEdit_toPlainText(TextEdit,@Astr); // get the memo content
|
||||
FStringList.Text := UTF8Encode(AStr);
|
||||
QTextEdit_clear(FQtTextEdit);
|
||||
FOwner:=TheOwner;
|
||||
|
||||
// Callback Event
|
||||
@ -447,19 +445,15 @@ end;
|
||||
function TQtMemoStrings.TextChangedHandler(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
|
||||
var
|
||||
Mess: TLMessage;
|
||||
// just for debugging
|
||||
SenderView: QObjectH;
|
||||
EventView: QEventH;
|
||||
begin
|
||||
if not FUpdating then begin
|
||||
SenderView := Sender;
|
||||
EventView := Event;
|
||||
if not FUpdating then
|
||||
begin
|
||||
FTextChanged := True;
|
||||
FillChar(Mess, SizeOf(Mess), #0);
|
||||
Mess.Msg := CM_TEXTCHANGED;
|
||||
//(FOwner as TCustomMemo).Modified := True;
|
||||
FOwner.Dispatch(TLMessage(Mess));
|
||||
end;
|
||||
end;
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
@ -474,8 +468,11 @@ procedure TQtMemoStrings.Assign(Source: TPersistent);
|
||||
var
|
||||
Astr: WideString;
|
||||
begin
|
||||
if (Source=Self) or (Source=nil) then exit;
|
||||
if Source is TStrings then begin
|
||||
if (Source=Self) or (Source=nil)
|
||||
then
|
||||
exit;
|
||||
if Source is TStrings then
|
||||
begin
|
||||
FStringList.Clear;
|
||||
FStringList.Text := TStrings(Source).Text;
|
||||
Astr := FStringList.Text;
|
||||
|
@ -3595,7 +3595,6 @@ end;
|
||||
function TQtTextEdit.CreateWidget(const AParams: TCreateParams): QWidgetH;
|
||||
var
|
||||
Parent: QWidgetH;
|
||||
Str: WideString;
|
||||
begin
|
||||
// Creates the widget
|
||||
{$ifdef VerboseQt}
|
||||
@ -3603,10 +3602,8 @@ begin
|
||||
{$endif}
|
||||
|
||||
Parent := TQtWidget(LCLObject.Parent.Handle).GetContainerWidget;
|
||||
Str := UTF8Decode((LCLObject as TCustomMemo).Text);
|
||||
Result := QTextEdit_create(Parent);
|
||||
QTextEdit_setAlignment(QTextEditH(Result), AlignmentMap[(LCLObject as TCustomMemo).Alignment]);
|
||||
QTextEdit_setPlainText(QTextEditH(Result), @Str);
|
||||
|
||||
QTextEdit_setReadOnly(QTextEditH(Result), (LCLObject as TCustomMemo).ReadOnly);
|
||||
|
||||
|
@ -36,8 +36,6 @@
|
||||
Returns: Boolean
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtWidgetSet.Arc(DC: HDC; Left,Top,Right,Bottom,angle1,angle2 : Integer): Boolean;
|
||||
var
|
||||
ADC : TQtDeviceContext;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('[WinAPI Arc] DC: ', dbghex(DC));
|
||||
@ -54,8 +52,6 @@ end;
|
||||
Returns: Boolean
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtWidgetSet.AngleChord(DC: HDC; x1, y1, x2, y2, angle1, angle2: Integer): Boolean;
|
||||
var
|
||||
ADC : TQtDeviceContext;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('[WinAPI AngleChord] DC: ', dbghex(DC));
|
||||
@ -2444,9 +2440,6 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtWidgetSet.Polygon(DC: HDC; Points: PPoint; NumPts: Integer;
|
||||
Winding: Boolean): boolean;
|
||||
var
|
||||
ARect: TRect;
|
||||
ADC : TQtDeviceContext;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('[WinAPI Polygon] DC: ', dbghex(DC));
|
||||
@ -2977,7 +2970,7 @@ begin
|
||||
if GetScrollInfo(Handle, SBStyle, FScrollInfo) then
|
||||
begin
|
||||
{impossible cases}
|
||||
if (ScrollInfo.nPage > ScrollInfo.nMax) then exit;
|
||||
if (Integer(ScrollInfo.nPage) > ScrollInfo.nMax) then exit;
|
||||
|
||||
if (ScrollInfo.FMask or SIF_RANGE) = ScrollInfo.FMask then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user