View Issue Details

IDProjectCategoryView StatusLast Update
0005908JEDI VCL99 Otherpublic2012-08-31 11:02
ReporterAriochAssigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status acknowledgedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0005908: little fix for Validators example
DescriptionD:\DelphiProjects\Libs\JediVCL\jvcl\examples\JvValidators\MainFrm.dfm

the TMemo should be changed to make text readable, since in latter Delphi co-dependance of ScrollBars = ssVertical and WordWrap = True changed.

So the text is not wrapped now.

...

JvRegularExpressionValidator1.ControlToValidate is wrong, must be edRegExpr
JvRegularExpressionValidator1.PropertyToValidate got clean, must be 'Text'

Steps To ReproduceRegExpr validation is broken completely, BTW
TagsNo tags attached.

Relationships

related to 0005912 new JEDI Code Library TURESearch to be dumped or turned into wrapper around PCRE ? 
related to 0005909 acknowledged JEDI VCL RegExpr-validator is broken 

Activities

obones

2012-06-14 14:38

administrator   ~0019992

Hello,

I'm sorry, but your patch is not usable for many reasons:

- It adds back elements like DesignSize that are not supported by older versions of Delphi
- It changes the font to RUSSIAN_CHARSET which is definitely not desirable
- It prevents the text in the memo from expanding when the window is resized at runtime.

I agree that there is a presentation issue in latest delphi versions in the current demo, but the solution cannot be in the DFM and must be applicable to old Delphi versions.

Arioch

2012-06-14 14:55

developer   ~0019993

1 and 2 is not intended, Delphi did on it's own.

3... i'd just check, maybe i did wrong something.

Arioch

2012-06-14 15:21

developer   ~0019994

regarding 3 - TRichText CHANGES content of memo on WordWrap toggling. Gotcha... I though it was presentation-only property if TMEmo.

Using obsolete TRichEdit....

2012-06-14 15:26

 

pas.patch (3,088 bytes)
Index: MainFrm.pas
===================================================================
--- MainFrm.pas	(revision 13355)
+++ MainFrm.pas	(working copy)
@@ -32,7 +32,7 @@
 
 uses
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
-  StdCtrls, ComCtrls, JvValidators, JvErrorIndicator, ImgList, JvComponent;
+  JvValidators, JvErrorIndicator, JvComponentBase, Vcl.StdCtrls, Vcl.ComCtrls;
 
 type
   TfrmMain = class(TForm)
@@ -48,7 +48,7 @@
     btnCheck: TButton;
     Label5: TLabel;
     btnProviderCheck: TButton;
-    reResults: TRichEdit;
+    reResults: TMemo;
     btnValSum: TButton;
     JvValidators1: TJvValidators;
     JvErrorIndicator1: TJvErrorIndicator;
@@ -67,10 +67,14 @@
     procedure JvValidators1ValidateFailed(Sender: TObject;
       BaseValidator: TJvBaseValidator; var Continue: Boolean);
     procedure JvValidationSummary1Change(Sender: TObject);
+    procedure reResultsDblClick(Sender: TObject);
   private
     { Private declarations }
+    HelpText: string;
+
     procedure ProviderErrorValidateFailed(Sender: TObject;
       BaseValidator: TJvBaseValidator; var Continue: Boolean);
+    procedure MemoWrapMode(const do_wrap: boolean);
   public
     { Public declarations }
   end;
@@ -85,15 +89,10 @@
 
 {$R *.DFM}
 
-procedure TfrmMain.FormCreate(Sender: TObject);
-begin
-  reResults.WordWrap := true;
-end;
-
 procedure TfrmMain.btnCheckClick(Sender: TObject);
 begin
   reResults.Lines.Clear;
-  reResults.WordWrap := false;
+  MemoWrapMode( false );
   JvErrorIndicator1.ClearErrors;
   JvValidators1.ValidationSummary := nil;
   JvValidators1.ErrorIndicator := nil;
@@ -104,7 +103,7 @@
 procedure TfrmMain.btnProviderCheckClick(Sender: TObject);
 begin
   reResults.Lines.Clear;
-  reResults.WordWrap := false;
+  MemoWrapMode( false );
   // calling BeginUpdate/EndUpdate delays the error reporting until all controls have been validated
   JvErrorIndicator1.BeginUpdate;
   try
@@ -121,7 +120,7 @@
 procedure TfrmMain.btnValSumClick(Sender: TObject);
 begin
   reResults.Lines.Clear;
-  reResults.WordWrap := false;
+  MemoWrapMode( false );
   JvErrorIndicator1.ClearErrors;
   JvValidators1.OnValidateFailed := nil;
   JvValidators1.ErrorIndicator := nil;
@@ -132,6 +131,18 @@
   JvValidators1.Validate;
 end;
 
+procedure TfrmMain.reResultsDblClick(Sender: TObject);
+begin
+  reResults.Lines.Text := HelpText;
+  MemoWrapMode(true);
+end;
+
+procedure TfrmMain.FormCreate(Sender: TObject);
+begin
+  HelpText := reResults.Lines.Text;
+  MemoWrapMode(true);
+end;
+
 procedure TfrmMain.reResultsEnter(Sender: TObject);
 begin
   SelectNext(reResults,true,true);
@@ -151,6 +162,14 @@
   reResults.Lines.Add(Format('FAILED: %s',[BaseValidator.ErrorMessage]));
 end;
 
+procedure TfrmMain.MemoWrapMode(const do_wrap: boolean);
+begin
+  reResults.WordWrap := do_wrap;
+  if do_wrap
+     then reResults.ScrollBars := ssVertical
+     else reResults.ScrollBars := ssBoth
+end;
+
 procedure TfrmMain.ProviderErrorValidateFailed(Sender: TObject;
   BaseValidator: TJvBaseValidator; var Continue: Boolean);
 begin
pas.patch (3,088 bytes)

2012-06-14 15:26

 

dfm.patch (2,697 bytes)
Index: MainFrm.dfm
===================================================================
--- MainFrm.dfm	(revision 13355)
+++ MainFrm.dfm	(working copy)
@@ -7,22 +7,14 @@
   Color = clBtnFace
   Constraints.MinHeight = 270
   Constraints.MinWidth = 560
-  DefaultMonitor = dmDesktop
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Shell Dlg 2'
-  Font.Style = []
   OldCreateOrder = False
   Position = poScreenCenter
-  Scaled = False
   OnCreate = FormCreate
-  PixelsPerInch = 96
   TextHeight = 13
   object Label1: TLabel
     Left = 16
     Top = 16
-    Width = 155
+    autosize = true
     Height = 13
     Caption = 'This edit must have a(ny) value:'
     FocusControl = edRequired
@@ -30,7 +22,7 @@
   object Label2: TLabel
     Left = 16
     Top = 64
-    Width = 215
+    autosize = true
     Height = 13
     Caption = 'This edit must have more than 9  characters:'
     FocusControl = edRequired10Chars
@@ -38,7 +30,7 @@
   object Label3: TLabel
     Left = 16
     Top = 112
-    Width = 213
+    autosize = true
     Height = 13
     Caption = 'This edit must match the reg. expr."A.B.C.":'
     FocusControl = edRegExpr
@@ -46,7 +38,7 @@
   object Label4: TLabel
     Left = 16
     Top = 160
-    Width = 188
+    autosize = true
     Height = 13
     Caption = 'The value must be between 0 and 100:'
     FocusControl = edRange0to100
@@ -54,9 +46,10 @@
   object Label5: TLabel
     Left = 272
     Top = 16
-    Width = 34
+    autosize = true
     Height = 13
-    Caption = 'Result:'
+    Caption = 'Result  (Double-click to show help):'
+    OnDblClick = reResultsDblClick
   end
   object edRequired: TEdit
     Left = 16
@@ -119,15 +112,13 @@
     TabOrder = 5
     OnClick = btnProviderCheckClick
   end
-  object reResults: TRichEdit
+  object reResults: TMemo
     Left = 272
     Top = 32
     Width = 306
     Height = 167
-    Cursor = crArrow
     TabStop = False
     Anchors = [akLeft, akTop, akRight, akBottom]
-    Ctl3D = True
     Lines.Strings = (
       
         'This is a demo for the JvValidators component as well as the JvE' +
@@ -168,12 +159,13 @@
       ''
       '')
     ParentColor = True
-    ParentCtl3D = False
+    ParentCtl3D = True
     ReadOnly = True
     ScrollBars = ssBoth
     TabOrder = 8
     WordWrap = False
     OnEnter = reResultsEnter
+	OnDblClick = reResultsDblClick
   end
   object btnValSum: TButton
     Left = 174
@@ -197,6 +189,7 @@
       PropertyToValidate = 'Text'
       Enabled = True
       ErrorMessage = 'Value in edRequired cannot be empty'
+	  AllowBlank = False
     end
     object JvCustomValidator1: TJvCustomValidator
       Valid = True
dfm.patch (2,697 bytes)

Arioch

2012-06-14 15:27

developer   ~0019995

TLabel.FocusControl is backward compatible ? don't remembersuch thing in Delphi 5, doubt it was in D7

obones

2012-06-14 15:49

administrator   ~0019996

Just checked, it's in D6

Arioch

2012-06-14 16:04

developer   ~0019999

so, have a fix.
it is not DFM-only, but it does include DFM too.

obones

2012-06-18 11:23

administrator   ~0020008

Do you have a patch file?

Arioch

2012-06-18 14:52

developer   ~0020020

?????

Aren't they attached few days ago ?
Didn't u got mail notifications ?

2012-06-14 15:25 Arioch ???? ??????: example.patch
2012-06-14 15:26 Arioch ???? ????????: pas.patch
2012-06-14 15:26 Arioch ???? ????????: dfm.patch

obones

2012-06-18 15:17

administrator   ~0020022

Didn't get any notification and I did not notice them, sorry.

Issue History

Date Modified Username Field Change
2012-06-14 13:21 Arioch New Issue
2012-06-14 13:50 Arioch Summary little fix for example => little fix for Validators example
2012-06-14 13:50 Arioch Description Updated
2012-06-14 13:50 Arioch Steps to Reproduce Updated
2012-06-14 13:51 Arioch File Added: example.patch
2012-06-14 14:00 Arioch Relationship added related to 0005909
2012-06-14 14:38 obones Note Added: 0019992
2012-06-14 14:38 obones Status new => feedback
2012-06-14 14:55 Arioch Note Added: 0019993
2012-06-14 15:21 Arioch Note Added: 0019994
2012-06-14 15:25 Arioch File Deleted: example.patch
2012-06-14 15:26 Arioch File Added: pas.patch
2012-06-14 15:26 Arioch File Added: dfm.patch
2012-06-14 15:27 Arioch Note Added: 0019995
2012-06-14 15:49 obones Note Added: 0019996
2012-06-14 16:04 Arioch Note Added: 0019999
2012-06-18 11:23 obones Note Added: 0020008
2012-06-18 14:52 Arioch Note Added: 0020020
2012-06-18 15:17 obones Note Added: 0020022
2012-06-18 15:17 obones Status feedback => acknowledged
2012-08-31 11:02 Arioch Relationship added related to 0005912