Tested TCustomEdit.Readonly, MaxLength and CharCase.

Shane

git-svn-id: trunk@94 -
This commit is contained in:
lazarus 2001-01-04 15:09:05 +00:00
parent bff114a928
commit 536fafd89b
5 changed files with 49 additions and 8 deletions

View File

@ -2976,7 +2976,7 @@ end;
function TStringsPropertyEditor.GetAttributes: TPropertyAttributes;
begin
Result := [paMultiSelect, paDialog, paRevertable, paReadOnly];
Result := [paDialog, paRevertable, paReadOnly];
end;
//==============================================================================

View File

@ -35,8 +35,13 @@ End;
------------------------------------------------------------------------------}
Procedure TCustomEdit.SetCharCase(Value : TEditCharCase);
Begin
FCharCase := Value;
CNSendMessage(LM_SETPROPERTIES, Self, nil);
if FCharCase <> value then
Begin
FCharCase := Value;
if FCharCase = ecUpperCase then Text := Uppercase(Text)
else
if FCharCase = ecLowerCase then Text := Lowercase(Text);
end;
End;
{------------------------------------------------------------------------------
@ -78,8 +83,26 @@ End;
Returns: Nothing
------------------------------------------------------------------------------}
Procedure TCustomEdit.CMTextChanged(var Message : TLMessage);
var
Temp : String;
Begin
//inherited CMTextChanged(MEssage);
//check to see if the charcase should effect the text.
if FCharCase = ecUppercase then
Begin
Temp := Uppercase(text);
if Temp <> Text then Text := Temp;
end
else
if FCharCase = ecLowercase then
Begin
Temp := Lowercase(text);
if Temp <> Text then Text := Temp;
end;
Writeln('CMTEXTCHANGED');
Modified := True;
if HandleAllocated then Change;
End;
@ -87,6 +110,7 @@ End;
Procedure TCustomEdit.Change;
Begin
//inherited Change;
Writeln('CHANGED');
if Assigned(FOnChange) then FOnChange(Self);
end;
@ -112,6 +136,10 @@ end;
{ =============================================================================
$Log$
Revision 1.3 2001/01/04 15:09:05 lazarus
Tested TCustomEdit.Readonly, MaxLength and CharCase.
Shane
Revision 1.2 2001/01/04 13:52:00 lazarus
Minor changes to TEdit.
Not tested.

View File

@ -71,7 +71,7 @@ var
begin
Result := True;
EventTrace('changed', data);
Mess.Msg := LM_CHANGED;
Mess.Msg := CM_TEXTCHANGED; // Changed on 01/04/2001 from LM_CHANGED to CM_TEXTCHANGED by Shane for TCustomEdit
Result := DeliverMessage(Data, Mess) = 0;
end;
@ -1090,6 +1090,10 @@ end;
{ =============================================================================
$Log$
Revision 1.10 2001/01/04 15:09:05 lazarus
Tested TCustomEdit.Readonly, MaxLength and CharCase.
Shane
Revision 1.9 2000/12/19 18:43:13 lazarus
Removed IDEEDITOR. This causes the PROJECT class to not function.
Saving projects no longer works.

View File

@ -1243,7 +1243,7 @@ begin
else if sender is TCustomCombobox
then ConnectSignal (PGtkObject(PGtkCombo(gobject)^.entry), 'changed', @gtkchangedCB)
else
ConnectSignal(gObject, 'changed', @gtkchangedCB);
ConnectSignal(gObject, 'changed', @gtkchangedCB);
LM_CLICKED :
begin
@ -2345,7 +2345,7 @@ begin
csEdit :
with (TCustomEdit(Sender)) do
Begin
gtk_entry_set_editable(PgtkEntry(handle),TCustomEdit(sender).ReadOnly);
gtk_entry_set_editable(PgtkEntry(handle),not(TCustomEdit(sender).ReadOnly));
gtk_entry_set_max_length(PgtkEntry(handle),TCustomEdit(sender).MaxLength);
end;
@ -2700,6 +2700,10 @@ end;
{ =============================================================================
$Log$
Revision 1.15 2001/01/04 15:09:05 lazarus
Tested TCustomEdit.Readonly, MaxLength and CharCase.
Shane
Revision 1.14 2001/01/04 13:52:00 lazarus
Minor changes to TEdit.
Not tested.

View File

@ -178,8 +178,9 @@ type
Procedure SetMaxLength(Value : Integer);
Procedure SetModified(Value : Boolean);
Procedure SetReadOnly(Value : Boolean);
Procedure CMTextChanged(Var Message : TLMessage); message CM_TextChanged;
// Procedure CMTextChanged(Var Message : TLMessage); message CM_TextChanged;
protected
Procedure CMTextChanged(Var Message : TLMessage); message CM_TextChanged;
Procedure Change; dynamic;
property OnChange : TNotifyEvent read FOnChange write FOnChange;
@ -490,6 +491,10 @@ end.
{ =============================================================================
$Log$
Revision 1.7 2001/01/04 15:09:05 lazarus
Tested TCustomEdit.Readonly, MaxLength and CharCase.
Shane
Revision 1.6 2001/01/04 13:52:00 lazarus
Minor changes to TEdit.
Not tested.