From: Robert M. <mar...@us...> - 2003-11-21 08:00:55
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1:/tmp/cvs-serv4630/JVCL3/run Modified Files: JvAppIniStore.pas JvBDECheckPasswordForm.pas JvBaseEdits.pas JvBaseThumbnail.pas Log Message: style cleaning and a fix in JvCtrls-D.xml Index: JvAppIniStore.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvAppIniStore.pas,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** JvAppIniStore.pas 20 Nov 2003 19:12:58 -0000 1.11 --- JvAppIniStore.pas 21 Nov 2003 08:00:49 -0000 1.12 *************** *** 40,44 **** Libc, {$ENDIF LINUX} ! SysUtils, Classes, IniFiles, JvAppStore; type --- 40,45 ---- Libc, {$ENDIF LINUX} ! SysUtils, Classes, IniFiles, ! JvAppStore; type Index: JvBDECheckPasswordForm.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvBDECheckPasswordForm.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JvBDECheckPasswordForm.pas 10 Oct 2003 23:13:33 -0000 1.3 --- JvBDECheckPasswordForm.pas 21 Nov 2003 08:00:50 -0000 1.4 *************** *** 31,38 **** uses ! SysUtils, ! Windows, ! Messages, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ! DBTables, DB, JvComponent; type --- 31,36 ---- uses ! Windows, SysUtils, Classes, Controls, Forms, StdCtrls, Buttons, DBTables, DB, ! JvComponent; type *************** *** 40,43 **** --- 38,56 ---- const OldPassword, NewPassword: string): Boolean of object; + function ChangePasswordDialog(Database: TDatabase; AttemptNumber: Integer; + const UsersTableName, UserNameField, LoginName: string; + MaxPwdLen: Integer; EnableEmptyPassword: Boolean; + ChangePasswordEvent: TChangePasswordEvent): Boolean; + + implementation + + uses + Consts, + JvConsts, JvJVCLUtils; + + {$R *.DFM} + + type + // (rom) moved to implementation for security reasons TJvChPswdForm = class(TJvForm) OldPswdLabel: TLabel; *************** *** 58,63 **** procedure ClearEdits; procedure OkEnabled; - protected - procedure CreateParams(var Params: TCreateParams); override; public Database: TDatabase; --- 71,74 ---- *************** *** 73,89 **** MaxPwdLen: Integer; EnableEmptyPassword: Boolean; ChangePasswordEvent: TChangePasswordEvent): Boolean; - - implementation - - uses - Consts, - JvConsts, JvJVCLUtils; - - {$R *.DFM} - - function ChangePasswordDialog(Database: TDatabase; AttemptNumber: Integer; - const UsersTableName, UserNameField, LoginName: string; - MaxPwdLen: Integer; EnableEmptyPassword: Boolean; - ChangePasswordEvent: TChangePasswordEvent): Boolean; var Form: TJvChPswdForm; --- 84,87 ---- *************** *** 114,122 **** end; - procedure TJvChPswdForm.CreateParams(var Params: TCreateParams); - begin - inherited CreateParams(Params); - end; - procedure TJvChPswdForm.FormCreate(Sender: TObject); begin --- 112,115 ---- *************** *** 154,158 **** Inc(FAttempt); try ! if not (FAttempt > AttemptNumber) then begin if UsersTableName <> '' then --- 147,151 ---- Inc(FAttempt); try ! if FAttempt <= AttemptNumber then begin if UsersTableName <> '' then *************** *** 170,174 **** Table.Open; if Table.FindKey([LoginName]) then - begin if NewPswd.Text <> ConfirmNewPswd.Text then Error := peMismatch --- 163,166 ---- *************** *** 176,180 **** if Assigned(OnChangePassword) then Ok := OnChangePassword(Table, OldPswd.Text, NewPswd.Text); - end; end else --- 168,171 ---- *************** *** 187,196 **** end; if Ok then ! MessageDlg(SPasswordChanged, mtInformation, [mbOk], 0) else if Error = peMismatch then ! MessageDlg(SPasswordsMismatch, mtError, [mbOk], 0) else ! MessageDlg(SPasswordNotChanged, mtError, [mbOk], 0); finally if Table <> nil then --- 178,187 ---- end; if Ok then ! MessageBox(SPasswordChanged, '', MB_OK or MB_ICONINFORMATION) else if Error = peMismatch then ! MessageBox(SPasswordsMismatch, '', MB_OK or MB_ICONERROR) else ! MessageBox(SPasswordNotChanged, '', MB_OK or MB_ICONERROR); finally if Table <> nil then Index: JvBaseEdits.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvBaseEdits.pas,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JvBaseEdits.pas 14 Oct 2003 19:44:32 -0000 1.7 --- JvBaseEdits.pas 21 Nov 2003 08:00:50 -0000 1.8 *************** *** 44,65 **** FCanvas: TControlCanvas; FAlignment: TAlignment; ! FFocused: boolean; FValue: Extended; FMinValue: Extended; FMaxValue: Extended; FDecimalPlaces: Cardinal; ! FBeepOnError: boolean; ! FCheckOnExit: boolean; ! FZeroEmpty: boolean; ! FFormatOnEditing: boolean; ! FFormatting: boolean; FDisplayFormat: string; // Polaris ! FDecimalPlaceRound: boolean; ! procedure SetDecimalPlaceRound(Value: boolean); ! procedure SetFocused(Value: boolean); procedure SetAlignment(Value: TAlignment); ! procedure SetBeepOnError(Value: boolean); procedure SetDisplayFormat(const Value: string); function GetDisplayFormat: string; --- 44,65 ---- FCanvas: TControlCanvas; FAlignment: TAlignment; ! FFocused: Boolean; FValue: Extended; FMinValue: Extended; FMaxValue: Extended; FDecimalPlaces: Cardinal; ! FBeepOnError: Boolean; ! FCheckOnExit: Boolean; ! FZeroEmpty: Boolean; ! FFormatOnEditing: Boolean; ! FFormatting: Boolean; FDisplayFormat: string; // Polaris ! FDecimalPlaceRound: Boolean; ! procedure SetDecimalPlaceRound(Value: Boolean); ! procedure SetFocused(Value: Boolean); procedure SetAlignment(Value: TAlignment); ! procedure SetBeepOnError(Value: Boolean); procedure SetDisplayFormat(const Value: string); function GetDisplayFormat: string; *************** *** 71,81 **** procedure SetMaxValue(AValue: Extended); procedure SetMinValue(AValue: Extended); ! procedure SetZeroEmpty(Value: boolean); ! procedure SetFormatOnEditing(Value: boolean); function GetText: string; procedure SetText(const AValue: string); function TextToValText(const AValue: string): string; //Polaris function CheckValue(NewValue: Extended; RaiseOnError: Boolean): Extended; ! function IsFormatStored: boolean; procedure CMEnabledChanged(var Msg: TMessage); message CM_ENABLEDCHANGED; procedure CMEnter(var Msg: TCMEnter); message CM_ENTER; --- 71,81 ---- procedure SetMaxValue(AValue: Extended); procedure SetMinValue(AValue: Extended); ! procedure SetZeroEmpty(Value: Boolean); ! procedure SetFormatOnEditing(Value: Boolean); function GetText: string; procedure SetText(const AValue: string); function TextToValText(const AValue: string): string; //Polaris function CheckValue(NewValue: Extended; RaiseOnError: Boolean): Extended; ! function IsFormatStored: Boolean; procedure CMEnabledChanged(var Msg: TMessage); message CM_ENABLEDCHANGED; procedure CMEnter(var Msg: TCMEnter); message CM_ENTER; *************** *** 86,98 **** protected //Polaris up to protected ! function CheckValue(NewValue: Extended; RaiseOnError: boolean): Extended; procedure AcceptValue(const Value: Variant); override; procedure Change; override; procedure ReformatEditText; dynamic; ! function GetDefaultBitmap(var DestroyNeeded: boolean): TBitmap; override; procedure DataChanged; virtual; function DefaultDisplayFormat: string; virtual; ! procedure KeyPress(var Key: char); override; ! function IsValidChar(Key: char): boolean; virtual; function FormatDisplayText(Value: Extended): string; function GetDisplayText: string; virtual; --- 86,98 ---- protected //Polaris up to protected ! function CheckValue(NewValue: Extended; RaiseOnError: Boolean): Extended; procedure AcceptValue(const Value: Variant); override; procedure Change; override; procedure ReformatEditText; dynamic; ! function GetDefaultBitmap(var DestroyNeeded: Boolean): TBitmap; override; procedure DataChanged; virtual; function DefaultDisplayFormat: string; virtual; ! procedure KeyPress(var Key: Char); override; ! function IsValidChar(Key: Char): Boolean; virtual; function FormatDisplayText(Value: Extended): string; function GetDisplayText: string; virtual; *************** *** 101,125 **** procedure UpdateData; procedure UpdatePopup; virtual; ! property Formatting: boolean read FFormatting; ! property Alignment: TAlignment read FAlignment write SetAlignment ! default taRightJustify; ! property BeepOnError: boolean read FBeepOnError write SetBeepOnError ! default true; ! property CheckOnExit: boolean read FCheckOnExit write FCheckOnExit default false; property GlyphKind default gkDefault; property ButtonWidth default 21; //Polaris 20; ! property DecimalPlaces: Cardinal read FDecimalPlaces write SetDecimalPlaces ! default 2; ! property DisplayFormat: string read GetDisplayFormat write SetDisplayFormat ! stored IsFormatStored; property MaxValue: Extended read FMaxValue write SetMaxValue; property MinValue: Extended read FMinValue write SetMinValue; ! property FormatOnEditing: boolean read FFormatOnEditing ! write SetFormatOnEditing default false; ! property Text: string read GetText write SetText stored false; property MaxLength default 0; ! property ZeroEmpty: boolean read FZeroEmpty write SetZeroEmpty default true; //Polaris ! property DecimalPlaceRound: boolean read FDecimalPlaceRound write SetDecimalPlaceRound default false; public constructor Create(AOwner: TComponent); override; --- 101,121 ---- procedure UpdateData; procedure UpdatePopup; virtual; ! procedure DoBeepOnError; virtual; ! property Formatting: Boolean read FFormatting; ! property Alignment: TAlignment read FAlignment write SetAlignment default taRightJustify; ! property BeepOnError: Boolean read FBeepOnError write SetBeepOnError default True; ! property CheckOnExit: Boolean read FCheckOnExit write FCheckOnExit default False; property GlyphKind default gkDefault; property ButtonWidth default 21; //Polaris 20; ! property DecimalPlaces: Cardinal read FDecimalPlaces write SetDecimalPlaces default 2; ! property DisplayFormat: string read GetDisplayFormat write SetDisplayFormat stored IsFormatStored; property MaxValue: Extended read FMaxValue write SetMaxValue; property MinValue: Extended read FMinValue write SetMinValue; ! property FormatOnEditing: Boolean read FFormatOnEditing write SetFormatOnEditing default False; ! property Text: string read GetText write SetText stored False; property MaxLength default 0; ! property ZeroEmpty: Boolean read FZeroEmpty write SetZeroEmpty default True; //Polaris ! property DecimalPlaceRound: Boolean read FDecimalPlaceRound write SetDecimalPlaceRound default False; public constructor Create(AOwner: TComponent); override; *************** *** 207,214 **** TJvCustomCalcEdit = class(TJvCustomNumEdit) private ! FEnablePopupChange: boolean; protected procedure PopupChange; override; ! property EnablePopupChange: boolean read FEnablePopupChange write FEnablePopupChange default false; public constructor Create(AOwner: TComponent); override; --- 203,210 ---- TJvCustomCalcEdit = class(TJvCustomNumEdit) private ! FEnablePopupChange: Boolean; protected procedure PopupChange; override; ! property EnablePopupChange: Boolean read FEnablePopupChange write FEnablePopupChange default False; public constructor Create(AOwner: TComponent); override; *************** *** 218,223 **** published property Align; //Polaris - property DecimalPlaceRound; //Polaris - property Alignment; property AutoSelect; --- 214,217 ---- *************** *** 230,233 **** --- 224,228 ---- property Color; property Ctl3D; + property DecimalPlaceRound; //Polaris property DecimalPlaces; property DirectInput; *************** *** 313,333 **** TJvPopupWindowHack = class(TJvPopupWindow); ! function IsValidFloat(const Value: string; var RetValue: Extended): boolean; var ! I: integer; ! Buffer: array[0..63] of char; begin ! Result := false; for I := 1 to Length(Value) do if not (Value[I] in [DecimalSeparator, '-', '+', '0'..'9', 'e', 'E']) then Exit; Result := TextToFloat(StrPLCopy(Buffer, Value, ! sizeof(Buffer) - 1), RetValue, fvExtended); end; ! function FormatFloatStr(const S: string; Thousands: boolean): string; var ! I, MaxSym, MinSym, Group: integer; ! IsSign: boolean; begin Result := ''; --- 308,328 ---- TJvPopupWindowHack = class(TJvPopupWindow); ! function IsValidFloat(const Value: string; var RetValue: Extended): Boolean; var ! I: Integer; ! Buffer: array [0..63] of Char; begin ! Result := False; for I := 1 to Length(Value) do if not (Value[I] in [DecimalSeparator, '-', '+', '0'..'9', 'e', 'E']) then Exit; Result := TextToFloat(StrPLCopy(Buffer, Value, ! SizeOf(Buffer) - 1), RetValue, fvExtended); end; ! function FormatFloatStr(const S: string; Thousands: Boolean): string; var ! I, MaxSym, MinSym, Group: Integer; ! IsSign: Boolean; begin Result := ''; *************** *** 366,376 **** inherited Create(AOwner); ControlStyle := ControlStyle - [csSetCaption]; ! FDecimalPlaceRound := false; // Polaris MaxLength := 0; ! FBeepOnError := true; FAlignment := taRightJustify; FDisplayFormat := DefaultDisplayFormat; FDecimalPlaces := 2; ! FZeroEmpty := true; inherited Text := ''; inherited Alignment := taLeftJustify; --- 361,371 ---- inherited Create(AOwner); ControlStyle := ControlStyle - [csSetCaption]; ! FDecimalPlaceRound := False; // Polaris MaxLength := 0; ! FBeepOnError := True; FAlignment := taRightJustify; FDisplayFormat := DefaultDisplayFormat; FDecimalPlaces := 2; ! FZeroEmpty := True; inherited Text := ''; inherited Alignment := taLeftJustify; *************** *** 392,400 **** FCanvas.Free; if FPopup <> nil then - begin TJvPopupWindow(FPopup).OnCloseUp := nil; ! FPopup.Free; ! FPopup := nil; ! end; inherited Destroy; end; --- 387,392 ---- FCanvas.Free; if FPopup <> nil then TJvPopupWindow(FPopup).OnCloseUp := nil; ! FreeAndNil(FPopup); inherited Destroy; end; *************** *** 402,422 **** //Polaris ! procedure TJvCustomNumEdit.SetDecimalPlaceRound(Value: boolean); begin if FDecimalPlaceRound <> Value then begin FDecimalPlaceRound := Value; ! SetValue(CheckValue(FValue, false)); Invalidate; end; end; ! function TJvCustomNumEdit.GetDefaultBitmap(var DestroyNeeded: boolean): TBitmap; begin ! DestroyNeeded := false; if CalcBitmap = nil then begin CalcBitmap := TBitmap.Create; ! CalcBitmap.Handle := LoadBitmap(HInstance, sCalcBmp); end; Result := CalcBitmap; --- 394,414 ---- //Polaris ! procedure TJvCustomNumEdit.SetDecimalPlaceRound(Value: Boolean); begin if FDecimalPlaceRound <> Value then begin FDecimalPlaceRound := Value; ! SetValue(CheckValue(FValue, False)); Invalidate; end; end; ! function TJvCustomNumEdit.GetDefaultBitmap(var DestroyNeeded: Boolean): TBitmap; begin ! DestroyNeeded := False; if CalcBitmap = nil then begin CalcBitmap := TBitmap.Create; ! CalcBitmap.LoadFromResourceName(HInstance, sCalcBmp); end; Result := CalcBitmap; *************** *** 428,443 **** end; ! function TJvCustomNumEdit.IsFormatStored: boolean; begin Result := (DisplayFormat <> DefaultDisplayFormat); end; ! function TJvCustomNumEdit.IsValidChar(Key: char): boolean; var S: string; ! SelStart, SelStop, DecPos: integer; RetValue: Extended; begin ! Result := false; S := EditText; GetSel(SelStart, SelStop); --- 420,435 ---- end; ! function TJvCustomNumEdit.IsFormatStored: Boolean; begin Result := (DisplayFormat <> DefaultDisplayFormat); end; ! function TJvCustomNumEdit.IsValidChar(Key: Char): Boolean; var S: string; ! SelStart, SelStop, DecPos: Integer; RetValue: Extended; begin ! Result := False; S := EditText; GetSel(SelStart, SelStop); *************** *** 453,465 **** else DecPos := Length(S) - DecPos; ! if DecPos > integer(FDecimalPlaces) then Exit; end; Result := IsValidFloat(S, RetValue); if Result and (FMinValue >= 0) and (FMaxValue > 0) and (RetValue < 0) then ! Result := false; end; ! procedure TJvCustomNumEdit.KeyPress(var Key: char); begin if PopupVisible and (UpCase(Key) in ['0'..'9', DecimalSeparator, '.', ',', --- 445,457 ---- else DecPos := Length(S) - DecPos; ! if DecPos > Integer(FDecimalPlaces) then Exit; end; Result := IsValidFloat(S, RetValue); if Result and (FMinValue >= 0) and (FMaxValue > 0) and (RetValue < 0) then ! Result := False; end; ! procedure TJvCustomNumEdit.KeyPress(var Key: Char); begin if PopupVisible and (UpCase(Key) in ['0'..'9', DecimalSeparator, '.', ',', *************** *** 475,483 **** if (Key in [#32..#255]) and not IsValidChar(Key) then begin ! if BeepOnError then ! MessageBeep(0); Key := #0; end ! else if Key = #27 then begin Reset; --- 467,475 ---- if (Key in [#32..#255]) and not IsValidChar(Key) then begin ! DoBeepOnError; Key := #0; end ! else ! if Ord(Key) = VK_ESCAPE then begin Reset; *************** *** 492,496 **** end; ! procedure TJvCustomNumEdit.SetZeroEmpty(Value: boolean); begin if FZeroEmpty <> Value then --- 484,488 ---- end; ! procedure TJvCustomNumEdit.SetZeroEmpty(Value: Boolean); begin if FZeroEmpty <> Value then *************** *** 501,505 **** end; ! procedure TJvCustomNumEdit.SetBeepOnError(Value: boolean); begin if FBeepOnError <> Value then --- 493,497 ---- end; ! procedure TJvCustomNumEdit.SetBeepOnError(Value: Boolean); begin if FBeepOnError <> Value then *************** *** 534,538 **** end; ! procedure TJvCustomNumEdit.SetFocused(Value: boolean); begin if FFocused <> Value then --- 526,530 ---- end; ! procedure TJvCustomNumEdit.SetFocused(Value: Boolean); begin if FFocused <> Value then *************** *** 540,553 **** FFocused := Value; Invalidate; ! FFormatting := true; try DataChanged; finally ! FFormatting := false; end; end; end; ! procedure TJvCustomNumEdit.SetFormatOnEditing(Value: boolean); begin if FFormatOnEditing <> Value then --- 532,545 ---- FFocused := Value; Invalidate; ! FFormatting := True; try DataChanged; finally ! FFormatting := False; end; end; end; ! procedure TJvCustomNumEdit.SetFormatOnEditing(Value: Boolean); begin if FFormatOnEditing <> Value then *************** *** 560,564 **** if FFormatOnEditing and FFocused then ReformatEditText ! else if FFocused then begin UpdateData; --- 552,557 ---- if FFormatOnEditing and FFocused then ReformatEditText ! else ! if FFocused then begin UpdateData; *************** *** 573,577 **** begin FDecimalPlaces := Value; ! SetValue(CheckValue(FValue, false)); // Polaris (?) DataChanged; Invalidate; --- 566,570 ---- begin FDecimalPlaces := Value; ! SetValue(CheckValue(FValue, False)); // Polaris (?) DataChanged; Invalidate; *************** *** 607,628 **** EditText := '' else ! EditText := FormatFloat(EditFormat, CheckValue(FValue, false)); end; function TJvCustomNumEdit.CheckValue(NewValue: Extended; ! RaiseOnError: boolean): Extended; ! ! function Sign(Value: Extended): integer; ! begin ! if Value = 0 then ! Result := 0 ! else if Value < 0 then ! Result := -1 ! else ! Result := 1; ! end; ! var ! DP: integer; begin if FDecimalPlaceRound then --- 600,610 ---- EditText := '' else ! EditText := FormatFloat(EditFormat, CheckValue(FValue, False)); end; function TJvCustomNumEdit.CheckValue(NewValue: Extended; ! RaiseOnError: Boolean): Extended; var ! DP: Integer; begin if FDecimalPlaceRound then *************** *** 638,642 **** if NewValue < FMinValue then Result := FMinValue ! else if NewValue > FMaxValue then Result := FMaxValue; end --- 620,625 ---- if NewValue < FMinValue then Result := FMinValue ! else ! if NewValue > FMaxValue then Result := FMaxValue; end *************** *** 648,652 **** Result := FMinValue; end ! else if FMinValue = 0 then begin if NewValue > FMaxValue then --- 631,636 ---- Result := FMinValue; end ! else ! if FMinValue = 0 then begin if NewValue > FMaxValue then *************** *** 663,667 **** begin if not (csDesigning in ComponentState) and CheckOnExit then ! CheckValue(StrToFloat(TextToValText(EditText)), true); end; --- 647,651 ---- begin if not (csDesigning in ComponentState) and CheckOnExit then ! CheckValue(StrToFloat(TextToValText(EditText)), True); end; *************** *** 669,673 **** begin ValidateEdit; ! FValue := CheckValue(StrToFloat(TextToValText(EditText)), false); end; --- 653,657 ---- begin ValidateEdit; ! FValue := CheckValue(StrToFloat(TextToValText(EditText)), False); end; *************** *** 678,681 **** --- 662,671 ---- end; + procedure TJvCustomNumEdit.DoBeepOnError; + begin + if BeepOnError then + MessageBeep(0); + end; + function TJvCustomNumEdit.GetValue: Extended; begin *************** *** 691,695 **** procedure TJvCustomNumEdit.SetValue(AValue: Extended); begin ! FValue := CheckValue(AValue, false); DataChanged; Invalidate; --- 681,685 ---- procedure TJvCustomNumEdit.SetValue(AValue: Extended); begin ! FValue := CheckValue(AValue, False); DataChanged; Invalidate; *************** *** 731,736 **** function TJvCustomNumEdit.TextToValText(const AValue: string): string; var ! I: integer; ! x: char; begin Result := DelRSpace(AValue); --- 721,726 ---- function TJvCustomNumEdit.TextToValText(const AValue: string): string; var ! I: Integer; ! X: Char; begin Result := DelRSpace(AValue); *************** *** 746,751 **** while I <= Length(Result) do begin ! x := Result[I]; ! if (x = DecimalSeparator) or (x = '-') or ((x >= '0') and (x <= '9')) then begin I := I + 1; --- 736,741 ---- while I <= Length(Result) do begin ! X := Result[I]; ! if (X = DecimalSeparator) or (X = '-') or ((X >= '0') and (X <= '9')) then begin I := I + 1; *************** *** 758,762 **** if Result = '' then Result := '0' ! else if Result = '-' then Result := '-0'; end; --- 748,753 ---- if Result = '' then Result := '0' ! else ! if Result = '-' then Result := '-0'; end; *************** *** 766,770 **** if not (csReading in ComponentState) then begin ! FValue := CheckValue(StrToFloat(TextToValText(AValue)), false); DataChanged; Invalidate; --- 757,761 ---- if not (csReading in ComponentState) then begin ! FValue := CheckValue(StrToFloat(TextToValText(AValue)), False); DataChanged; Invalidate; *************** *** 775,782 **** var S: string; ! IsEmpty: boolean; ! OldLen, SelStart, SelStop: integer; begin ! FFormatting := true; try S := inherited Text; --- 766,773 ---- var S: string; ! IsEmpty: Boolean; ! OldLen, SelStart, SelStop: Integer; begin ! FFormatting := True; try S := inherited Text; *************** *** 796,800 **** end; finally ! FFormatting := false; end; end; --- 787,791 ---- end; finally ! FFormatting := False; end; end; *************** *** 813,817 **** begin inherited AcceptValue(Value); ! Self.Value := CheckValue(Value, false); //Polaris end; --- 804,808 ---- begin inherited AcceptValue(Value); ! Self.Value := CheckValue(Value, False); //Polaris end; *************** *** 829,834 **** if CanFocus then SetFocus; ! if BeepOnError then ! MessageBeep(0); end; end; --- 820,824 ---- if CanFocus then SetFocus; ! DoBeepOnError; end; end; *************** *** 836,840 **** procedure TJvCustomNumEdit.CMEnter(var Msg: TCMEnter); begin ! SetFocused(true); if FFormatOnEditing then ReformatEditText; --- 826,830 ---- procedure TJvCustomNumEdit.CMEnter(var Msg: TCMEnter); begin ! SetFocused(True); if FFormatOnEditing then ReformatEditText; *************** *** 853,857 **** raise; end; ! SetFocused(false); SetCursor(0); DoExit; --- 843,847 ---- raise; end; ! SetFocused(False); SetCursor(0); DoExit; *************** *** 900,905 **** var CurrStr: string; ! I: integer; ! C: char; begin Result := ',0.' + MakeStr('0', CurrencyDecimals); --- 890,895 ---- var CurrStr: string; ! I: Integer; ! C: Char; begin Result := ',0.' + MakeStr('0', CurrencyDecimals); *************** *** 942,953 **** end; - procedure DestroyLocals; - begin - CalcBitmap.Free; - CalcBitmap := nil; - end; - - { TJvCustomCalcEdit } - procedure TJvCustomCalcEdit.PopupChange; begin --- 932,935 ---- *************** *** 960,964 **** finalization ! DestroyLocals; end. --- 942,946 ---- finalization ! FreeAndNil(CalcBitmap); end. Index: JvBaseThumbnail.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvBaseThumbnail.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JvBaseThumbnail.pas 12 Oct 2003 12:41:25 -0000 1.3 --- JvBaseThumbnail.pas 21 Nov 2003 08:00:50 -0000 1.4 *************** *** 36,58 **** type ! { The TfileName Object has been created to handle the first field of a Thumb ! Wich is the Thumbs actual FileName complite with the Path because no ! duplicates are alowed in the final list. It Has the following properties ! 01) Filename : it Keeps the filename as gived by the user ! 02) LongName : It always returns the longName of the file ! 03) ShortName : It always returns the short name of the file ! 04) Size : It returns the size in Byte that it will occupy if saved in a stream ! 05) Length : The "Filename" property Length; ! and the following Methods ! 01) LoadFromStream(AStream:TStream;APos:Integer); It loads a filename from a stream ! if APos < 0 then don't change the cursors position in the stream ! else AStream.seek(APos,0); ! 02) SaveToStream(AStream:TStream;APos:Integer); Save the Filename to AStream ! If APos>-1 then AStream.seek(APos,0); SaveData; } ! TProgressNotify = procedure(Sender: TObject; Position: Integer; var Break: Boolean) of object; ! TInvalidImageEvent = procedure(Sender: TObject; const AFilename: string) of object; // (rom) renamed TGRFKind = (grBMP, grJPG, grWMF, grEMF, grICO, {$IFNDEF COMPILER6_UP} grGIF,{$ENDIF} grPNG); //,grPCX,grTGA); --- 36,58 ---- type ! { The TFileName object has been created to handle the first field of a Thumb ! Which is the Thumbs actual FileName complete with the Path because no ! duplicates are allowed in the final list. It Has the following properties ! 01) FileName : it keeps the filename as given by the user ! 02) LongName : it always returns the LongName of the file ! 03) ShortName: it always returns the short name of the file ! 04) Size : it returns the size in Bytes that it will occupy if saved in a stream ! 05) Length : the "FileName" property Length; ! and the following methods ! 01) LoadFromStream(AStream: TStream; APos: Integer); loads a filename from a stream ! if APos < 0 then don't change the cursor position in the stream ! else AStream.Seek(APos, 0); ! 02) SaveToStream(AStream: TStream; APos: Integer); Save the FileName to AStream ! if APos > -1 then AStream.Seek(APos, 0); SaveData; } ! TProgressNotify = procedure(Sender: TObject; Position: Integer; var Stop: Boolean) of object; ! TInvalidImageEvent = procedure(Sender: TObject; const AFileName: string) of object; // (rom) renamed TGRFKind = (grBMP, grJPG, grWMF, grEMF, grICO, {$IFNDEF COMPILER6_UP} grGIF,{$ENDIF} grPNG); //,grPCX,grTGA); *************** *** 74,88 **** procedure Init; public ! constructor Create; ! destructor Destroy; override; ! procedure LoadFromStream(AStream: TStream; APos: Integer); //Load From stream; // both of this routines are inserting extract data to the stream its self // like a header and data end string; ! procedure SaveToStream(AStream: TStream; APos: Integer); // Save to a Stream; // (rom) moved to public ! property LongName: string read FLongName; // The LongName of this filenam; property ShortName: string read FShortName; // shortname of this filename published ! property Filename: string read FFileName write SetName; // The Filename as given by the user; property Length: Integer read GetLength write SetLength; end; --- 74,86 ---- procedure Init; public ! procedure LoadFromStream(AStream: TStream; APos: Integer); //Load From stream // both of this routines are inserting extract data to the stream its self // like a header and data end string; ! procedure SaveToStream(AStream: TStream; APos: Integer); // Save to a Stream // (rom) moved to public ! property LongName: string read FLongName; // The LongName of this filename property ShortName: string read FShortName; // shortname of this filename published ! property FileName: string read FFileName write SetName; // The FileName as given by the user property Length: Integer read GetLength write SetLength; end; *************** *** 111,115 **** public constructor Create(AOwner: TComponent); override; - published end; --- 109,112 ---- *************** *** 161,165 **** public constructor Create(AOwner: TComponent); override; - published end; --- 158,161 ---- *************** *** 167,172 **** procedure InsertStr(var Str: string; const NewStr: string; Pos: Longint); function ProportionalSize(PhysicalSize, NewSize: TPoint): TPoint; - function CompletePath(const Path: string): string; - function IncompletePath(APath: string): string; function ReplaceChar(const AStr: string; const CharToFind, NewChar: Char; ReplaceNo: Longint; CaseSensitive: Boolean): string; --- 163,166 ---- *************** *** 180,191 **** JvThemes; - const - {$IFDEF COMPILER5_UP} - PathEnd = '\'; - {$ENDIF} - {$IFDEF LINUX} - PathEnd = '/'; - {$ENDIF} - function ReplaceAllStr(const Str, SearchFor, ReplaceWith: string; CaseSensitive: Boolean): string; --- 174,177 ---- *************** *** 261,297 **** end; - // add the slash character at the end of the Path. - - function CompletePath(const Path: string): string; - var - Res: string; - begin - if Length(Path) > 0 then - begin - if Path[Length(Path)] <> PathEnd then - Res := Path + PathEnd - else - Res := Path; - end - else - Res := Path; - Result := Res; - end; - - // Remove the slash character from the end of the Path. - - function IncompletePath(APath: string): string; - begin - if Length(APath) > 0 then - begin - if APath[Length(APath)] = PathEnd then - Result := Copy(APath, 1, Length(APath) - 1) - else - Result := APath; - end - else - Result := APath; - end; - function ProportionalSize(PhysicalSize, NewSize: TPoint): TPoint; var --- 247,250 ---- *************** *** 454,461 **** inherited Create(AOwner); ControlStyle := ControlStyle - [csSetCaption]; ! { If AOwner is TJvBaseThumbnail then begin ! ControlStyle := ControlStyle-[csCaptureMouse]; ! FIgnoreMouse := True ! end Else{} FIgnoreMouse := False; end; --- 407,416 ---- inherited Create(AOwner); ControlStyle := ControlStyle - [csSetCaption]; ! { If AOwner is TJvBaseThumbnail then ! begin ! ControlStyle := ControlStyle - [csCaptureMouse]; ! FIgnoreMouse := True; ! end ! else} FIgnoreMouse := False; end; *************** *** 510,520 **** procedure TJvBaseThumbImage.CMHitTest(var Msg: TCMHitTest); begin if csDesigning in ComponentState then inherited; ! if FIgnoreMouse then ! Msg.Result := HTNOWHERE // 0; ! else ! Msg.Result := HTCLIENT; // 1; end; --- 465,474 ---- procedure TJvBaseThumbImage.CMHitTest(var Msg: TCMHitTest); + const + Hits: array [Boolean] of Longint = (HTCLIENT, HTNOWHERE); begin if csDesigning in ComponentState then inherited; ! Msg.Result := Hits[IgnoreMouse]; end; *************** *** 524,529 **** begin inherited Create(AOwner); ! if AOwner is TJvBaseThumbview then ! ControlStyle := ControlStyle - [csSetCaption, csCaptureMouse] //, // csClickEvents,csDoubleClicks] else --- 478,483 ---- begin inherited Create(AOwner); ! if AOwner is TJvBaseThumbView then ! ControlStyle := ControlStyle - [csSetCaption, csCaptureMouse] // csClickEvents,csDoubleClicks] else *************** *** 534,539 **** X, Y: Integer); begin ! if Parent is TJvBaseThumbview then ! TJvBaseThumbview(Parent).MouseDown(Button, Shift, Left + X, Top + Y) else inherited MouseDown(Button, Shift, X, Y); --- 488,493 ---- X, Y: Integer); begin ! if Parent is TJvBaseThumbView then ! TJvBaseThumbView(Parent).MouseDown(Button, Shift, Left + X, Top + Y) else inherited MouseDown(Button, Shift, X, Y); *************** *** 548,553 **** procedure TJvBaseThumbnail.MouseMove(Shift: TShiftState; X, Y: Integer); begin ! if Parent is TJvBaseThumbview then ! TJvBaseThumbview(Parent).MouseMove(Shift, Left + X, Top + Y) else inherited MouseMove(Shift, X, Y); --- 502,507 ---- procedure TJvBaseThumbnail.MouseMove(Shift: TShiftState; X, Y: Integer); begin ! if Parent is TJvBaseThumbView then ! TJvBaseThumbView(Parent).MouseMove(Shift, Left + X, Top + Y) else inherited MouseMove(Shift, X, Y); *************** *** 557,562 **** MousePos: TPoint): Boolean; begin ! if Parent is TJvBaseThumbview then ! Result := TJvBaseThumbview(Parent).DoMouseWheel(Shift, WheelDelta, MousePos) else Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); --- 511,516 ---- MousePos: TPoint): Boolean; begin ! if Parent is TJvBaseThumbView then ! Result := TJvBaseThumbView(Parent).DoMouseWheel(Shift, WheelDelta, MousePos) else Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); *************** *** 565,570 **** function TJvBaseThumbnail.DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; begin ! if Parent is TJvBaseThumbview then ! Result := TJvBaseThumbview(Parent).DoMouseWheelDown(Shift, MousePos) else Result := inherited DoMouseWheelDown(Shift, MousePos); --- 519,524 ---- function TJvBaseThumbnail.DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; begin ! if Parent is TJvBaseThumbView then ! Result := TJvBaseThumbView(Parent).DoMouseWheelDown(Shift, MousePos) else Result := inherited DoMouseWheelDown(Shift, MousePos); *************** *** 573,578 **** function TJvBaseThumbnail.DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; begin ! if Parent is TJvBaseThumbview then ! Result := TJvBaseThumbview(Parent).DoMouseWheelUp(Shift, MousePos) else Result := inherited DoMouseWheelUp(Shift, MousePos); --- 527,532 ---- function TJvBaseThumbnail.DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; begin ! if Parent is TJvBaseThumbView then ! Result := TJvBaseThumbView(Parent).DoMouseWheelUp(Shift, MousePos) else Result := inherited DoMouseWheelUp(Shift, MousePos); *************** *** 581,586 **** procedure TJvBaseThumbnail.KeyDown(var Key: Word; Shift: TShiftState); begin ! if Parent is TJvBaseThumbview then ! TJvBaseThumbview(Parent).KeyDown(Key, Shift) else inherited KeyDown(Key, Shift); --- 535,540 ---- procedure TJvBaseThumbnail.KeyDown(var Key: Word; Shift: TShiftState); begin ! if Parent is TJvBaseThumbView then ! TJvBaseThumbView(Parent).KeyDown(Key, Shift) else inherited KeyDown(Key, Shift); *************** *** 589,594 **** procedure TJvBaseThumbnail.KeyUp(var Key: Word; Shift: TShiftState); begin ! if Parent is TJvBaseThumbview then ! TJvBaseThumbview(Parent).KeyUp(Key, Shift) else inherited KeyUp(Key, Shift); --- 543,548 ---- procedure TJvBaseThumbnail.KeyUp(var Key: Word; Shift: TShiftState); begin ! if Parent is TJvBaseThumbView then ! TJvBaseThumbView(Parent).KeyUp(Key, Shift) else inherited KeyUp(Key, Shift); *************** *** 597,602 **** procedure TJvBaseThumbnail.KeyPress(var Key: Char); begin ! if Parent is TJvBaseThumbview then ! TJvBaseThumbview(Parent).KeyPress(Key) else inherited KeyPress(Key); --- 551,556 ---- procedure TJvBaseThumbnail.KeyPress(var Key: Char); begin ! if Parent is TJvBaseThumbView then ! TJvBaseThumbView(Parent).KeyPress(Key) else inherited KeyPress(Key); *************** *** 606,611 **** X, Y: Integer); begin ! if Parent is TJvBaseThumbview then ! TJvBaseThumbview(Parent).MouseUp(Button, Shift, Left + X, Top + Y) else inherited MouseUp(Button, Shift, X, Y); --- 560,565 ---- X, Y: Integer); begin ! if Parent is TJvBaseThumbView then ! TJvBaseThumbView(Parent).MouseUp(Button, Shift, Left + X, Top + Y) else inherited MouseUp(Button, Shift, X, Y); *************** *** 614,619 **** procedure TJvBaseThumbnail.Click; begin ! if Parent is TJvBaseThumbview then ! TJvBaseThumbview(Parent).Click else inherited Click; --- 568,573 ---- procedure TJvBaseThumbnail.Click; begin ! if Parent is TJvBaseThumbView then ! TJvBaseThumbView(Parent).Click else inherited Click; *************** *** 622,634 **** procedure TJvBaseThumbnail.DblClick; begin ! if Parent is TJvBaseThumbview then ! TJvBaseThumbview(Parent).DblClick else inherited DblClick; end; ! //=== TJvBaseThumbview ======================================================= ! constructor TJvBaseThumbview.Create(AOwner: TComponent); begin inherited Create(AOwner); --- 576,588 ---- procedure TJvBaseThumbnail.DblClick; begin ! if Parent is TJvBaseThumbView then ! TJvBaseThumbView(Parent).DblClick else inherited DblClick; end; ! //=== TJvBaseThumbView ======================================================= ! constructor TJvBaseThumbView.Create(AOwner: TComponent); begin inherited Create(AOwner); *************** *** 638,642 **** end; { ! procedure TJvBaseThumbview.WMEraseBkgnd(var Msg: TWMEraseBkgnd); begin inherited; --- 592,596 ---- end; { ! procedure TJvBaseThumbView.WMEraseBkgnd(var Msg: TWMEraseBkgnd); begin inherited; *************** *** 646,659 **** //=== TFileName ============================================================== - constructor TFileName.Create; - begin - inherited Create; - end; - - destructor TFileName.Destroy; - begin - inherited Destroy; - end; - procedure TFileName.SetName(NewName: string); begin --- 600,603 ---- *************** *** 701,705 **** procedure TFileName.LoadFromStream(AStream: TStream; APos: Integer); begin ! // Uner Construction; end; --- 645,649 ---- procedure TFileName.LoadFromStream(AStream: TStream; APos: Integer); begin ! // Under Construction; end; |