Difference between revisions of "The LCL in various platforms"

From Free Pascal wiki
Jump to navigationJump to search
Line 34: Line 34:
 
'''Gtk'''
 
'''Gtk'''
  
Under 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 + sizable 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.
+
Under 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.
  
 
{| BORDER="1" CELLSPACING="0"
 
{| BORDER="1" CELLSPACING="0"
 +
!COLSPAN="1" STYLE="background:#ffdead;"|
 +
!COLSPAN="3" STYLE="background:#ffdead;"|'''Gtk 1'''
 +
!COLSPAN="3" STYLE="background:#ffdead;"|'''Gtk 2'''
 +
|----
 
!COLSPAN="1" STYLE="background:#ffdead;"|'''BorderStyle'''
 
!COLSPAN="1" STYLE="background:#ffdead;"|'''BorderStyle'''
 +
!COLSPAN="1" STYLE="background:#ffdead;"|'''Has Border?'''
 +
!COLSPAN="1" STYLE="background:#ffdead;"|'''Resizable?'''
 +
!COLSPAN="1" STYLE="background:#ffdead;"|'''Decoration'''
 
!COLSPAN="1" STYLE="background:#ffdead;"|'''Has Border?'''
 
!COLSPAN="1" STYLE="background:#ffdead;"|'''Has Border?'''
 
!COLSPAN="1" STYLE="background:#ffdead;"|'''Resizable?'''
 
!COLSPAN="1" STYLE="background:#ffdead;"|'''Resizable?'''
 
!COLSPAN="1" STYLE="background:#ffdead;"|'''Decoration'''
 
!COLSPAN="1" STYLE="background:#ffdead;"|'''Decoration'''
 
|----
 
|----
|bsNone||No||No||None
+
|bsNone||No||No||None||No||No||None
 
|----
 
|----
|bsDialog||Yes||Yes*||All*
+
|bsDialog||Yes||Yes*||All*||Yes||Yes*||All*
 
|----
 
|----
|bsSingle||Yes||No (If the WM allows)||All
+
|bsSingle||Yes||No (WM)||All||Yes||No (WM)||All
 
|----
 
|----
|bsSizable||Yes||Yes||All
+
|bsSizable||Yes||Yes||All||Yes||Yes||All
 
|----
 
|----
|bsSizeToolWin||Yes||Yes||All*
+
|bsSizeToolWin||Yes||Yes||All*||Yes||Yes||All*
 
|----
 
|----
|bsToolWin||Yes||No (If the WM allows)||All*
+
|bsToolWin||Yes||No (WM)||All*||Yes||No (WM)||All*
 
|}
 
|}
  
 
Values with * differ from the Windows Implementation.
 
Values with * differ from the Windows Implementation.
 +
 +
Values with (WM) indicate that the feature is Window Manager specific.
  
 
Associated bug track items: [http://bugs.freepascal.org/view.php?id=1540]
 
Associated bug track items: [http://bugs.freepascal.org/view.php?id=1540]
  
 
'''Carbon'''
 
'''Carbon'''

Revision as of 02:24, 13 April 2008

Introduction

Many LCL properties, methods and other functionality represent a concept, which is then mapped to a specific native behavior in each platform. 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.

TForm.BorderStyle

The 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. Bellow is a full list of expected behaviors:

Windows

BorderStyle Has Border? Resizable? Decoration
bsNone No No None
bsDialog Yes No Only X (Close)
bsSingle Yes No All
bsSizable Yes Yes All
bsSizeToolWin Yes Yes Only X and small title
bsToolWin Yes No Only X and small title

Windows CE

For Windows CE see here: Windows_CE_Development_Notes#Positioning_and_size_of_Dialogs_and_Forms

Gtk

Under 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.

Gtk 1 Gtk 2
BorderStyle Has Border? Resizable? Decoration Has Border? Resizable? Decoration
bsNone No No None No No None
bsDialog Yes Yes* All* Yes Yes* All*
bsSingle Yes No (WM) All Yes No (WM) All
bsSizable Yes Yes All Yes Yes All
bsSizeToolWin Yes Yes All* Yes Yes All*
bsToolWin Yes No (WM) All* Yes No (WM) All*

Values with * differ from the Windows Implementation.

Values with (WM) indicate that the feature is Window Manager specific.

Associated bug track items: [1]

Carbon