View Issue Details

IDProjectCategoryView StatusLast Update
0033480PatchesLCLpublic2018-09-16 21:52
ReporterAlexey Tor.Assigned ToBart Broersma 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version1.9 (SVN)Product Build 
Target VersionFixed in Version 
Summary0033480: Don't publish TCommonDialog.Width/ Height
Descriptionpatch moves Width/Height to "public".
reasons:

a) Delphi7 don't publish them for all 11 dialogs.
b) users confused what to do with printer-dialogs Width/Height (and find-dialog/ replace-dialog)
TagsNo tags attached.
Fixed in Revisionr59032
LazTargetpost 1.10
Widgetset
Attached Files
  • nowid.diff (980 bytes)
    Index: lcl/dialogs.pp
    ===================================================================
    --- lcl/dialogs.pp	(revision 57551)
    +++ lcl/dialogs.pp	(working copy)
    @@ -100,13 +100,13 @@
         procedure DoCanClose(var CanClose: Boolean); virtual;
         procedure DoClose; virtual;
         function HandleAllocated: boolean;
    +    property Width: integer read GetWidth write SetWidth;
    +    property Height: integer read GetHeight write SetHeight;
       published
         property OnClose: TNotifyEvent read FOnClose write FOnClose;
         property OnCanClose: TCloseQueryEvent read FOnCanClose write FOnCanClose;
         property OnShow: TNotifyEvent read FOnShow write FOnShow;
         property HelpContext: THelpContext read FHelpContext write FHelpContext default 0;
    -    property Width: integer read GetWidth write SetWidth default 0;
    -    property Height: integer read GetHeight write SetHeight default 0;
         property Title: TTranslateString read FTitle write FTitle stored IsTitleStored;
       end;
     
    
    nowid.diff (980 bytes)
  • nowid2.diff (1,444 bytes)
    Index: lcl/dialogs.pp
    ===================================================================
    --- lcl/dialogs.pp	(revision 57551)
    +++ lcl/dialogs.pp	(working copy)
    @@ -100,13 +100,13 @@
         procedure DoCanClose(var CanClose: Boolean); virtual;
         procedure DoClose; virtual;
         function HandleAllocated: boolean;
    +    property Width: integer read GetWidth write SetWidth;
    +    property Height: integer read GetHeight write SetHeight;
       published
         property OnClose: TNotifyEvent read FOnClose write FOnClose;
         property OnCanClose: TCloseQueryEvent read FOnCanClose write FOnCanClose;
         property OnShow: TNotifyEvent read FOnShow write FOnShow;
         property HelpContext: THelpContext read FHelpContext write FHelpContext default 0;
    -    property Width: integer read GetWidth write SetWidth default 0;
    -    property Height: integer read GetHeight write SetHeight default 0;
         property Title: TTranslateString read FTitle write FTitle stored IsTitleStored;
       end;
     
    @@ -954,6 +954,9 @@
       InterfaceBase.PromptDialogFunction := @DefaultPromptDialog;
       InterfaceBase.QuestionDialogFunction := @DefaultQuestionDialog;
     
    +  RegisterPropertyToSkip(TCommonDialog, 'Width', 'Property streamed in older Lazarus revision','');
    +  RegisterPropertyToSkip(TCommonDialog, 'Height', 'Property streamed in older Lazarus revision','');
    +
     finalization
       InterfaceBase.InputDialogFunction := nil;
       InterfaceBase.QuestionDialogFunction := nil;
    
    nowid2.diff (1,444 bytes)

Relationships

related to 0033427 resolvedJuha Manninen Lazarus Unable to set / get margins from PageSetupDialog in Linux 

Activities

Alexey Tor.

2018-03-22 15:02

reporter  

nowid.diff (980 bytes)
Index: lcl/dialogs.pp
===================================================================
--- lcl/dialogs.pp	(revision 57551)
+++ lcl/dialogs.pp	(working copy)
@@ -100,13 +100,13 @@
     procedure DoCanClose(var CanClose: Boolean); virtual;
     procedure DoClose; virtual;
     function HandleAllocated: boolean;
+    property Width: integer read GetWidth write SetWidth;
+    property Height: integer read GetHeight write SetHeight;
   published
     property OnClose: TNotifyEvent read FOnClose write FOnClose;
     property OnCanClose: TCloseQueryEvent read FOnCanClose write FOnCanClose;
     property OnShow: TNotifyEvent read FOnShow write FOnShow;
     property HelpContext: THelpContext read FHelpContext write FHelpContext default 0;
-    property Width: integer read GetWidth write SetWidth default 0;
-    property Height: integer read GetHeight write SetHeight default 0;
     property Title: TTranslateString read FTitle write FTitle stored IsTitleStored;
   end;
 
nowid.diff (980 bytes)

Bart Broersma

2018-03-22 22:39

developer   ~0107345

This will cause loading errors because you have removed a previously published property.
You need to have a RegisterPropertyToSkip() somewhere to prevent that.

Alexey Tor.

2018-03-23 06:05

reporter  

nowid2.diff (1,444 bytes)
Index: lcl/dialogs.pp
===================================================================
--- lcl/dialogs.pp	(revision 57551)
+++ lcl/dialogs.pp	(working copy)
@@ -100,13 +100,13 @@
     procedure DoCanClose(var CanClose: Boolean); virtual;
     procedure DoClose; virtual;
     function HandleAllocated: boolean;
+    property Width: integer read GetWidth write SetWidth;
+    property Height: integer read GetHeight write SetHeight;
   published
     property OnClose: TNotifyEvent read FOnClose write FOnClose;
     property OnCanClose: TCloseQueryEvent read FOnCanClose write FOnCanClose;
     property OnShow: TNotifyEvent read FOnShow write FOnShow;
     property HelpContext: THelpContext read FHelpContext write FHelpContext default 0;
-    property Width: integer read GetWidth write SetWidth default 0;
-    property Height: integer read GetHeight write SetHeight default 0;
     property Title: TTranslateString read FTitle write FTitle stored IsTitleStored;
   end;
 
@@ -954,6 +954,9 @@
   InterfaceBase.PromptDialogFunction := @DefaultPromptDialog;
   InterfaceBase.QuestionDialogFunction := @DefaultQuestionDialog;
 
+  RegisterPropertyToSkip(TCommonDialog, 'Width', 'Property streamed in older Lazarus revision','');
+  RegisterPropertyToSkip(TCommonDialog, 'Height', 'Property streamed in older Lazarus revision','');
+
 finalization
   InterfaceBase.InputDialogFunction := nil;
   InterfaceBase.QuestionDialogFunction := nil;
nowid2.diff (1,444 bytes)

Alexey Tor.

2018-03-23 06:05

reporter   ~0107352

added fixed patch.

Juha Manninen

2018-03-23 11:29

developer   ~0107370

Why were Width/Height properties confusing with printer dialog and others?

The properties were added at 2014-11-29 in r47028 by Bart with comment:
  Dialogs, ExtDlgs:
    - return correct Height/Width for TFindDialog, TCalendarDialog, TCalculatorDialog
    - implement Top/Left for TExtCommonDialog

Assigning to Bart.

Bart Broersma

2018-03-23 19:04

developer   ~0107376

Last edited: 2018-03-23 19:05

View 2 revisions

I never changed visibility of widht/height, I simply made them work as intended.

Juha Manninen

2018-03-23 20:11

developer   ~0107377

Ok, yes. Actually the properties have been there for a long time and published from the beginning.
r1711 at 2002-05-30 added InitialWidth and InitialHeight.
r1713 later at that day changed them to Width and Height.
It was by developer "lazarus" which is most likely Mattias.

Are they needed?
I don't know but I don't understand how they are confusing either.
Right now I feel that AlexeyT wants to make a trivial and useless change.

Alexey Tor.

2018-03-24 17:46

reporter   ~0107394

It's useful change: to not show crap props, "noise in OI"

Bart Broersma

2018-03-25 21:52

developer   ~0107419

I'll apply the patch, but currently I'm just too busy with other things.
As this has been around for ages, a few more days (or even weeks) won't matter that much.

@Juha: should this be merged to 1.8 ??

Juha Manninen

2018-03-26 21:06

developer   ~0107431

> should this be merged to 1.8 ??

Not really. It is not strictly a bug fix. It is good to adjust for such changes in trunk.

wp

2018-03-26 23:28

developer   ~0107432

Last edited: 2018-03-27 09:59

View 3 revisions

Hmm... In Windows the FileDialogs can change their size, therefore, Width and Height must be re-published for them.

What happens if Width and Height have been declared in TCommonDialog as properties to skip, but a derived class publishes them again?

The FindDialog and ReplaceDialog can be resized, but vertical resizing does not make much sense - re-publish at least Width. And these dialogs need a redesign, they come up after the double-click in design mode with the header bar off-screen (at least on Win 10). And the controls in the FindDialog should be re-aligned.

Alexey, wouldn't this be something for you to fix?

Alexey Tor.

2018-06-24 13:13

reporter   ~0109029

Last edited: 2018-06-24 13:14

View 2 revisions

wp,
> In Windows the FileDialogs can change their size, therefore, Width and Height must be re-published for them.

but what code uses this Widht/Height props to adjust dialog?
i didn't see an app, which sets FileDialog custom width/height __from code_.
so they not used.

Bart Broersma

2018-09-16 15:07

developer   ~0110787

Last edited: 2018-09-16 21:52

View 2 revisions

Apllied second patch from AlexeyT.
I won't merge it to 1.8.6 (if released) but I'll ask to merge it to 1.2.
(In essence it's a Delphi incompatibility, so a bug)

Bart Broersma

2018-09-16 15:09

developer   ~0110788

Unable to set Target and Fixed in version.
Entry post 1.2 doesn't exist yet.

Issue History

Date Modified Username Field Change
2018-03-22 15:02 Alexey Tor. New Issue
2018-03-22 15:02 Alexey Tor. File Added: nowid.diff
2018-03-22 22:39 Bart Broersma Note Added: 0107345
2018-03-22 22:39 Bart Broersma LazTarget => -
2018-03-22 22:39 Bart Broersma Status new => feedback
2018-03-23 06:05 Alexey Tor. File Added: nowid2.diff
2018-03-23 06:05 Alexey Tor. Note Added: 0107352
2018-03-23 06:05 Alexey Tor. Status feedback => new
2018-03-23 11:29 Juha Manninen Note Added: 0107370
2018-03-23 11:30 Juha Manninen Assigned To => Bart Broersma
2018-03-23 11:30 Juha Manninen Status new => assigned
2018-03-23 19:04 Bart Broersma Note Added: 0107376
2018-03-23 19:04 Bart Broersma Status assigned => feedback
2018-03-23 19:05 Bart Broersma Note Edited: 0107376 View Revisions
2018-03-23 19:05 Bart Broersma Status feedback => assigned
2018-03-23 20:11 Juha Manninen Note Added: 0107377
2018-03-24 17:46 Alexey Tor. Note Added: 0107394
2018-03-25 20:40 Juha Manninen Relationship added related to 0033427
2018-03-25 21:52 Bart Broersma Note Added: 0107419
2018-03-26 20:34 Bart Broersma Summary Dont publish TCommonDialog.Width/ Height => Don't publish TCommonDialog.Width/ Height
2018-03-26 21:06 Juha Manninen Note Added: 0107431
2018-03-26 23:28 wp Note Added: 0107432
2018-03-27 09:59 wp Note Edited: 0107432 View Revisions
2018-03-27 09:59 wp Note Edited: 0107432 View Revisions
2018-06-24 13:13 Alexey Tor. Note Added: 0109029
2018-06-24 13:14 Alexey Tor. Note Edited: 0109029 View Revisions
2018-09-16 15:07 Bart Broersma Note Added: 0110787
2018-09-16 15:09 Bart Broersma Fixed in Revision => r59032
2018-09-16 15:09 Bart Broersma LazTarget - => post 1.10
2018-09-16 15:09 Bart Broersma Note Added: 0110788
2018-09-16 15:09 Bart Broersma Status assigned => resolved
2018-09-16 15:09 Bart Broersma Resolution open => fixed
2018-09-16 21:52 Bart Broersma Note Edited: 0110787 View Revisions