November 2015
=============
TOUCH and TABLET support:
=========================
With Windows 10 it is possible to run the same Win32 application om Desktop,
Tablet and phone. Time has come to take advantage of the new features. While it
may be very difficult to think of a large data intensive application to run on
tablet and phone, we may find it appropriate to provide some applications to run
on different systems. We may also need to keep in mind that a desktop may suddenly
become a tablet, eg. convertible laptops. These recent changes provide us with
great opportunties as well as pose some challenges, not difficult to overcome.
In the legacy desktop applications, the environment at the start of the program
continues for the life of the application execution. Now the application should
recognize changes and respond to them by adjusting the GUI promptly, providing
the most comfortable user experience on every device. FWH has commenced its efforts
to support the endeavours of our programmers in this direction.
Environment that can be static / dynamic:
1) Nontouch screen with mouse support
2) Touch screen with phyisical mouse support
3) Touch screen without phyical mouse
4) Desktop mode vs Tablet mode (switching by the user)
5) Change in screen resolution, Portrait / Langscape
6) Physical size of screen ( desktop vs. small tablet / phone)
New functions Provided:
-----------------------
FW_IsTouchScreen()
FW_IsMousePresent()
FW_IsTabletMode() // This can be switched on any device. In tablet mode
the UI needs to be similar to Universal Apps.
Switch also changes main window size.
GetAutoRotationState()
AutoRotationPref()
IsEventByTouch() // to decide if a click,etc is by mouse or tap
ScreenWidthMM() // We need to know physical size of screen also
ScreenHeightMM() // in addition to the resolution
Modified:
METHOD LButtonDown( nRow, nCol, nFlags, lTouch ): 4th parameter lTouch
is new and indicates if it is physical mouse action or tap by finger
Eval( ::bLClicked, nRow, nCol, Self, lTouch ) is now provided with additional
parameter lTouch.
New Events provided by Event Handler
-------------------------------------
1) OnDisplayChange( nBitsPerPixel, nWidth, nHeight )
This event executes bOnDisplayChange codeblock if specified with the
same parameters.
This event occurs most frequently when Protrait/Landscape is changed or any
change in the display monitor.
By default the OS re-orients any maximized windows (including MDI) to fit the
new dimensions. In addition the programmer needs to adjust the display
of dialogs, sizes, rearrange controls, etc.
2) OnSettingChange( nWParam, nLParam )
This event executes bOnSettingChange codeblock if specified with the
same parameters.
While this event occurs on any change in the settings, the most common change
we need to consider is switch between TabletMode and Desktop mode either by
user choice or by docking/undocking a convertible.
3) HandleGesure( nGesture, nLParam )
This event executes bHandleGesture if specified, with the same parameters.
This event is triggered by a touch gesture like zoom, pan, rotation, etc.
Due to the way the existing code works for mouse-events at times not all
the gestures may be captured by this handler. Nonetheless, this is
very useful for enhancing the touch responsiveness of an application.
For example usage, please refer to the override methods in xbrowse.prg and
scrlpanel.prg.
Touch friendly Scrolling
------------------------
It is a bit uncomfortable to the user to scroll controls like browses on tablet
or touchscreen with finger on the scrollbars. It is far more comfortable to scroll
by panning with finger anywhere over the client area of the control.
Now the following controls support touch scrolling:
TMultiGet (by OS by default )
TEdit multiline mode (by OS by default )
XBrowse (by FWH 15.11)
ScrollPanel (by FWH 15.11)
Recommended that using controls on ScrollPanel is a good way of handling
input screens on screens of different sizes
TXImage (by FWH since beginning)
Note: This control provides zoom/unzoom by zoom/pinch touch gestures
Optional Touch friendly features:
---------------------------------
* New setting: FW_TouchFriendly( lOnOff ) --> lPrevSetting
FWH proposes to offer a set of touch friendly features if this
setting is ON.
We know by experience that when we run a win32 program on a Tablet, it
is tortuously difficult to select an item from combobox/ listbox/ menu
with tap of a finger. In this version when some controls are invoked by
the user by touch, the items are displayed separated by adequate space
for comfortable selection by the user. This space is calculated for each
device separately depending on the physical dimensions ( 6 millimetres ).
When the same control is invoked by physical mouse click or by keyboard
action, the items are diaplayed with standard spacing.
1) Combobox
2) ListBox (not xbrowse EDIT_LISTBOX yet)
3) Dropdown menu items (some more fine tuning needed)
Samples:
1) fwh\samples\w10mode.prg: Simple and to the point example of
the kind of events neeed to responded to during runtime.
2) fwh\samples\testscrlp.prg: Demonstrates convenience of
using scroll panel for input of large data. Based on TDataRow
class modified to suit device portability. The ease of scrolling
the controls and gets with touch, adaptation to rotation of
the device, repositioning of gets when touch keyboard pops up
are to be noticed. New program code in datarow.prg for device
portability is recommended for study.
3) fwh\samples\testxbr3.prg: This program was originally designed
as an MDI desktop application. Running such an application on
a tablet would be very uncofortable. Now, using the support of
new FWH libs and with a few modifications, this program is made
to work seamlessly on desktop and tablet with full user comfort.
Features to be noticed are touch friendliness in scrolling browses,
menu spacing, handling rotation, dataentry screens, adjustment
of focused Gets when touch keyboard popsup, etc. Changes in the
program are recommended for study. This program is meant to
demonstrate migration of existing software for working on both
desktops and tablets.
4) A simple one line program 'XBROWSER "CUSTOMER.DBF" FASTEDIT' may
be tried both on desktop and a tablet to test the inbuilt
capabilities of the present FWH version.
Note: All tests are conducted on Windows 10 tablets and touch sceen
PCs and use Windows 10 features.
Future Directions
-----------------
It is the endeavor of FWH to provide as much support as possible to help our
programmers to deliver suitable applications that work seamlessly on Desktops,
tablets, convertibles and phones with as smooth user experience as possible.
FWH welcomes comments on the features so far provided and propose more features
to be implemented in future to achieve this objective.
CONTROLS with Windows 10 look
------------------------------
1) TSwitch new style OVALSTYLE
2) TSlider new style SLIMSTYLE
APPLICATION FOCUS
-------------------
- New CLASS DATA of TWindow class: bAppFocus
While bGotFocus and bLostFocus apply to individual windows, bAppFocus
applies to the entire application. If assigned, this codeblock is evaluated
whenever the appliation loses focus and gains focus to/from other applications.
Usage:
TWindow():bAppFocus := { |lGotFocus, oWnd| OnAppFocus( lGotFocus, oWnd ) }
This assignment may be made at the very beginning of the Main() function.
lGotFocus : True when the application gets focus and False when loses focus.
oWnd: Window/control of the application having focus before the application
lost focus and the window/control which received focus when got focus.
It is advised that no screen I/O may be performed while executing the codeblock.
XBROWSE:
1) It is now possible to paint a row across some or all columns
using new DATA oBrw:bPaintRow
Usage:
oBrw:bPaintRow := { |oBrw, nRow, nCol, nHeight, lHilite, lSelected, nScreenRow | ;
MyPaintRow( oBrw, nRow, nCol, nHeight, lHilite, lSelected, nScreenRow )
This codeblock is called before painting each row. Programmer can choose to
paint the entire row or part of the row and return .f. to inform xbrowse not
to paint the row and otherwise just return .t. to indicate xbrowse to paint all
columns of the row in normal manner.
Sample will be posted in the forums.
2) Enabled vertical scrolling with pan gesture ( keep finger anywhere on the browse
and pan up and down ) on touch screens. This is far more convevinent way than
using scrollbar with touch.
3) Fix: Method SetBackGround(). When used in the command creating the xbrowse,
the header calculations are being skipped resulting in incorrect painting. Fixed
4) Fix: XBrowse: Though oCol:cEditPicture can be a codeblock, some old code
in some methods was treating this data as character value resulting in
runtime errors. Fixed.
5) ToExcel(). This method depends on ExcelTranslate( cFormula ) in olefuncs.prg
to translate the formulas exported suitable to different language installations
of Excel. While this function is handling ListSepartors properly in non-English
installations, ignoring change of delimiters in English installations. This
is resulting in run-time error in some cases. Fixed.
TCBROWSE:
- Enabled Unicode support.
GET with XBrowse Support:
- New: function PopupBrowse( aValuesOrRecordset, oGet, bInit ). Use it this way:
REDEFINE GET oGet VAR ... ;
ID ... OF oDlg ACTION PopupBrowse( aValues, oGet, bInit )
Its similar to a combobox but with all the xbrowse possibilities!!!
MENU:
- Fix to A longstaning bug in Menu system:
Dropdown menus are being painted right aligned on Windows Server 2012. Fixed
SCINTILLA / FIVEDIT:
- Implemented Cursor Width
- Implemented Caret type: block, normal, invisible
- Changes Menus Popup Contextual Editor and margins
- Bug Fixed List Functions HB_FUNC
- Search selected text ( menu contextual )
- Bug Fixed delete item project
- Improvement, change back colors
- Improvement, build project
- Initial implementation add/del/sort libs of FW, Harbour and compiler C
- Create file.BAK old file to save file
- Syntax colors and folding for files .C
- Implementation return to previous position
GENERAL:
* Fix: bar.prg: When buttonbar on a dialog is created from resources and
some buttons have group attribute, the spacing between buttons was being
computed wrongly. Now fixed.
* Enhancement: Function RoundBox() now accepts 10th optional parameter brush
color. (wndboxes.c)
* Improvement: oWnd:SayPalBmp() now accepts alignment parameter as
7th param or 6th element of aRect array
November 2015 (FWH 15.10 released 5 Dec 2015)
=============================================
* Enhancement: TMenuitem, allows use of bmps, pngs, jpgs
Thanks to Manuel Alvarez ( mastintin )
* Enhancement: function ABPaint() now accepts a sixth and seventh parameters to
directly resize the painted image. Thanks to Enrico!
* Enhancement: TXImage: Can now be created from resource.
New data lUseGDI default .t. If set to .f., uses FI
* New function FW_UTF8PADR( cText, nBytes )
* Fix: Errsysw.prg: Function SetErrorFileName(cFile) was not setting the new file
name. Fixed. Thanks Mr Enrico viewtopic.php?f=3&t=31583
* sqlcmd.ch:
Enhancement: SQL INSERT command. Now column names are optional.
New: SQL INSERT INTO <table> [( <colnames> )] ARRAY aData
for Bulk Inserts
* Enhancement: Cuebanners of TGet and TEdit now support Unicode also.
* New functions: StrToWide() and WideToStr(). Appropriately use Ansi/Unicode functionality
* Enhancements Edit control: Additional clauses RIGHT,CENTER,UPPERCASE,NUMBER,UPDATE
* New: TClipBoard new method SetWideText( cTextW )
* Enhancement: Added unicode support for XBrowse ToExcel() method when lExcelCellWise is
set to .T.
* Fix: Excess Release Font in TMsgItem, fixed
* Enhancement: Clausule HEIGHT for MENU - Define Height of Items
Use: MENU oMenu HEIGHT 2 ( default 1.66 )
* New: Function SourceEdit, control editor Scintila in MemoEdit.Prg
Example in Fivedit.prg
* Enhancement: Class TScintilla, added numerous news methods and datas for full
support new FivEdit Editor
Added Unicode characters and files support
* New: Fivedit.prg full code Editor
viewtopic.php?f=6&t=24025&start=450#p184231
See pre- and post messages
* Change Old Fivedit.prg to Fivedit0.prg, now support new Class TScintilla
* Fix: XBrowse.prg: When block of data is copied from Excel sheet and pasted
into xbrowse, run-time error occurs with xHarbour. Fixed in static
function ClipTextAsArray( cText )
* Fix: ComboMetro class: Fixed wrong detection of sort status of the
combobox items.
* RDDADS related workarounds in xbrowse.prg and database.prg:
It is noticed that when OrdSetFocus() is empty, OrdKeyGoTo() errors out
in Harbour version of RDDADS. While the function does not error out
in xHarbour version, the function does not work when OrdSetFocus() is
empty. Suitable workarounds are attempted in xbrowse.prg and database.prg.
* Enhancement: XBrowse: Vertical fonts in cells are now painted as expected.
* Enhancement: oWnd:SayText(...) can now paint multi-line text also with
vertical fonts.