~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to lcl/interfaces/wince/wincecallback.inc

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
begin
34
34
  Result:=false;
35
35
  if PtrUInt(Str) <= $FFFF then exit; // global atom handle
36
 
  Assert(False, 'Trace:PropEnumProc - Start');
37
 
  Assert(False, Format('Trace:PropEnumProc - Property %S (with value 0x%X) from window 0x%X removed',
38
 
    [String(Str), Data, Window]));
 
36
  //DebugLn('Trace:PropEnumProc - Start');
 
37
  //DebugLn(Format('Trace:PropEnumProc - Property %S (with value 0x%X) from window 0x%X removed',[String(Str), Data, Window]));
39
38
  RemoveProp(Window, Str);
40
39
  Result := True;
41
 
  Assert(False, 'Trace:PropEnumProc - Exit');
 
40
  //DebugLn('Trace:PropEnumProc - Exit');
42
41
end;
43
42
 
44
43
function WndClassName(Wnd: HWND): WideString; inline;
216
215
 
217
216
  function ShowHideTabPage(NotebookHandle: HWnd; Showing: boolean): integer;
218
217
  var
219
 
    NoteBook: TCustomNotebook;
 
218
    NoteBook: TCustomTabControl;
220
219
    PageIndex, Flags: Integer;
221
220
    PageHandle: HWND;
222
221
    WindowInfo: PWindowInfo;
223
222
  begin
224
 
    Notebook := GetWindowInfo(NotebookHandle)^.WinControl as TCustomNotebook;
 
223
    Notebook := GetWindowInfo(NotebookHandle)^.WinControl as TCustomTabControl;
225
224
    PageIndex := Windows.SendMessageW(NotebookHandle, TCM_GETCURSEL, 0, 0);
226
225
    PageIndex := NotebookPageRealToLCLIndex(Notebook, PageIndex);
227
226
    if PageIndex = -1 then exit;
961
960
 
962
961
 
963
962
begin
964
 
  Assert(False, 'Trace:WindowProc - Start');
 
963
  //DebugLn('Trace:WindowProc - Start');
965
964
 
966
965
  LMessage.Result := 0;
967
966
  LMessage.Msg := LM_NULL;
969
968
  WinProcess := True;
970
969
  NotifyUserInput := False;
971
970
 
972
 
  Assert(False, 'Trace:WindowProc - Getting Object with Callback Procedure');
 
971
  //DebugLn('Trace:WindowProc - Getting Object with Callback Procedure');
973
972
  WindowInfo := GetWindowInfo(Window);
974
973
 
975
974
//----------------------------------------
1035
1034
    end;
1036
1035
    WM_ACTIVATE:
1037
1036
    begin
 
1037
      LMessage.Msg := LM_ACTIVATE;
 
1038
      LMessage.WParam := WParam;
 
1039
      LMessage.LParam := LParam;
1038
1040
      case Lo(WParam) Of
1039
1041
        WA_ACTIVE, WA_CLICKACTIVE:
1040
1042
        begin
1041
 
          LMessage.Msg := LM_ACTIVATE;
1042
 
 
1043
1043
          // Upon activation of a form, rebuild it's menu
1044
1044
          if lWinControl is TCustomForm then
1045
1045
          begin
1057
1057
            end;
1058
1058
          end;
1059
1059
        end;
1060
 
        WA_INACTIVE:
1061
 
        begin
1062
 
          LMessage.Msg := LM_DEACTIVATE;
1063
 
          // Wince => maybe cast to WM_CLOSE?
1064
 
        end;
1065
1060
      end;
1066
1061
    end;
1067
1062
    WM_CAPTURECHANGED:
1080
1075
        CharCode := Word(Char(WideChar(WParam)));
1081
1076
        OrgCharCode := CharCode;
1082
1077
        Result := 0;
1083
 
        Assert(False,Format('WM_CHAR KeyData= %d CharCode= %d ',[KeyData,CharCode]));
 
1078
        //DebugLn(Format('WM_CHAR KeyData= %d CharCode= %d ',[KeyData,CharCode]));
1084
1079
      end;
1085
1080
      WinProcess := false;
1086
1081
    end
1258
1253
 
1259
1254
    WM_CREATE:
1260
1255
    begin
1261
 
      Assert(False, 'Trace:WindowProc - Got WM_CREATE');
 
1256
      //DebugLn('Trace:WindowProc - Got WM_CREATE');
1262
1257
      LMessage.Msg := LM_CREATE;
1263
1258
    end;
1264
1259
}
1305
1300
          WindowColor := ChildWinControl.Font.Color;
1306
1301
          if WindowColor = clDefault then
1307
1302
            WindowColor := ChildWinControl.GetDefaultColor(dctFont);
1308
 
          Windows.SetTextColor(HDC(WParam), Windows.COLORREF(ColorToRGB(WindowColor)));
 
1303
          Windows.SetTextColor(HDC(WParam), ColorToRGB(WindowColor));
1309
1304
          WindowColor := ChildWinControl.Brush.Color;
1310
1305
          if WindowColor = clDefault then
1311
1306
            WindowColor := ChildWinControl.GetDefaultColor(dctBrush);
1312
 
          Windows.SetBkColor(HDC(WParam), Windows.COLORREF(ColorToRGB(WindowColor)));
 
1307
          Windows.SetBkColor(HDC(WParam), ColorToRGB(WindowColor));
1313
1308
          LMessage.Result := LResult(ChildWinControl.Brush.Reference.Handle);
1314
1309
          //DebugLn(['WindowProc ', ChildWinControl.Name, ' Brush: ', LMessage.Result]);
1315
1310
          // Override default handling
1331
1326
    end;
1332
1327
    WM_DESTROY:
1333
1328
    begin
1334
 
      Assert(False, 'Trace:WindowProc - Got WM_DESTROY');
 
1329
      //DebugLn('Trace:WindowProc - Got WM_DESTROY');
1335
1330
      if lWinControl is TCheckListBox then
1336
1331
        TWinCECheckListBoxStrings.DeleteItemRecords(Window);
1337
1332
      if lWinControl is TCustomFloatSpinEdit then
1485
1480
        KeyData := LParam;
1486
1481
        CharCode := Word(WParam);
1487
1482
        Result := 0;
1488
 
        Assert(False,Format('WM_KEYDOWN KeyData= %d CharCode= %d ',[KeyData,CharCode]));
1489
 
        Assert(False,'  lWinControl= '+TComponent(lWinControl).Name+':'+lWinControl.ClassName);
 
1483
        //DebugLn(Format('WM_KEYDOWN KeyData= %d CharCode= %d ',[KeyData,CharCode]));
 
1484
        //DebugLn('  lWinControl= '+TComponent(lWinControl).Name+':'+lWinControl.ClassName);
1490
1485
      end;
1491
1486
      WinProcess := false;
1492
1487
    end;
1500
1495
        KeyData := LParam;
1501
1496
        CharCode := Word(WParam);
1502
1497
        Result := 0;
1503
 
        Assert(False,Format('WM_KEYUP KeyData= %d CharCode= %d ',[KeyData,CharCode]));
 
1498
        //DebugLn(Format('WM_KEYUP KeyData= %d CharCode= %d ',[KeyData,CharCode]));
1504
1499
      end;
1505
1500
      WinProcess := false;
1506
1501
    end;
1700
1695
          Msg := LM_MOUSEWHEEL;
1701
1696
          Button := Lo(WParam);
1702
1697
          WheelDelta := SmallInt(Hi(WParam));
1703
 
          State := GetShiftState;
 
1698
          State := KeysToShiftState(Button);
1704
1699
          UserData := Pointer(GetWindowLong(Window, GWL_USERDATA));
1705
1700
          WinProcess := false;
1706
1701
        end;
1743
1738
    WM_NCLBUTTONDOWN:
1744
1739
    begin
1745
1740
      NotifyUserInput := True;
1746
 
      Assert(False, 'Trace:WindowProc - Got WM_NCLBUTTONDOWN');
 
1741
      //DebugLn('Trace:WindowProc - Got WM_NCLBUTTONDOWN');
1747
1742
    end;
1748
1743
    WM_NOTIFY:
1749
1744
    begin
1873
1868
    end;
1874
1869
    WM_SHOWWINDOW:
1875
1870
    begin
1876
 
      Assert(False, 'Trace:WindowProc - Got WM_SHOWWINDOW');
 
1871
      //DebugLn('Trace:WindowProc - Got WM_SHOWWINDOW');
1877
1872
      with TLMShowWindow(LMessage) Do
1878
1873
      begin
1879
1874
        Msg := LM_SHOWWINDOW;
1901
1896
        KeyData := LParam;
1902
1897
        CharCode := Word(WParam);
1903
1898
        Result := 0;
1904
 
        Assert(False,Format('WM_CHAR KeyData= %d CharCode= %d ',[KeyData,CharCode]));
 
1899
        //DebugLn(Format('WM_CHAR KeyData= %d CharCode= %d ',[KeyData,CharCode]));
1905
1900
      end;
1906
1901
      WinProcess := false;
1907
1902
    end;
2088
2083
          begin
2089
2084
            lWinControl.DoAdjustClientRectChange;
2090
2085
            if (lWinControl is TCustomPage)
2091
 
            and (lWinControl.Parent is TCustomNotebook) then
 
2086
            and (lWinControl.Parent is TCustomTabControl) then
2092
2087
            begin
2093
2088
              // the TCustomPage size is the ClientRect size of the parent
2094
2089
              // => invalidate the Parent.ClientRect
2167
2162
 
2168
2163
  // application processing
2169
2164
  if NotifyUserInput then
2170
 
    NotifyApplicationUserInput(PLMsg^.Msg);
 
2165
    NotifyApplicationUserInput(lWinControl, PLMsg^.Msg);
2171
2166
 
2172
2167
  if (lWinControl <> nil) and (PLMsg^.Msg <> LM_NULL) then
2173
2168
    DeliverMessage(lWinControl, PLMsg^);
2205
2200
            if LMNotify.Result = 0 then
2206
2201
              ShowHideTabPage(HWndFrom, False);
2207
2202
          TCN_SELCHANGE:
2208
 
            NotebookFocusNewControl(GetWindowInfo(hwndFrom)^.WinControl as TCustomNotebook, idFrom);
 
2203
            NotebookFocusNewControl(GetWindowInfo(hwndFrom)^.WinControl as TCustomTabControl, idFrom);
2209
2204
        end;
2210
2205
    end;
2211
2206
 
2326
2321
  else if PLMsg = @LMMouseEvent then Result := 1
2327
2322
  else                               Result := PLMsg^.Result;
2328
2323
 
2329
 
  Assert(False, 'Trace:WindowProc - Exit');
 
2324
  //DebugLn('Trace:WindowProc - Exit');
2330
2325
end;
2331
2326
 
2332
2327
{$ifdef MSG_DEBUG}