mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-14 20:59:42 +02:00
Qt: implemented TMemo.Caret.Y position.
git-svn-id: trunk@48988 -
This commit is contained in:
parent
dbf8095904
commit
2eb361b9f3
@ -79,7 +79,7 @@ type
|
|||||||
|
|
||||||
IQtEdit = interface
|
IQtEdit = interface
|
||||||
['{035CA259-4442-4E82-9E70-96A114DD3BC6}']
|
['{035CA259-4442-4E82-9E70-96A114DD3BC6}']
|
||||||
function getCursorPosition: Integer;
|
function getCursorPosition: TPoint;
|
||||||
function getMaxLength: Integer;
|
function getMaxLength: Integer;
|
||||||
function getSelectionStart: Integer;
|
function getSelectionStart: Integer;
|
||||||
function getSelectionLength: Integer;
|
function getSelectionLength: Integer;
|
||||||
@ -812,7 +812,7 @@ type
|
|||||||
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
|
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
|
||||||
public
|
public
|
||||||
function getAlignment: QtAlignment;
|
function getAlignment: QtAlignment;
|
||||||
function getCursorPosition: Integer;
|
function getCursorPosition: TPoint;
|
||||||
function getMaxLength: Integer;
|
function getMaxLength: Integer;
|
||||||
function getSelectedText: WideString;
|
function getSelectedText: WideString;
|
||||||
function getSelectionStart: Integer;
|
function getSelectionStart: Integer;
|
||||||
@ -868,7 +868,7 @@ type
|
|||||||
procedure ClearText;
|
procedure ClearText;
|
||||||
function getAlignment: QtAlignment;
|
function getAlignment: QtAlignment;
|
||||||
function getBlockCount: Integer;
|
function getBlockCount: Integer;
|
||||||
function getCursorPosition: Integer;
|
function getCursorPosition: TPoint;
|
||||||
function getMaxLength: Integer;
|
function getMaxLength: Integer;
|
||||||
function getText: WideString; override;
|
function getText: WideString; override;
|
||||||
function getTextStatic: Boolean; override;
|
function getTextStatic: Boolean; override;
|
||||||
@ -997,7 +997,7 @@ type
|
|||||||
protected
|
protected
|
||||||
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
|
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
|
||||||
// IQtEdit implementation
|
// IQtEdit implementation
|
||||||
function getCursorPosition: Integer;
|
function getCursorPosition: TPoint;
|
||||||
function getMaxLength: Integer;
|
function getMaxLength: Integer;
|
||||||
function getSelectionStart: Integer;
|
function getSelectionStart: Integer;
|
||||||
function getSelectionLength: Integer;
|
function getSelectionLength: Integer;
|
||||||
@ -1069,7 +1069,7 @@ type
|
|||||||
protected
|
protected
|
||||||
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
|
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
|
||||||
// IQtEdit implementation
|
// IQtEdit implementation
|
||||||
function getCursorPosition: Integer;
|
function getCursorPosition: TPoint;
|
||||||
function getMaxLength: Integer;
|
function getMaxLength: Integer;
|
||||||
function getSelectionStart: Integer;
|
function getSelectionStart: Integer;
|
||||||
function getSelectionLength: Integer;
|
function getSelectionLength: Integer;
|
||||||
@ -8759,9 +8759,10 @@ begin
|
|||||||
Result := QLineEdit_alignment(QLineEditH(Widget));
|
Result := QLineEdit_alignment(QLineEditH(Widget));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtLineEdit.getCursorPosition: Integer;
|
function TQtLineEdit.getCursorPosition: TPoint;
|
||||||
begin
|
begin
|
||||||
Result := QLineEdit_cursorPosition(QLineEditH(Widget));
|
Result.Y := 0;
|
||||||
|
Result.X := QLineEdit_cursorPosition(QLineEditH(Widget));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtLineEdit.getMaxLength: Integer;
|
function TQtLineEdit.getMaxLength: Integer;
|
||||||
@ -8783,7 +8784,7 @@ begin
|
|||||||
if (CachedSelectionStart <> -1) and not hasFocus then
|
if (CachedSelectionStart <> -1) and not hasFocus then
|
||||||
Result := CachedSelectionStart
|
Result := CachedSelectionStart
|
||||||
else
|
else
|
||||||
Result := getCursorPosition;
|
Result := getCursorPosition.X;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -9082,16 +9083,19 @@ begin
|
|||||||
Result := QTextDocument_blockCount(QTextEdit_document(QTextEditH(Widget)));
|
Result := QTextDocument_blockCount(QTextEdit_document(QTextEditH(Widget)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtTextEdit.getCursorPosition: Integer;
|
function TQtTextEdit.getCursorPosition: TPoint;
|
||||||
var
|
var
|
||||||
TextCursor: QTextCursorH;
|
TextCursor: QTextCursorH;
|
||||||
begin
|
begin
|
||||||
TextCursor := QTextCursor_create();
|
TextCursor := QTextCursor_create();
|
||||||
QTextEdit_textCursor(QTextEditH(Widget), TextCursor);
|
QTextEdit_textCursor(QTextEditH(Widget), TextCursor);
|
||||||
if QTextCursor_isNull(TextCursor) then
|
if QTextCursor_isNull(TextCursor) then
|
||||||
Result := 0
|
Result := Point(0, 0)
|
||||||
else
|
else
|
||||||
Result := QTextCursor_position(TextCursor);
|
begin
|
||||||
|
Result.X := QTextCursor_position(TextCursor);
|
||||||
|
Result.Y := QTextCursor_blockNumber(TextCursor);
|
||||||
|
end;
|
||||||
QTextCursor_destroy(TextCursor);
|
QTextCursor_destroy(TextCursor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -10238,12 +10242,11 @@ begin
|
|||||||
FOwnerDrawn := False;
|
FOwnerDrawn := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtComboBox.getCursorPosition: Integer;
|
function TQtComboBox.getCursorPosition: TPoint;
|
||||||
begin
|
begin
|
||||||
|
Result := Point(0, 0);
|
||||||
if LineEdit <> nil then
|
if LineEdit <> nil then
|
||||||
Result := LineEdit.getCursorPosition
|
Result.X := LineEdit.getCursorPosition.X;
|
||||||
else
|
|
||||||
Result := 0;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtComboBox.getMaxLength: Integer;
|
function TQtComboBox.getMaxLength: Integer;
|
||||||
@ -11052,12 +11055,11 @@ begin
|
|||||||
QLineEdit_undo(LineEdit);
|
QLineEdit_undo(LineEdit);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtAbstractSpinBox.getCursorPosition: Integer;
|
function TQtAbstractSpinBox.getCursorPosition: TPoint;
|
||||||
begin
|
begin
|
||||||
|
Result := Point(0, 0);
|
||||||
if LineEdit <> nil then
|
if LineEdit <> nil then
|
||||||
Result := QLineEdit_cursorPosition(LineEdit)
|
Result.X := QLineEdit_cursorPosition(LineEdit);
|
||||||
else
|
|
||||||
Result := 0;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtAbstractSpinBox.getReadOnly: Boolean;
|
function TQtAbstractSpinBox.getReadOnly: Boolean;
|
||||||
|
@ -862,7 +862,7 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
Widget := TQtWidget(ACustomEdit.Handle);
|
Widget := TQtWidget(ACustomEdit.Handle);
|
||||||
if Supports(Widget, IQtEdit, QtEdit) then
|
if Supports(Widget, IQtEdit, QtEdit) then
|
||||||
Result.X := QtEdit.getCursorPosition;
|
Result := QtEdit.getCursorPosition;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TQtWSCustomEdit.GetCanUndo(const ACustomEdit: TCustomEdit): Boolean;
|
class function TQtWSCustomEdit.GetCanUndo(const ACustomEdit: TCustomEdit): Boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user