Patch for Add BidiMode to Win32 widget for StdCtrls and Menus
Original Reporter info from Mantis: zaher
-
Reporter name: Zaher Dirkey
Original Reporter info from Mantis: zaher
- Reporter name: Zaher Dirkey
Description:
Move changing FlagsEx from whale Win32wsButtons.pp and Win32wsStdCtrls.pp to function PrepareCreateWindow in win32wsControls.pp
Move SetBidiMode for all control and use TWin32WSWinControl.SetBidiMode for all controls (Delphi make this also)
Add 2 procedures in win32wsControls.pp (SetStdBiDiModeParams, UpdateStdBiDiModeFlags)
Add 1 procedure in win32proc.pp (SetMenuFlag)
in WedGetSet
Added procedure to WSMenus
class procedure TWSMenuClass.BiDiModeChanged(const AMenu: TMenu); virtual;
By that we finish (TForm, TButton, TEdit, TListBox, TComboBox, TCheckBox, TStaticText, TGroupBox, TRadioButton,
TMainMenu, TPopupMenu) for Win32
Menus still need modify DrawMenuItem function i will do it in next patch with TLabel, TPanel
Additional information:
I like to make some discusses about this way to send notification to all comoponent in the form for ParentBidiMode
in customform.inc
procedure TCustomForm.CMBiDiModeChanged(var Message: TLMessage);
var
i:Integer;
lMessage:TLMessage;
begin
inherited;
//send CM_PARENTBIDIMODECHANGED to All Component owned by Form
{ prefer use IMenu and check it then call IMenu.ParentBidiMode
This way is usefull for other TMenu components that need BidiMode of form changed
Like as TToolbar }
lMessage.msg := CM_PARENTBIDIMODECHANGED;
lMessage.wParam := 0;
lMessage.lParam := 0;
lMessage.Result := 0;
for i := 0 to ComponentCount - 1 do
begin
if not (Components[i] is TCustomControl) then//TCustomControl already has this notification
Components[i].Dispatch(lMessage);
//the old way
// if Components[i] is TMenu then
// TMenu(Components[i]).ParentBiDiModeChanged;
end;
end;