mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-16 03:56:23 +02:00
parent
e96aee5bab
commit
6e88a7c284
@ -4701,8 +4701,7 @@ var
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
{$ifdef DEBUG_WINDOW_ORG}
|
{$ifdef DEBUG_WINDOW_ORG}
|
||||||
DbgAppendToFile(ExtractFilePath(ParamStr(0)) + '1.log',
|
DebugLn(':> [TWinControl.PaintControls] A');
|
||||||
':> [TWinControl.PaintControls] A');
|
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
//DebugLn('[TWinControl.PaintControls] ',Name,':',ClassName,' DC=',DbgS(DC,8));
|
//DebugLn('[TWinControl.PaintControls] ',Name,':',ClassName,' DC=',DbgS(DC,8));
|
||||||
@ -4720,8 +4719,7 @@ begin
|
|||||||
if FControls <> nil then
|
if FControls <> nil then
|
||||||
begin
|
begin
|
||||||
{$ifdef DEBUG_WINDOW_ORG}
|
{$ifdef DEBUG_WINDOW_ORG}
|
||||||
DbgAppendToFile(ExtractFilePath(ParamStr(0)) + '1.log',
|
DebugLn(':> [TWinControl.PaintControls] B');
|
||||||
':> [TWinControl.PaintControls] B');
|
|
||||||
{$endif}
|
{$endif}
|
||||||
I := 0;
|
I := 0;
|
||||||
if First <> nil then
|
if First <> nil then
|
||||||
@ -4734,7 +4732,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
TempControl := TControl(FControls.Items[I]);
|
TempControl := TControl(FControls.Items[I]);
|
||||||
{$ifdef DEBUG_WINDOW_ORG}
|
{$ifdef DEBUG_WINDOW_ORG}
|
||||||
DbgAppendToFile(ExtractFilePath(ParamStr(0)) + '1.log',
|
DebugLn(
|
||||||
Format(':> [TWinControl.PaintControls] C DC=%d TempControl=%s Left=%d Top=%d Width=%d Height=%d',
|
Format(':> [TWinControl.PaintControls] C DC=%d TempControl=%s Left=%d Top=%d Width=%d Height=%d',
|
||||||
[DC, TempControl.Name, TempControl.Left, TempControl.Top, TempControl.Width, TempControl.Height]));
|
[DC, TempControl.Name, TempControl.Left, TempControl.Top, TempControl.Width, TempControl.Height]));
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -4749,7 +4747,7 @@ begin
|
|||||||
SaveIndex := SaveDC(DC);
|
SaveIndex := SaveDC(DC);
|
||||||
|
|
||||||
{$ifdef DEBUG_WINDOW_ORG}
|
{$ifdef DEBUG_WINDOW_ORG}
|
||||||
DbgAppendToFile(ExtractFilePath(ParamStr(0)) + '1.log',
|
DebugLn(
|
||||||
Format(':> [TWinControl.PaintControls] Control=%s Left=%d Top=%d Width=%d Height=%d',
|
Format(':> [TWinControl.PaintControls] Control=%s Left=%d Top=%d Width=%d Height=%d',
|
||||||
[Self.Name, Left, Top, Width, Height]));
|
[Self.Name, Left, Top, Width, Height]));
|
||||||
{$endif}
|
{$endif}
|
||||||
|
@ -1024,7 +1024,21 @@ begin
|
|||||||
case Lo(WParam) Of
|
case Lo(WParam) Of
|
||||||
WA_ACTIVE, WA_CLICKACTIVE:
|
WA_ACTIVE, WA_CLICKACTIVE:
|
||||||
begin
|
begin
|
||||||
LMessage.Msg := LM_ACTIVATE
|
LMessage.Msg := LM_ACTIVATE;
|
||||||
|
|
||||||
|
// Upon activation of a form, rebuild it's menu
|
||||||
|
if lWinControl is TCustomForm then
|
||||||
|
begin
|
||||||
|
if (lWinControl as TCustomForm).Menu <> nil then
|
||||||
|
begin
|
||||||
|
TWinCEWidgetset(Widgetset).SetMenu(lWinControl.Handle,
|
||||||
|
(lWinControl as TCustomForm).Menu.Handle);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
TWinCEWidgetset(Widgetset).SetMenu(lWinControl.Handle, 0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
WA_INACTIVE:
|
WA_INACTIVE:
|
||||||
begin
|
begin
|
||||||
|
@ -2933,9 +2933,15 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
for i := 0 to WinCEWSMenus.MenuHandleList.Count - 1 do
|
|
||||||
if WinCEWSMenus.MenuHandleList.Items[i] = Pointer(AMenuHandle) then Break;
|
if AMenuHandle = 0 then
|
||||||
lLCLMenu := TMenu(MenuLCLObjectList.Items[i]);
|
lLCLMenu := nil
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
for i := 0 to WinCEWSMenus.MenuHandleList.Count - 1 do
|
||||||
|
if WinCEWSMenus.MenuHandleList.Items[i] = Pointer(AMenuHandle) then Break;
|
||||||
|
lLCLMenu := TMenu(MenuLCLObjectList.Items[i]);
|
||||||
|
end;
|
||||||
|
|
||||||
CeSetMenu(AWindowHandle, AMenuHandle, lLCLMenu);
|
CeSetMenu(AWindowHandle, AMenuHandle, lLCLMenu);
|
||||||
AddToChangedMenus(AWindowHandle);
|
AddToChangedMenus(AWindowHandle);
|
||||||
|
@ -461,7 +461,7 @@ var
|
|||||||
begin
|
begin
|
||||||
TWinCEWSWinControl.ShowHide(AWinControl);
|
TWinCEWSWinControl.ShowHide(AWinControl);
|
||||||
|
|
||||||
// In atPDA mode, if there is no menu installed, we need to remove
|
// In atKeyPadDevice mode, if there is no menu installed, we need to remove
|
||||||
// the menu of the previously focused application, otherwise it will
|
// the menu of the previously focused application, otherwise it will
|
||||||
// remain visible
|
// remain visible
|
||||||
if (Application.ApplicationType = atKeyPadDevice) and
|
if (Application.ApplicationType = atKeyPadDevice) and
|
||||||
|
@ -138,6 +138,7 @@ var
|
|||||||
tbbi: TBBUTTONINFO;
|
tbbi: TBBUTTONINFO;
|
||||||
i, j, k, lIndex: integer;
|
i, j, k, lIndex: integer;
|
||||||
buf: array[0..255] of WideChar;
|
buf: array[0..255] of WideChar;
|
||||||
|
wbuf: widestring;
|
||||||
R, BR, WR: TRect;
|
R, BR, WR: TRect;
|
||||||
LeftMenuCount: Integer = -1;
|
LeftMenuCount: Integer = -1;
|
||||||
RightMenuCount: Integer = -1;
|
RightMenuCount: Integer = -1;
|
||||||
@ -324,7 +325,11 @@ begin
|
|||||||
|
|
||||||
// Remove any present buttons, for example the one from the .rc file
|
// Remove any present buttons, for example the one from the .rc file
|
||||||
// Careful that using TB_DELETEBUTTON doesnt work here
|
// Careful that using TB_DELETEBUTTON doesnt work here
|
||||||
while RemoveMenu(HMENU(tbbi.lParam), 0, MF_BYPOSITION) do DebugLn('[CeSetMenu] RemoveMenu');
|
while RemoveMenu(HMENU(tbbi.lParam), 0, MF_BYPOSITION) do
|
||||||
|
{$ifdef VerboseWinCEMenu}
|
||||||
|
DebugLn('[CeSetMenu] RemoveMenu')
|
||||||
|
{$endif}
|
||||||
|
;
|
||||||
|
|
||||||
{$ifdef VerboseWinCEMenu}
|
{$ifdef VerboseWinCEMenu}
|
||||||
DebugLn(Format('[CeSetMenu] Installing %d Subitems', [LCLMenu.Items.Items[j].Count]));
|
DebugLn(Format('[CeSetMenu] Installing %d Subitems', [LCLMenu.Items.Items[j].Count]));
|
||||||
@ -386,7 +391,12 @@ begin
|
|||||||
// Update the MenuItem Command to use latter
|
// Update the MenuItem Command to use latter
|
||||||
TMenuItemAccess(LCLMenu.Items.Items[j]).FCommand := mi.wID;
|
TMenuItemAccess(LCLMenu.Items.Items[j]).FCommand := mi.wID;
|
||||||
|
|
||||||
buf[mi.cch]:=#0;
|
// Setting the caption
|
||||||
|
// old code: buf[mi.cch]:=#0;
|
||||||
|
wbuf := UTF8Decode(LCLMenu.Items.Items[j].Caption);
|
||||||
|
buf := wbuf;
|
||||||
|
buf[Length(wbuf)] := #0;
|
||||||
|
|
||||||
FillChar(tb, SizeOf(tb), 0);
|
FillChar(tb, SizeOf(tb), 0);
|
||||||
tb.iBitmap:=I_IMAGENONE;
|
tb.iBitmap:=I_IMAGENONE;
|
||||||
tb.idCommand := mi.wID;
|
tb.idCommand := mi.wID;
|
||||||
|
@ -359,6 +359,8 @@ implementation
|
|||||||
|
|
||||||
uses gettext;
|
uses gettext;
|
||||||
|
|
||||||
|
const
|
||||||
|
Str_LCL_Debug_File = 'lcldebug.log';
|
||||||
|
|
||||||
var
|
var
|
||||||
InterfaceInitializationHandlers: TFPList = nil;
|
InterfaceInitializationHandlers: TFPList = nil;
|
||||||
@ -2151,7 +2153,7 @@ end;
|
|||||||
procedure DebugLn(const s: string);
|
procedure DebugLn(const s: string);
|
||||||
begin
|
begin
|
||||||
{$ifdef WinCE}
|
{$ifdef WinCE}
|
||||||
DbgAppendToFile(ExtractFilePath(ParamStr(0)) + '1.log', s);
|
DbgAppendToFile(ExtractFilePath(ParamStr(0)) + Str_LCL_Debug_File, s);
|
||||||
{$else}
|
{$else}
|
||||||
if not Assigned(DebugText) then exit;
|
if not Assigned(DebugText) then exit;
|
||||||
writeln(DebugText^, ConvertLineEndings(s));
|
writeln(DebugText^, ConvertLineEndings(s));
|
||||||
@ -2273,7 +2275,7 @@ end;
|
|||||||
procedure DBGOut(const s: string);
|
procedure DBGOut(const s: string);
|
||||||
begin
|
begin
|
||||||
{$ifdef WinCE}
|
{$ifdef WinCE}
|
||||||
DbgAppendToFileWithoutLn(ExtractFilePath(ParamStr(0)) + '1.log', s);
|
DbgAppendToFileWithoutLn(ExtractFilePath(ParamStr(0)) + Str_LCL_Debug_File, s);
|
||||||
{$else}
|
{$else}
|
||||||
if Assigned(DebugText) then
|
if Assigned(DebugText) then
|
||||||
write(DebugText^, s);
|
write(DebugText^, s);
|
||||||
|
Loading…
Reference in New Issue
Block a user