View Issue Details

IDProjectCategoryView StatusLast Update
0024591LazarusLCLpublic2013-06-14 05:13
ReporterDo-wan KimAssigned ToPaul Ishenin 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformOSWindowsOS Version
Product Version1.1 (SVN)Product Build41697 
Target Version1.2.0Fixed in Version1.1 (SVN) 
Summary0024591: ComboBox.Text wrong at OnChange OnSelect after 41697
DescriptionComboBox.Text got previous text at event OnChange OnSelect when drop-down select.

Changed SetText do nothing on these event.

Steps To ReproduceDrop ComboBox on Form.

Fill Item values 1,2,3,4,5.

At OnChange, OnSelect event, make coding "ShowMessage(ComboBox1.Text);".

When Drop-down selected, shows previous Text value.
TagsNo tags attached.
Fixed in Revision41710
LazTarget1.2
WidgetsetWin32/Win64
Attached Files
  • win32settext41697.patch (3,543 bytes)
    Index: win32wsspin.pp
    ===================================================================
    --- win32wsspin.pp	(revision 41700)
    +++ win32wsspin.pp	(working copy)
    @@ -59,6 +59,7 @@
         class procedure SetReadOnly(const ACustomEdit: TCustomEdit; NewReadOnly: boolean); override;
         class procedure SetSelStart(const ACustomEdit: TCustomEdit; NewStart: integer); override;
         class procedure SetSelLength(const ACustomEdit: TCustomEdit; NewLength: integer); override;
    +    class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
         class procedure ShowHide(const AWinControl: TWinControl); override;
     
         class procedure UpdateControl(const ACustomFloatSpinEdit: TCustomFloatSpinEdit); override;
    @@ -316,8 +317,8 @@
       Result := EditGetSelLength(ACustomEdit.Handle);
     end;
     
    -class function TWin32WSCustomFloatSpinEdit.GetText(const AWinControl: TWinControl;
    -  var AText: string): boolean;
    +class function TWin32WSCustomFloatSpinEdit.GetText(
    +  const AWinControl: TWinControl; var AText: String): Boolean;
     begin
       if not WSCheckHandleAllocated(AWinControl, 'GetText') then
         Exit(False);
    @@ -349,6 +350,11 @@
       EditSetSelLength(ACustomEdit.Handle, NewLength);
     end;
     
    +class procedure TWin32WSCustomFloatSpinEdit.SetText(const AWinControl: TWinControl; const AText: String);
    +begin
    +  TWin32WSWinControl.SetText(AWinControl,AText);
    +end;
    +
     class procedure TWin32WSCustomFloatSpinEdit.ShowHide(
       const AWinControl: TWinControl);
     const
    Index: win32wsstdctrls.pp
    ===================================================================
    --- win32wsstdctrls.pp	(revision 41700)
    +++ win32wsstdctrls.pp	(working copy)
    @@ -92,6 +92,7 @@
         class procedure SetMaxLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override;
         class procedure SetReadOnly(const ACustomComboBox: TCustomComboBox; NewReadOnly: boolean); override;
         class procedure SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle); override;
    +    class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
     
         class function  GetItems(const ACustomComboBox: TCustomComboBox): TStrings; override;
         class procedure Sort(const ACustomComboBox: TCustomComboBox; AList: TStrings; IsSorted: boolean); override;
    @@ -188,6 +189,7 @@
     
         class procedure SetCaretPos(const ACustomEdit: TCustomEdit; const NewPos: TPoint); override;
         class procedure SetScrollbars(const ACustomMemo: TCustomMemo; const NewScrollbars: TScrollStyle); override;
    +    class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
         class procedure SetWordWrap(const ACustomMemo: TCustomMemo; const NewWordWrap: boolean); override;
       end;
     
    @@ -915,6 +917,11 @@
       RecreateWnd(ACustomComboBox);
     end;
     
    +class procedure TWin32WSCustomComboBox.SetText(const AWinControl: TWinControl; const AText: String);
    +begin
    +  TWin32WSWinControl.SetText(AWinControl,AText);
    +end;
    +
     class function TWin32WSCustomComboBox.GetItemIndex(const ACustomComboBox: TCustomComboBox): integer;
     begin
       Result := SendMessage(ACustomComboBox.Handle, CB_GETCURSEL, 0, 0);
    @@ -1329,6 +1336,11 @@
       RecreateWnd(ACustomMemo);
     end;
     
    +class procedure TWin32WSCustomMemo.SetText(const AWinControl: TWinControl; const AText: String);
    +begin
    +  TWin32WSWinControl.SetText(AWinControl,AText);
    +end;
    +
     class procedure TWin32WSCustomMemo.SetWordWrap(const ACustomMemo: TCustomMemo; const NewWordWrap: boolean);
     begin
       // TODO: check if can be done without recreation
    
    win32settext41697.patch (3,543 bytes)

Activities

Do-wan Kim

2013-06-13 12:33

reporter  

win32settext41697.patch (3,543 bytes)
Index: win32wsspin.pp
===================================================================
--- win32wsspin.pp	(revision 41700)
+++ win32wsspin.pp	(working copy)
@@ -59,6 +59,7 @@
     class procedure SetReadOnly(const ACustomEdit: TCustomEdit; NewReadOnly: boolean); override;
     class procedure SetSelStart(const ACustomEdit: TCustomEdit; NewStart: integer); override;
     class procedure SetSelLength(const ACustomEdit: TCustomEdit; NewLength: integer); override;
+    class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
     class procedure ShowHide(const AWinControl: TWinControl); override;
 
     class procedure UpdateControl(const ACustomFloatSpinEdit: TCustomFloatSpinEdit); override;
@@ -316,8 +317,8 @@
   Result := EditGetSelLength(ACustomEdit.Handle);
 end;
 
-class function TWin32WSCustomFloatSpinEdit.GetText(const AWinControl: TWinControl;
-  var AText: string): boolean;
+class function TWin32WSCustomFloatSpinEdit.GetText(
+  const AWinControl: TWinControl; var AText: String): Boolean;
 begin
   if not WSCheckHandleAllocated(AWinControl, 'GetText') then
     Exit(False);
@@ -349,6 +350,11 @@
   EditSetSelLength(ACustomEdit.Handle, NewLength);
 end;
 
+class procedure TWin32WSCustomFloatSpinEdit.SetText(const AWinControl: TWinControl; const AText: String);
+begin
+  TWin32WSWinControl.SetText(AWinControl,AText);
+end;
+
 class procedure TWin32WSCustomFloatSpinEdit.ShowHide(
   const AWinControl: TWinControl);
 const
Index: win32wsstdctrls.pp
===================================================================
--- win32wsstdctrls.pp	(revision 41700)
+++ win32wsstdctrls.pp	(working copy)
@@ -92,6 +92,7 @@
     class procedure SetMaxLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override;
     class procedure SetReadOnly(const ACustomComboBox: TCustomComboBox; NewReadOnly: boolean); override;
     class procedure SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle); override;
+    class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
 
     class function  GetItems(const ACustomComboBox: TCustomComboBox): TStrings; override;
     class procedure Sort(const ACustomComboBox: TCustomComboBox; AList: TStrings; IsSorted: boolean); override;
@@ -188,6 +189,7 @@
 
     class procedure SetCaretPos(const ACustomEdit: TCustomEdit; const NewPos: TPoint); override;
     class procedure SetScrollbars(const ACustomMemo: TCustomMemo; const NewScrollbars: TScrollStyle); override;
+    class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
     class procedure SetWordWrap(const ACustomMemo: TCustomMemo; const NewWordWrap: boolean); override;
   end;
 
@@ -915,6 +917,11 @@
   RecreateWnd(ACustomComboBox);
 end;
 
+class procedure TWin32WSCustomComboBox.SetText(const AWinControl: TWinControl; const AText: String);
+begin
+  TWin32WSWinControl.SetText(AWinControl,AText);
+end;
+
 class function TWin32WSCustomComboBox.GetItemIndex(const ACustomComboBox: TCustomComboBox): integer;
 begin
   Result := SendMessage(ACustomComboBox.Handle, CB_GETCURSEL, 0, 0);
@@ -1329,6 +1336,11 @@
   RecreateWnd(ACustomMemo);
 end;
 
+class procedure TWin32WSCustomMemo.SetText(const AWinControl: TWinControl; const AText: String);
+begin
+  TWin32WSWinControl.SetText(AWinControl,AText);
+end;
+
 class procedure TWin32WSCustomMemo.SetWordWrap(const ACustomMemo: TCustomMemo; const NewWordWrap: boolean);
 begin
   // TODO: check if can be done without recreation
win32settext41697.patch (3,543 bytes)

Paul Ishenin

2013-06-14 04:37

manager   ~0068289

Please test and close if ok.

Do-wan Kim

2013-06-14 05:13

reporter   ~0068290

Thank you :)

Issue History

Date Modified Username Field Change
2013-06-13 12:33 Do-wan Kim New Issue
2013-06-13 12:33 Do-wan Kim File Added: win32settext41697.patch
2013-06-13 14:31 Paul Ishenin Assigned To => Paul Ishenin
2013-06-13 14:31 Paul Ishenin Status new => assigned
2013-06-14 04:37 Paul Ishenin Fixed in Revision => 41710
2013-06-14 04:37 Paul Ishenin LazTarget => 1.2
2013-06-14 04:37 Paul Ishenin Note Added: 0068289
2013-06-14 04:37 Paul Ishenin Status assigned => resolved
2013-06-14 04:37 Paul Ishenin Fixed in Version => 1.1 (SVN)
2013-06-14 04:37 Paul Ishenin Resolution open => fixed
2013-06-14 04:37 Paul Ishenin Target Version => 1.2.0
2013-06-14 05:13 Do-wan Kim Note Added: 0068290
2013-06-14 05:13 Do-wan Kim Status resolved => closed