View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005908 | JEDI VCL | 99 Other | public | 2012-06-14 13:21 | 2012-08-31 11:02 |
Reporter | Arioch | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | acknowledged | Resolution | open | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0005908: little fix for Validators example | ||||
Description | D:\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 Reproduce | RegExpr validation is broken completely, BTW | ||||
Tags | No tags attached. | ||||
|
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. |
|
1 and 2 is not intended, Delphi did on it's own. 3... i'd just check, maybe i did wrong something. |
|
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 |
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 |
|
TLabel.FocusControl is backward compatible ? don't remembersuch thing in Delphi 5, doubt it was in D7 |
|
Just checked, it's in D6 |
|
so, have a fix. it is not DFM-only, but it does include DFM too. |
|
Do you have a patch file? |
|
????? 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 |
|
Didn't get any notification and I did not notice them, sorry. |
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 |