View Issue Details

IDProjectCategoryView StatusLast Update
0034093LazarusWidgetsetpublic2018-10-25 06:50
ReporterLacaKAssigned ToLacaK 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWinCEOSWinCEOS Version
Product Version1.8.5 (SVN)Product Build 
Target VersionFixed in Version2.0.1 (SVN) 
Summary0034093: Minimize and Maximize buttons are not shown in titlebar (WinCE)
DescriptionAs stated in summary.
Additional InformationPatch is inspired by Win32 widgetset.
Tagswince
Fixed in Revision59334, 59336
LazTarget-
WidgetsetWinCE
Attached Files
  • wincewsforms.pp.patch (1,263 bytes)
    Index: lcl/interfaces/wince/wincewsforms.pp
    ===================================================================
    --- lcl/interfaces/wince/wincewsforms.pp	(revision 58680)
    +++ lcl/interfaces/wince/wincewsforms.pp	(working copy)
    @@ -147,6 +147,14 @@
     
     { TWinCEWSCustomForm }
     
    +function GetDesigningBorderStyle(const AForm: TCustomForm): TFormBorderStyle;
    +begin
    +  if csDesigning in AForm.ComponentState then
    +    Result := bsSizeable
    +  else
    +    Result := AForm.BorderStyle;
    +end;
    +
     class function TWinCEWSCustomForm.CalcBorderIconsFlags(const AForm: TCustomForm): dword;
     var
       BorderIcons: TBorderIcons;
    @@ -153,14 +161,14 @@
     begin
       Result := 0;
       BorderIcons := AForm.BorderIcons;
    -  if biSystemMenu in BorderIcons then
    +  if (biSystemMenu in BorderIcons) or (csDesigning in AForm.ComponentState) then
         Result := Result or WS_SYSMENU;
    -  if AForm.BorderStyle in [bsNone, bsSingle, bsSizeable] then
    +  if GetDesigningBorderStyle(AForm) in [bsNone, bsSingle, bsSizeable] then
       begin
         if biMinimize in BorderIcons then
    -      Result := Result or WS_MINIMIZE;
    +      Result := Result or WS_MINIMIZEBOX;
         if biMaximize in BorderIcons then
    -      Result := Result or WS_MAXIMIZE;
    +      Result := Result or WS_MAXIMIZEBOX;
       end;
     end;
     
    
    wincewsforms.pp.patch (1,263 bytes)

Activities

LacaK

2018-08-06 10:27

developer  

wincewsforms.pp.patch (1,263 bytes)
Index: lcl/interfaces/wince/wincewsforms.pp
===================================================================
--- lcl/interfaces/wince/wincewsforms.pp	(revision 58680)
+++ lcl/interfaces/wince/wincewsforms.pp	(working copy)
@@ -147,6 +147,14 @@
 
 { TWinCEWSCustomForm }
 
+function GetDesigningBorderStyle(const AForm: TCustomForm): TFormBorderStyle;
+begin
+  if csDesigning in AForm.ComponentState then
+    Result := bsSizeable
+  else
+    Result := AForm.BorderStyle;
+end;
+
 class function TWinCEWSCustomForm.CalcBorderIconsFlags(const AForm: TCustomForm): dword;
 var
   BorderIcons: TBorderIcons;
@@ -153,14 +161,14 @@
 begin
   Result := 0;
   BorderIcons := AForm.BorderIcons;
-  if biSystemMenu in BorderIcons then
+  if (biSystemMenu in BorderIcons) or (csDesigning in AForm.ComponentState) then
     Result := Result or WS_SYSMENU;
-  if AForm.BorderStyle in [bsNone, bsSingle, bsSizeable] then
+  if GetDesigningBorderStyle(AForm) in [bsNone, bsSingle, bsSizeable] then
   begin
     if biMinimize in BorderIcons then
-      Result := Result or WS_MINIMIZE;
+      Result := Result or WS_MINIMIZEBOX;
     if biMaximize in BorderIcons then
-      Result := Result or WS_MAXIMIZE;
+      Result := Result or WS_MAXIMIZEBOX;
   end;
 end;
 
wincewsforms.pp.patch (1,263 bytes)

LacaK

2018-10-22 09:40

developer   ~0111510

Last edited: 2018-10-22 10:03

View 2 revisions

I have applied patch (rev. 59334), but I noticed strange behavior on my device with WinCE 6: MINIMIZEBOX and MAXIMIZEBOX are exchanged. When I set BorderIcons = biMinimize then maximize button is shown in title bar and vice versa. When I use DWORD($10000) for biMinimze and DWORD($20000) for biMaximize then it works as expected, but it is exchanged compared to Win32

Later I noticed, that WS_MINIMIZEBOX and WS_MAXIMIZEBOX are defined differently in RTL windows header files for Win32 and WinCE, so I switched to Windows unit instead of LCLTypes unit. (rev. 59336)

Issue History

Date Modified Username Field Change
2018-08-06 10:27 LacaK New Issue
2018-08-06 10:27 LacaK File Added: wincewsforms.pp.patch
2018-08-06 18:59 Bart Broersma LazTarget => -
2018-08-06 18:59 Bart Broersma Summary Minimize nad Maximize buttons are not shown in titlebar (WinCE) => Minimize and Maximize buttons are not shown in titlebar (WinCE)
2018-08-07 17:52 Stephano Assigned To => Stephano
2018-08-07 17:52 Stephano Status new => assigned
2018-08-31 07:10 LacaK Tag Attached: wince
2018-10-22 09:40 LacaK Note Added: 0111510
2018-10-22 10:03 LacaK Note Edited: 0111510 View Revisions
2018-10-25 06:49 LacaK Fixed in Revision => 59334, 59336
2018-10-25 06:49 LacaK Status assigned => resolved
2018-10-25 06:49 LacaK Fixed in Version => 2.0.1 (SVN)
2018-10-25 06:49 LacaK Resolution open => fixed
2018-10-25 06:49 LacaK Assigned To Stephano => LacaK
2018-10-25 06:50 LacaK Status resolved => closed