Actually, in the process of software development we have to trade off between coding efficiency, i. e. using one source code for multiple platforms, and the principle of minimal surprise on the respective platform.
Fortunately, Lazarus takes its principle "Write one, compile anywhere" serious: The platform-specific widget sets exonerate the developer from writing platform-specific code. However, there are a few points, where some requirements of the respective operating system have to be met. Apart from the ordering of buttons mentioned by TurboRascal this applies e. g. to menus.
As an example, on Mac OS X there is an application menu on the left which holds entries for an about box, preferences, some global OS-wide services and quitting the application. Under Windows and most Linux GUIs however, the about box is accessible from the help menu and the preferences entry often has differing locations. Additionally the modifier keys are not identical on different platforms. It is the command key (apple key) on Mac OS X and iOS, while it is the ctrl key on Windows and Linux.
How can we adapt to these restrictions and simultaneously keep one source code?
In my applications I have solved this with conditional compiling. To take an example from SimThyr, I have defined a menubar with both an application menu for the Mac (defined with the apple-logo) and a help menu for all platforms but with different entries with respect to the OS. The procedure AdaptMenus that is called early in the run of the application performs the assimilation process:
procedure AdaptMenus;
var
modifierKey: TShiftState;
begin
{$IFDEF LCLcarbon}
modifierKey := [ssMeta];
SimThyrToolbar.WinAboutItem.Visible := false;
SimThyrToolbar.Divider_5_1.Visible := false;
SimThyrToolbar.Divider_2_2.Visible := false;
SimThyrToolbar.Divider_2_2.Visible := false;
SimThyrToolbar.WinPreferencesItem.Visible := false;
SimThyrToolbar.AppleMenu.Visible := true;
{$ELSE}
modifierKey := [ssCtrl];
SimThyrToolbar.WinAboutItem.Visible := true;
SimThyrToolbar.Divider_5_1.Visible := true;
SimThyrToolbar.Divider_2_2.Visible := true;
SimThyrToolbar.WinPreferencesItem.Visible := true;
SimThyrToolbar.AppleMenu.Visible := false;
{$ENDIF}
SimThyrToolbar.NewMenuItem.ShortCut:=ShortCut(VK_N, modifierKey);
SimThyrToolbar.OpenMenuItem.ShortCut:=ShortCut(VK_O, modifierKey);
SimThyrToolbar.CloseMenuItem.ShortCut:=ShortCut(VK_W, modifierKey);
SimThyrToolbar.SaveItem.ShortCut:=ShortCut(VK_S, modifierKey);
SimThyrToolbar.QuitMenuItem.ShortCut:=ShortCut(VK_Q, modifierKey);
SimThyrToolbar.UndoMenuItem.ShortCut:=ShortCut(VK_Z, modifierKey);
SimThyrToolbar.CutMenuItem.ShortCut:=ShortCut(VK_X, modifierKey);
SimThyrToolbar.CopyMenuItem.ShortCut:=ShortCut(VK_C, modifierKey);
SimThyrToolbar.PasteMenuItem.ShortCut:=ShortCut(VK_V, modifierKey);
SimThyrToolbar.RunItem.ShortCut:=ShortCut(VK_R, modifierKey);
end;
This is a quite simple way to provide both platform-conformity and keeping one source code for all platforms.