- Removed TWSWinControl.HasText

git-svn-id: trunk@5444 -
This commit is contained in:
marc 2004-05-02 17:06:01 +00:00
parent 617948d9c8
commit 82c27cc547
2 changed files with 8 additions and 14 deletions

View File

@ -3083,7 +3083,6 @@ begin
// Delay the setting of text until it is completely loaded // Delay the setting of text until it is completely loaded
if not (csLoading in ComponentState) if not (csLoading in ComponentState)
and TWSWinControlClass(WidgetSetClass).HasText(Self)
then TWSWinControlClass(WidgetSetClass).SetText(Self, FCaption); then TWSWinControlClass(WidgetSetClass).SetText(Self, FCaption);
SetProp(Handle,'WinControl',TWinControl(Self)); SetProp(Handle,'WinControl',TWinControl(Self));
@ -3130,8 +3129,7 @@ begin
if HandleAllocated if HandleAllocated
then begin then begin
// Set cached caption // Set cached caption
if TWSWinControlClass(WidgetSetClass).HasText(Self) then TWSWinControlClass(WidgetSetClass).SetText(Self, FCaption);
TWSWinControlClass(WidgetSetClass).SetText(Self, FCaption);
if [wcfColorChanged,wcfFontChanged]*FFlags<>[] then if [wcfColorChanged,wcfFontChanged]*FFlags<>[] then
begin begin
@ -3154,12 +3152,14 @@ end;
Destroys the interface object. Destroys the interface object.
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TWinControl.DestroyWnd; procedure TWinControl.DestroyWnd;
var
S: String;
begin begin
if HandleAllocated if HandleAllocated
then begin then begin
// make sure our text is saved // make sure our text is saved
if TWSWinControlClass(WidgetSetClass).HasText(Self) then if TWSWinControlClass(WidgetSetClass).GetText(Self, S)
FCaption := GetText; then FCaption := S;
DestroyComponent; DestroyComponent;
Handle := 0; Handle := 0;
end; end;
@ -3334,7 +3334,6 @@ function TWinControl.RealGetText: TCaption;
begin begin
if not HandleAllocated if not HandleAllocated
or (csLoading in ComponentState) or (csLoading in ComponentState)
or (not TWSWinControlClass(WidgetSetClass).HasText(Self))
or (not TWSWinControlClass(WidgetSetClass).GetText(Self, Result)) or (not TWSWinControlClass(WidgetSetClass).GetText(Self, Result))
then Result := inherited RealGetText; then Result := inherited RealGetText;
end; end;
@ -3350,7 +3349,6 @@ function TWinControl.GetTextLen: Integer;
begin begin
if not HandleAllocated if not HandleAllocated
or (csLoading in ComponentState) or (csLoading in ComponentState)
or (not TWSWinControlClass(WidgetSetClass).HasText(Self))
or not TWSWinControlClass(WidgetSetClass).GetTextLen(Self, Result) or not TWSWinControlClass(WidgetSetClass).GetTextLen(Self, Result)
then Result := inherited GetTextLen; then Result := inherited GetTextLen;
end; end;
@ -3366,7 +3364,6 @@ procedure TWinControl.RealSetText(const Value: TCaption);
begin begin
if HandleAllocated if HandleAllocated
and (not (csLoading in ComponentState)) and (not (csLoading in ComponentState))
and TWSWinControlClass(WidgetSetClass).HasText(Self)
then TWSWinControlClass(WidgetSetClass).SetText(Self, Value); then TWSWinControlClass(WidgetSetClass).SetText(Self, Value);
inherited; inherited;
end; end;
@ -3484,6 +3481,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.224 2004/05/02 17:06:01 marc
- Removed TWSWinControl.HasText
Revision 1.223 2004/04/28 06:50:21 micha Revision 1.223 2004/04/28 06:50:21 micha
more detailed error message req. by ML more detailed error message req. by ML

View File

@ -65,7 +65,6 @@ type
{ TWSWinControl } { TWSWinControl }
TWSWinControl = class(TWSControl) TWSWinControl = class(TWSControl)
class function HasText(const AWinControl: TWinControl): Boolean; virtual;
class function GetText(const AWinControl: TWinControl; var AText: String): Boolean; virtual; class function GetText(const AWinControl: TWinControl; var AText: String): Boolean; virtual;
class function GetTextLen(const AWinControl: TWinControl; var ALength: Integer): Boolean; virtual; class function GetTextLen(const AWinControl: TWinControl; var ALength: Integer): Boolean; virtual;
class procedure SetCursor(const AControl: TControl; const ACursor: TCursor); override; class procedure SetCursor(const AControl: TControl; const ACursor: TCursor); override;
@ -102,11 +101,6 @@ end;
{ TWSWinControl } { TWSWinControl }
function TWSWinControl.HasText(const AWinControl: TWinControl): Boolean;
begin
Result := true;
end;
function TWSWinControl.GetText(const AWinControl: TWinControl; var AText: String): Boolean; function TWSWinControl.GetText(const AWinControl: TWinControl; var AText: String): Boolean;
begin begin
Result := CNSendMessage(LM_GETTEXT, AWinControl, @AText) <> 0; Result := CNSendMessage(LM_GETTEXT, AWinControl, @AText) <> 0;