Sign in Join
Wiki copytemporary

The LCL in various platforms: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Introduction
22
33Many [[LCL]] properties, methods and other functionality represent a concept, which is then mapped to a specific native behavior in each platform in order to provide the user with a [[Introduction to platform-sensitive development|platform-sensitive environment]]. This sections aims at clarifying LCL behavior which changes across platforms by clarifying what is to be expected in each platform so that more reliable software can be built.
44
55## Linker options
66
77The LCL passes various linker options depending on platform. Here is the conditionals script from the LCL:
88
99``` pascal
1010// linker options
1111if TargetOS='darwin' then begin
1212 if LCLWidgetType='gtk' then
1313 UsageLibraryPath := '/usr/X11R6/lib;/sw/lib'
1414 else if LCLWidgetType='gtk2' then
1515 UsageLibraryPath := '/usr/X11R6/lib;/sw/lib;/sw/lib/pango-ft219/lib'
1616 else if LCLWidgetType='carbon' then begin
1717 UsageLinkerOptions := '-framework Carbon'
1818 +' -framework OpenGL'
1919 +' ''-dylib_file'' ''/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib''';
2020 end else if LCLWidgetType='cocoa' then
2121 UsageLinkerOptions := '-framework Cocoa';
2222end else if TargetOS='solaris' then begin
2323 UsageLibraryPath:='/usr/X11R6/lib';
2424end;
2525```
2626
2727## TForm.BorderStyle
2828
2929The BorderStyle of a Form represents a kind of form, and different platforms have different standards about how should the border of each kind of form be, and the LCL respects that. For example, message dialogs are usually not resizable under Windows, but resizable under X11-based Unixes. By using bsDialog it is possible to create a form which will have the adequate dialog appearance in every platform. Below is a full list of expected behaviors:
3030
3131**Windows**
3232
3333| BorderStyle | Has Border? | Resizable? | Decoration |
3434|---------------|-------------|------------|------------------------|
3535| bsNone | No | No | None |
3636| bsDialog | Yes | No | Only X (Close) |
3737| bsSingle | Yes | No | All |
3838| bsSizable | Yes | Yes | All |
3939| bsSizeToolWin | Yes | Yes | Only X and small title |
4040| bsToolWin | Yes | No | Only X and small title |
4141
4242**Windows CE**
4343
4444For Windows CE see here: [[Windows CE Development Notes|Positioning and size of Dialogs and Forms]]
4545
4646**Gtk**
4747
4848Under Gtk on X11 the best one can do is ask the window manager to set a certain style, and it may ignore our request, so nothing, except sizable border vs. no border at all is guaranteed. i.e. only bsSizable and bsNone have a guaranteed behavior and the other ones will be either somewhere in between or equal to bsSizable.
4949
50-<thead>
51-
52-</thead>
53-<tbody>
54-
55-</tbody>
50+| | Gtk 1 | | | Gtk 2''' | | |
51+|---|---|---|---|---|---|---|
52+| BorderStyle | Has Border? | Resizable? | Decoration | Has Border? | Resizable? | Decoration |
53+| bsNone | No | No | None | No | No | None |
54+| bsDialog | Yes | Yes* | All* | Yes | Yes* | All* |
55+| bsSingle | Yes | No (WM) | All | Yes | No (WM) | All |
56+| bsSizable | Yes | Yes | All | Yes | Yes | All |
57+| bsSizeToolWin | Yes | Yes | All* | Yes | Yes | All* |
58+| bsToolWin | Yes | No (WM) | All* | Yes | No (WM) | All* |
5659
5760Values with * differ from the Windows Implementation.
5861
5962Values with (WM) indicate that the feature is Window Manager specific.
6063
6164Associated bug track items: [1](http://bugs.freepascal.org/view.php?id=1540)
6265
6366**macOS**
6467
65-<thead>
66-
67-</thead>
68-<tbody>
69-
70-</tbody>
68+| | Carbon | | | Cocoa1''' | | |
69+|---|---|---|---|---|---|---|
70+| BorderStyle | Has Border? | Resizable? | Decoration | Has Border? | Resizable? | Decoration |
71+| bsNone | No | No | None | Yes | Yes | All |
72+| bsDialog | Yes | No | All | Yes | Yes | All |
73+| bsSingle | Yes | No | All | Yes | Yes | All |
74+| bsSizable | Yes | Yes | All | Yes | Yes | All |
75+| bsSizeToolWin | Yes | Yes | All | Yes | Yes | All |
76+| bsToolWin | Yes | No | All | Yes | Yes | All |
7177
7278<sup>1</sup>Note: The Cocoa widgetset is still in development. Details of implementation may change, as well as adherence to GUI guidelines.
7379
7480## Shortcut Keys
7581
7682Some Key sequences cannot be used by the Application in some platforms because the Operating System or Windows Manager is already using them. Below is a list for each platform.
7783
7884#### macOS
7985
8086You should refer to Apple [*Human Interface Guidelines*](https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/keyboard/) for system reserved shortcuts.
8187
8288| Key Sequence | Alternative | Description |
8389|----|----|----|
8490| `F8` / `Shift`+`F8` | ? | F8 activates Spaces |
8591| `F9` / `Shift`+`F9` | ? | F9 shows all windows in Exposé |
8692| `F10` / `Shift`+`F10` | ? | F10 shows all windows of the current program |
8793| `F11` / `Shift`+`F11` | ? | F11 shows the Desktop |
8894| `F12` / `Shift`+`F12` | ? | F12 activates the Dashboard |
8995
9096#### Windows
9197
9298| Key Sequence | Alternative | Description |
9399|--------------|-------------|---------------------------------------------|
94100| `F1` | ? | F1 invokes the program-specific help system |
95101
96102## Popup Menus
97103
98104Normally the popup menus are the items in the TPopupMenu assigned to the PopupMenu property.
99105
100106**GTK** (1+2)
101107
102108The GTK automatically adds to the TNoteBook and TPageControl headers for each page a menu item to quick jump to the page.
103109
104110**GTK2**
105111
106112The GTK2 automatically adds to all edit controls like TEdit and TComboBox unicode and accessibility items.
107113
108114## Command line parameters
109115
110116Some widgetsets parse the [[Command line parameters and environment variables|command line parameters]] and react to some parameters.
111117
112118**GTK**
113119
114120- --gtk-module
115121- --g-fatal-warnings
116122- --gtk-debug
117123- --gtk-no-debug
118124- --gdk-debug
119125- --gdk-no-debug
120126- --display
121127- --sync
122128- --no-xshm
123129- --name
124130- --class
125131
126132---
127133*From the Free Pascal wiki, page "The LCL in various platforms", as it stood on 2020-06-17 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
128134Category: LCL
129135Category: Platform-sensitive development

Back to history