View Issue Details

IDProjectCategoryView StatusLast Update
0013195LazarusLCLpublic2013-09-03 12:07
Reporterhaword Assigned ToPaul Ishenin  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.27 (SVN) 
Fixed in Version0.9.27 (SVN) 
Summary0013195: [WinCE] TComboBox not show event OnChange when change item in ComboBox list
DescriptionTComboBox not show event OnChange when change item in ComboBox list.
(This patch include previos patches posted earlier)
TagsNo tags attached.
Fixed in Revision18742
LazTarget1.4
WidgetsetWinCE
Attached Files

Relationships

has duplicate 0011914 closedPaul Ishenin Combobox – onchange event does not seem to fire. 

Activities

2009-02-17 12:39

 

WinCEComboBoxOnChange.patch (6,241 bytes)   
Index: wincecallback.inc
===================================================================
--- wincecallback.inc	(revision 18702)
+++ wincecallback.inc	(working copy)
@@ -206,7 +206,7 @@
   WindowInfo: PWindowInfo;
   Flags: dword;
   ChildWindowInfo: PWindowInfo;
-  
+
   LMScroll: TLMScroll; // used by WM_HSCROLL
   LMKey: TLMKey; // used by WM_KEYDOWN WM_KEYUP
   LMChar: TLMChar; // used by WM_CHAR
@@ -220,7 +220,7 @@
 
   OrgCharCode: word; // used in WM_CHAR handling
 
-  
+
   NMHdr: PNMHdr absolute LParam; // used by WM_NOTIFY
   TmpSize: TSize; // used by WM_MEASUREITEM
   {$ifndef win32}
@@ -264,7 +264,7 @@
     if PopupMenu <> nil then //processing popup menu
     begin
       WindowInfo^.PopupMenu := nil;
-      Result := PopupMenu.FindItem(LOWORD(WParam), fkCommand);
+      Result := PopupMenu.FindItem(LOWORD(WParam) - StartMenuItem , fkCommand);
     end;
     {$ifndef win32}
     if Result = nil then //if Result is still nil, process main menu
@@ -277,7 +277,7 @@
     {
       This way returns False for GetMenuItemInfo(W) - extended error is so:
       This function is only valid in win32 mode
-      
+
       if GetMenuItemInfo(MainMenuHandle, LOWORD(WParam), false, @MenuInfo) then
         Result := TObject(MenuInfo.dwItemData)
       else
@@ -717,7 +717,7 @@
       if ACursor = crDefault then
       begin
         // statictext controls do not get WM_SETCURSOR messages...
-        lControl := lWinControl.ControlAtPos(P, [capfOnlyClientAreas, 
+        lControl := lWinControl.ControlAtPos(P, [capfOnlyClientAreas,
           capfAllowWinControls, capfHasScrollOffset, capfRecursive]);
         if lControl = nil then
           lControl := lWinControl;
@@ -767,7 +767,7 @@
             end;
           end;
         end;
-        
+
      //roozbeh : we dont have these in wince!
      { SC_MINIMIZE:
         begin
@@ -786,7 +786,7 @@
                 Application.MainForm.Width, 0, SWP_NOACTIVATE);
                 if Application.MainForm.HandleAllocated then
                  Windows.ShowWindow(Application.MainForm.Handle,SW_HIDE);
-                 
+
               Application.IntfAppMinimize;
           end;
         end;}
@@ -804,7 +804,7 @@
             if Windows.IsWindowEnabled(Application.MainForm.Handle)
              then Windows.SetActiveWindow(Application.MainForm.Handle);
             WinProcess := false;
-            
+
             Application.IntfAppRestore;
           end;
         end;}
@@ -877,7 +877,7 @@
       SetWin32SizePoint(MaxWidth, MaxHeight, MinMaxInfo.ptMaxTrackSize);
     end;
   end;
-  
+
   procedure HandleListViewCustomDraw(ALV: TCustomListViewAccess);
     function ConvState(const State: uint): TCustomDrawState;
     begin
@@ -892,8 +892,8 @@
       if state and CDIS_MARKED <> 0 then Include(Result, cdsMarked);
       if state and CDIS_SELECTED <> 0 then Include(Result, cdsSelected);
     end;
- 
-  const 
+
+  const
     CDRFRESULT: array[TCustomDrawResultFlag] of Integer = (
       CDRF_SKIPDEFAULT,
       CDRF_NOTIFYPOSTPAINT,
@@ -902,7 +902,7 @@
       CDRF_NOTIFYPOSTERASE,
       CDRF_NOTIFYITEMERASE
     );
-  var 
+  var
     DrawInfo: PNMLVCustomDraw absolute NMHdr;
     Stage: TCustomDrawStage;
     DrawResult: TCustomDrawResult;
@@ -913,12 +913,12 @@
     case DrawInfo^.dwDrawStage and $7 of //Get drawing state
       CDDS_PREPAINT:  Stage := cdPrePaint;
       CDDS_POSTPAINT: Stage := cdPostPaint;
-      CDDS_PREERASE:  Stage := cdPreErase; 
+      CDDS_PREERASE:  Stage := cdPreErase;
       CDDS_POSTERASE: Stage := cdPostErase;
     else
       Exit;
-    end;  
-    
+    end;
+
     case DrawInfo^.dwDrawStage and (CDDS_ITEM or CDDS_SUBITEM) of
       0: begin //Whole control
         DrawResult := ALV.IntfCustomDraw(dtControl, Stage, -1, -1, [], @DrawInfo^.rc);
@@ -931,7 +931,7 @@
         if DrawInfo^.iSubItem = 0 then Exit;
         DrawResult := ALV.IntfCustomDraw(dtItem, Stage, DrawInfo^.dwItemSpec, DrawInfo^.iSubItem, ConvState(DrawInfo^.uItemState), nil);
       end;
-    else 
+    else
       Exit;
     end;
 
@@ -941,7 +941,7 @@
       then lmNotify.result := lmNotify.result or CDRFRESULT[ResultFlag];
     end;
   end;
-  
+
   function HandleUnicodeChar(AChar: Word): boolean;
   var
     UTF8Char: TUTF8Char;
@@ -1130,15 +1130,23 @@
       else
       begin
         { Handles other reasons for WM_COMMAND }
+
         if Hi(WParam) < 2 then //1 for accelerator 0 for menu
-          TargetObject := GetMenuItemObject else // menuitem or shortcut
+        begin
+          TargetObject := GetMenuItemObject
+        end
+        else // menuitem or shortcut
+        begin
           TargetObject := nil;
+        end;
+
         if TargetObject is TMenuItem then
         begin
           LMessage.Msg := LM_ACTIVATE;
           TargetObject.Dispatch(LMessage);
           lWinControl := nil;
-        end else
+        end
+         else
         begin
           lWinControl := GetWindowInfo(LParam)^.WinControl;
           // buddy controls use 'awincontrol' to designate associated wincontrol
@@ -1235,7 +1243,7 @@
           WinProcess := false;
         end;
       end;
-        
+
       if WinProcess then
       begin
         if ChildWinControl <> nil then
@@ -1478,7 +1486,7 @@
       begin
         PostMessage(Window, WM_LBUTTONDBLCLK, WParam, LParam);
       end;
-      
+
       {$ifndef win32}
       // Gesture recognition process to enable popup menus.
       if (lWinControl.PopupMenu <> nil) then
@@ -1687,6 +1695,7 @@
     WM_NOTIFY:
     begin
       WindowInfo := GetWindowInfo(PNMHdr(LParam)^.hwndFrom);
+
 {$ifdef MSG_DEBUG}
       DebugLn([MessageStackDepth, 'Notify code: ', PNMHdr(LParam)^.code]);
 {$endif}
@@ -2106,7 +2115,7 @@
       if PLMsg^.Result = 0 then
         WinProcess := true;
     end;
-    
+
     CN_CHAR, CN_SYSCHAR:
     begin
       // if key not yet processed, let windows process it
@@ -2293,17 +2302,17 @@
   {$endif}
 
   Result := 0;
- 
+
   LMessage.Result := 0;
   LMessage.Msg := LM_NULL;
 
   case Msg of
-  
+
     WM_CLOSE:
     begin
       DestroyWindow(Window);
     end;
-    
+
     WM_DESTROY :
     begin
       PostQuitMessage(0);
@@ -2370,12 +2379,3 @@
     end;
   end;
 end;
-
-
-
-
-
-
-
-
-
WinCEComboBoxOnChange.patch (6,241 bytes)   

samuel herzog

2009-02-17 14:22

developer   ~0025501

Might be in relation with report 0011914.

Paul Ishenin

2009-02-18 02:45

manager   ~0025515

I dont see any related to combobox change, but your patch was applied in r18738. I am wondering if it will fix that combobox issue but please check.

Paul Ishenin

2009-02-18 07:50

manager   ~0025522

Please test and close if ok.

haword

2009-02-18 08:08

reporter   ~0025532

Ok

Issue History

Date Modified Username Field Change
2009-02-17 12:39 haword New Issue
2009-02-17 12:39 haword File Added: WinCEComboBoxOnChange.patch
2009-02-17 12:39 haword Widgetset => WinCE
2009-02-17 14:22 samuel herzog Note Added: 0025501
2009-02-17 14:27 Vincent Snijders Relationship added related to 0011914
2009-02-18 02:45 Paul Ishenin LazTarget => post 1.2
2009-02-18 02:45 Paul Ishenin Note Added: 0025515
2009-02-18 02:45 Paul Ishenin Status new => feedback
2009-02-18 07:49 Paul Ishenin Relationship replaced has duplicate 0011914
2009-02-18 07:50 Paul Ishenin Fixed in Revision => 18742
2009-02-18 07:50 Paul Ishenin Status feedback => resolved
2009-02-18 07:50 Paul Ishenin Fixed in Version => 0.9.27 (SVN)
2009-02-18 07:50 Paul Ishenin Resolution open => fixed
2009-02-18 07:50 Paul Ishenin Assigned To => Paul Ishenin
2009-02-18 07:50 Paul Ishenin Note Added: 0025522
2009-02-18 08:08 haword Status resolved => closed
2009-02-18 08:08 haword Note Added: 0025532
2013-09-03 12:07 Martin Friebe LazTarget post 1.2 => 1.4