X11-Mode FORM Objects - INTRODUCTION
Updated: Aug 27, 2008

HotBasic Linux provides two modes for $APPTYPE GUI:  GTK-mode (present default)
and X11-mode, invoked by use of the compiler -X switch or $X11 directive.

$APPTYPE GUI in X11-Mode uses libX11.so.6, which behaves roughly similar to 
Microsoft Windows concepts, minus default event processing which HotBasic Linux
adds.

Several downloads such as hbx11gui.zip show source code examples.  As X11-Mode
further develops more demo downloads showing new features will be added, and
may provide the best tool to see working code syntax to construct your own
applications.

For Windows-Linux cross-platform applications, in many respects, X11-Mode may
provide more similarity concerning familiar coding techniques.  For example,
hbLoop procedures and registering new classes are supported.  Internal variables
hWnd, uMsg, wParam and lParam are defined on entry to event procedures.
Essentially all supported event types work for all object types.

Form Object Comments:
~~~~~~~~~~~~~~~~~~~~
FORM
Unlike Windows, FORM .Height and .ClientHeight are equal and .Width and
.ClientWidth are equal.

BUTTON

CANVAS

CHECKBOX

COMBOBOX

DATETIME

EDIT
Selecting text with mouse not yet supported.

FILELISTBOX
Alias for LISTBOX

GAUGE

GRID

GROUPBOX

HEADER

IMAGE

LABEL

LISTBOX

LISTVIEW

PANEL

RADIOBUTTON

RICHEDIT
Multi-line editing not yet supported.

RICHEDIT2
Unlike Windows, alias for RICHEDIT

SCROLLBAR

SPLASH

STATUSBAR

TABCONTROL

TOOLBAR

TRACKBAR

TREEVIEW

UPDOWN
In X11-mode, scrolls text list; in GTK-mode, behaves as a GtkAdjustment.


Constants
~~~~~~~~~
'HotBasic FORM object type offsets
'$DEFINE fExStyle 0  'used for FORM .Container handle in GTK-mode
$DEFINE fClass 4
$DEFINE fCaption 8
$DEFINE fStyle 12
$DEFINE fLeft 16
$DEFINE fTop 20
$DEFINE fWidth 24
$DEFINE fHeight 28
$DEFINE fParent 32
$DEFINE fID 36
$DEFINE fHandle 40
$DEFINE fIcon 44
$DEFINE fBmp 48
$DEFINE fFont 52
$DEFINE fStatus 56
$DEFINE fMenu 60
$DEFINE fColor 64
$DEFINE fTextColor 68

'for objects with text content
$DEFINE fStart 44  'selstart/caret
$DEFINE fEnd 48    'selend
$DEFINE fList 56   'address of bound LIST object

'for objects with .Position property
$DEFINE fPos 44    'current position
$DEFINE fMax 48    'maximum position
$DEFINE fPage 56   'page size
$DEFINE fStep 60   'step size

'FORM object .Style bits
$DEFINE BS_CHECKED 4000h    'unique to HotBasic
$DEFINE WS_HSCROLL 100000h
$DEFINE WS_VSCROLL 200000h
$DEFINE WS_DLGFRAME 400000h
$DEFINE WS_BORDER 800000h
$DEFINE WS_DISABLED 8000000h 
$DEFINE WS_VISIBLE 10000000h

To create new themes for X11-mode, constants like those above are needed.
E.g., to draw an XP-sytle scrollbar in a custom OnPaint routine, the .Position
property constants provide access to essential values.


Copyright 2007-2008 James J Keene PhD
Original Publication: Nov 27, 2007
