New FTDN January/Enero 2016 (FWH 16.01)

New FTDN January/Enero 2016 (FWH 16.01)

Postby Antonio Linares » Sun Jan 24, 2016 8:42 am

January 2016
=============

* XBrowse:

- Fix: Bug introduced in 15.11: Character '&' in the text is painted
as underscore. Fixed

- Fix: SetBackGround() method was resutlting in non-release of brush in
some cases. Fixed

- Enhancement: When EDIT_LISTBOX is invoked by touch, the items are
suitably spaced for touch selection.

- Enhancement: XBrowse now full uses GDI+ calls only for both reading
and rendering all types of bitmaps and images. This improves quality of
image rendering.

- Calling oBrw:Refresh() or any method which in turn calls the refresh
method (eg. oCol:Hide(), etc ) before oBrw:Adjust() method is executed
internally, results in unexpected behavior. Modified Refresh() method
to check if already Adjust() method is executed or not.

* Fix: tmsgitem class: Font leak is fixed.

* Fix: Separator menuitem fixed - non selected with keyboard separator items

* Menus.ch

MRU menus:

- New: Show number item with symbol "&" in left panel menus MRU with clausule

[ <lNoNumber: NONUMBER> ] ;

- New: clausule MRU menus: [ HSYSBITMAP <hBmp> ] ;

* Menu: Fixed Redraw menu list of windows mdichild

* MenuItem: Fixed calculate Height items with images

* Enhancement: items Separators

- MENUITEM SEPARATOR FILE "..\bitmaps\menu4.bmp" ( Images )

- MENUITEM "* SEPARATOR" + CRLF + "- Linea 2 " SEPARATOR ( Text )

- MENUITEM "&PPPPPPPP" SEPARATOR FILE "..\bitmaps\yellow.bmp" ( Text & Image )

* Enhancement: modified .\samples\Menu0002.prg with new features

* XImage: Use GDI+ entirely for reading and rendering all images thereby
improving quality. Improved touch response for PAN, ZOOM and ROTATE.

* Enhancement: function cWinVersion() includes 64 or 32 bits detection, thanks
to João Santos

viewtopic.php?p=185645#p185645

* Implementation style 2013 and 2015 Button Bar

- News Datas l2013 and l2015

- TGet Unicode: Up and down arrow keys were not exiting the Get of Unicode
character variable. Now it is ok

- New: Implementation clausule NOBORDER in class TOutlook2003 and TOutlook2010
* New translate ARGB( nAlpha, nRed, nGreen, nBlue ) --> ARGB color constant
Note: RGB format 0x00BBGGRR
ARGB format 0xAARRGGBB

* New function nARGB(...) --> nARGB constant. Syntax:
1. nARGB( nAlpha, nRed, nGreen, nBlue )
2. nARGB( nAlpha, nRGBcolor )
3. nARGB( nRGBcolor ) // Assumes nAlpha as 255

* Implementation of GDI+
At present, BMPs and ICO (files and resources) are read by classic
GDI functions. Other filetypes are read using GDI+. Any file types that
can not be handled by GDI+ are read using FreeImage.dll if available.
After reading, the bitmaps are stored as GDI Bitmap handles and
rendered using classic GDI functions,

Now at the option of the programmer, some controls can read all
images (which can be handled by GDI+) using GDI+, stored as GDI+
Bitmap Objects and rendered using GDI+ methods.

Filetypes covered by GDI+
BMP,GIF,PNG,JPG,TIFF,EMF,WMF,ICO

At present, specifying the optional clause GDI/GDIPLUS while
creating BTNBMP, BUTTONBMP makes them use GDI+ completely.
Specifying this clause for BUTTONBAR enables all buttons
of the Bar to use GDI+

TXImage and XBrowse use GDI+ entirely.

* New: Color Remapping:
It is possible to substitute one color with another color while
rendering images with BtnBmp and ButtonBmp, if GDIP is enabled.
Colormap specification is in the form of an array:

aColorMap := { { nOldColor1, nNewColor1 }, ;
....
{ nOldColorN, nNewColorN } }
Usage:
oBtn:bColorMap := { |oBtn| If( <cond>, aColorMap1, aColorMap2 ) }
This makes it possible to use a single bitmap to appear with
different colors for example when mouse is over or when disabled, etc.

Note: This is useful only where the bitmap uses solid colors.

* TXImage enhanced:

- Can now handle the following filetypes:
BMP,GIF,PNG,JPG,TIFF using GDI+
ICO using GDI
EMF,WMF reading and rendering as Meta
DOCX,XLSX,PPTX (If saved with thumbnails, read and display thumbnails)

- Touch implementation for PAN/ZOOM/ROTATE

- PAN: Images can be easily moved/panned either with finger or
with mouse drag. (scrollbars not implemented)

- ZOOM/UNZOOM: Respond to Zoom and Pinch gestures. With mouse, wheel can
be used for zooming and unzooming.

- Zooming is implemented around the point of interest. Present mouse position
or center of fingers is treated as point of interest and the image is zoomed
around this point.

- ROTATION: Image can be rotated with Touch Rotate gesture. It is also
possible to rotate with Shift-Mouse wheel

* Drawing SHAPES:

- Drawing of any complex shapes consisting of lines, arcs, curves, etc is
made easy. It is also possible to create alpha bitmaps of any size using
such shapes specified in the form of arrays.

- New Method: oWnd:DrawShapes( aShapes, [aRect] )
This method can be used for any window/dialog/control as a part of
ON PAINT (bPainted)

- New Function: FW_DrawShapes( hDC, aShapes, aRect )
For use with non-window Devices, eg. printers

- New Function: FW_CreateBitmap( { nWidth, nHeight, aShapes }. [lGDIP] )
--> hBitmap (if lGDIP is .F. ) or GDI+ Image Ptr if lGDIP is true

- aShapes array: This array is a collection of one or more aShape arrays.

- aShape: This array specifies one drawing component in the following format:

{ cShape, // Line, Curve, etc. Character String. First letter is only significant.
nColor, // RGB or ARGB color to be used for Pen or Brush
nPenSize, // Size of pen where pen is used. 0 indicates brush for solid shape
nRefWidth, nRefHeight, // All measurements in subsequent elements are with
// with reference to these dimensions.
// At the time of final rendering the measurements
// are proportionately scaled to the destination
// dimentions.
nRow1, nCol1, ... nRowN, nColN, [lSpec]
}

nRow1, nCol1, etc indicate diffeent points used for the drawing. These
measurements are relative to the nRefWidth and nRefHeight.

- Implemented Shapes:

Line(s) { 'L', nClr, nPenSize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRowN, nColN }
Poligon { 'L', nClr, nPenSize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRowN, nColN, lClose }
Specify nPenSize = 0 for Filled Polygon
Rectangle { 'R', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight }
Ellipse { 'E', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight }
Curve { 'C', nClr, nPensize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRowN, nColN, nTension }
Bezier { 'C', nClr, nPensize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRow4, nCol4 }
Arc { 'A', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight, nAngle, nSweep }
Pie { 'P', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight, nAngle, nSweep }

Very simple example:
function BtnShapes()

local oDlg, oBtn, aArrowLeft

DEFINE DIALOG oDlg TRUEPIXEL

aArrowLeft := { ;
{ 'Lines', CLR_HBLUE, 0, 64, 64, 32, 4, 4, 48, 60, 48 }, ;
{ 'Lines', CLR_BLACK, 2, 64, 64, 32, 4, 4, 48, 60, 48, .t. } ;
}

@ 20,40 BTNBMP oBtn PROMPT "Left" SIZE 64, 96 PIXEL OF oDlg ;
RESOURCE { 48, 48, aArrowLeft } TOP GDIPLUS
oBtn:bColorMap := { |o| If( o:lMOver, {{ CLR_HBLUE, CLR_HRED}}, nil ) }

ACTIVATE DIALOG oDlg CENTERED

return nil

* adofuncs.prg: In function FW_ValToSQL() double quotes were not
escaped. Now done.

* BUTTONBMP enhancements:

- Accepts any image or any size like BtnBmp. Larger images are scaled to fit
the dimensions of the button.

- Color-remapping is possible if created with GDIP clause.

- At present, clauses TEXTTOP, TEXTLEFT, TEXTBOTTOM, TEXTRIGHT are used to
specify relative positioning of bitmaps and text. The meaning of these
clauses indicate that the text is moved to TOP,LEFT, etc. But actually
this is not done. Prompts are always centered verticaly and hotizontally.
Only the bitmaps are positioned on the opposite side. On the otherside of
the bitmap equal amount of blank space is wasted. This is in contrast to
BTNBMP. To maintain backward comatibilty, this behavior is retained and
and alternative syntax is provided.

- Additional/Alternate syntax identical to BTNBMP is provided. TOP,LEFT,BOTTOM.
RIGHT. This syntax aligns bitmaps and prompts in the opposite sides of the
button in the same manner as BtnBmp.

- Prompts without bitmaps adn bitmaps without prompts are always centered.
This is backward compatible as well as expected behavior.

- New prompts with embedded CRLFs are painted in multi-line.

- New FLAT style paints the buttons in flat style

* BTNBMP

- New Method: SetImages( [img1], [img2], [img3], [img4] )
To change one or more of the bitmaps.
Eg: oBtn:SetImages( nil, nil, nil, cResName ) replaces the 4th bitmap
only and does not disturb other bitmaps. Img can be any image filename,
resource, hbitmap, etc. Direct modification of oBtn:hBitmap? may be
avoided.

- Enhanced Method FreeBitmaps(...). Calling the method without parameters
releases all bitmaps as previously. Now we can specify which bitmaps are to
be released. Eg. oBtn:FreeBitmaps( 2, 4 ) --> releases bitmaps 2 and 4 only.

* New function DrawIconEx( hDC, nRow, nCol, hDC, nWidth, nHeight, hBrush )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: New FTDN January/Enero 2016 (FWH 16.01)

Postby cnavarro » Sun Jan 24, 2016 11:31 am

* Enhancement: items Separators

- MENUITEM SEPARATOR FILE "..\bitmaps\menu4.bmp" ( Images )

- MENUITEM "* SEPARATOR" + CRLF + "- Linea 2 " SEPARATOR ( Text )

- MENUITEM "&PPPPPPPP" SEPARATOR FILE "..\bitmaps\yellow.bmp" ( Text & Image )

And

- MENUITEM SEPARATOR RESOURCE "menu4"
Last edited by cnavarro on Sun Jan 24, 2016 8:55 pm, edited 1 time in total.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6498
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: New FTDN January/Enero 2016 (FWH 16.01)

Postby joseluisysturiz » Sun Jan 24, 2016 7:30 pm

cnavarro wrote:And

* Enhancement: items Separators

- MENUITEM SEPARATOR RESOURCE "menu4"

Es lo que le faltaba a los menu, gracias Navarro por tomar en cuenta mi sugerencia, esperemos les guste a los demas usuarios, he visto en FWEdit y esta super...gracias, saludos... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: New FTDN January/Enero 2016 (FWH 16.01)

Postby Antonio Linares » Fri Jan 29, 2016 8:48 am

A new FWH 16.01 build 2 has just been published:

February 2016
=========

* Fix: Say.prg: Say with picture clause created on dialog is not
displayed correctly, since FWH15.09. Fixed.
Similary Say with picture clause is not displayed correctly if
oSay:VarPut() is used. Fixed.

January 2016
=============

* XBrowse:

- Fix: Bug introduced in 15.11: Character '&' in the text is painted
as underscore. Fixed

- Fix: SetBackGround() method was resutlting in non-release of brush in
some cases. Fixed

- Enhancement: When EDIT_LISTBOX is invoked by touch, the items are
suitably spaced for touch selection.

- Enhancement: XBrowse now full uses GDI+ calls only for both reading
and rendering all types of bitmaps and images. This improves quality of
image rendering.

- Calling oBrw:Refresh() or any method which in turn calls the refresh
method (eg. oCol:Hide(), etc ) before oBrw:Adjust() method is executed
internally, results in unexpected behavior. Modified Refresh() method
to check if already Adjust() method is executed or not.

* Fix: tmsgitem class: Font leak is fixed.

* Fix: Separator menuitem fixed - non selected with keyboard separator items

* Menus.ch

MRU menus:

- New: Show number item with symbol "&" in left panel menus MRU with clausule

[ <lNoNumber: NONUMBER> ] ;

- New: clausule MRU menus: [ HSYSBITMAP <hBmp> ] ;

* Menu: Fixed Redraw menu list of windows mdichild

* MenuItem: Fixed calculate Height items with images

* Enhancement: items Separators

- MENUITEM SEPARATOR FILE "..\bitmaps\menu4.bmp" ( Images )

- MENUITEM "* SEPARATOR" + CRLF + "- Linea 2 " SEPARATOR ( Text )

- MENUITEM "&PPPPPPPP" SEPARATOR FILE "..\bitmaps\yellow.bmp" ( Text & Image )

* Enhancement: modified .\samples\Menu0002.prg with new features

* XImage: Use GDI+ entirely for reading and rendering all images thereby
improving quality. Improved touch response for PAN, ZOOM and ROTATE.

* Enhancement: function cWinVersion() includes 64 or 32 bits detection, thanks
to João Santos

viewtopic.php?p=185645#p185645

* Implementation style 2013 and 2015 Button Bar

- News Datas l2013 and l2015

- TGet Unicode: Up and down arrow keys were not exiting the Get of Unicode
character variable. Now it is ok

- New: Implementation clausule NOBORDER in class TOutlook2003 and TOutlook2010
* New translate ARGB( nAlpha, nRed, nGreen, nBlue ) --> ARGB color constant
Note: RGB format 0x00BBGGRR
ARGB format 0xAARRGGBB

* New function nARGB(...) --> nARGB constant. Syntax:
1. nARGB( nAlpha, nRed, nGreen, nBlue )
2. nARGB( nAlpha, nRGBcolor )
3. nARGB( nRGBcolor ) // Assumes nAlpha as 255

* Implementation of GDI+
At present, BMPs and ICO (files and resources) are read by classic
GDI functions. Other filetypes are read using GDI+. Any file types that
can not be handled by GDI+ are read using FreeImage.dll if available.
After reading, the bitmaps are stored as GDI Bitmap handles and
rendered using classic GDI functions,

Now at the option of the programmer, some controls can read all
images (which can be handled by GDI+) using GDI+, stored as GDI+
Bitmap Objects and rendered using GDI+ methods.

Filetypes covered by GDI+
BMP,GIF,PNG,JPG,TIFF,EMF,WMF,ICO

At present, specifying the optional clause GDI/GDIPLUS while
creating BTNBMP, BUTTONBMP makes them use GDI+ completely.
Specifying this clause for BUTTONBAR enables all buttons
of the Bar to use GDI+

TXImage and XBrowse use GDI+ entirely.

* New: Color Remapping:
It is possible to substitute one color with another color while
rendering images with BtnBmp and ButtonBmp, if GDIP is enabled.
Colormap specification is in the form of an array:

aColorMap := { { nOldColor1, nNewColor1 }, ;
....
{ nOldColorN, nNewColorN } }
Usage:
oBtn:bColorMap := { |oBtn| If( <cond>, aColorMap1, aColorMap2 ) }
This makes it possible to use a single bitmap to appear with
different colors for example when mouse is over or when disabled, etc.

Note: This is useful only where the bitmap uses solid colors.

* TXImage enhanced:

- Can now handle the following filetypes:
BMP,GIF,PNG,JPG,TIFF using GDI+
ICO using GDI
EMF,WMF reading and rendering as Meta
DOCX,XLSX,PPTX (If saved with thumbnails, read and display thumbnails)

- Touch implementation for PAN/ZOOM/ROTATE

- PAN: Images can be easily moved/panned either with finger or
with mouse drag. (scrollbars not implemented)

- ZOOM/UNZOOM: Respond to Zoom and Pinch gestures. With mouse, wheel can
be used for zooming and unzooming.

- Zooming is implemented around the point of interest. Present mouse position
or center of fingers is treated as point of interest and the image is zoomed
around this point.

- ROTATION: Image can be rotated with Touch Rotate gesture. It is also
possible to rotate with Shift-Mouse wheel

* Drawing SHAPES:

- Drawing of any complex shapes consisting of lines, arcs, curves, etc is
made easy. It is also possible to create alpha bitmaps of any size using
such shapes specified in the form of arrays.

- New Method: oWnd:DrawShapes( aShapes, [aRect] )
This method can be used for any window/dialog/control as a part of
ON PAINT (bPainted)

- New Function: FW_DrawShapes( hDC, aShapes, aRect )
For use with non-window Devices, eg. printers

- New Function: FW_CreateBitmap( { nWidth, nHeight, aShapes }. [lGDIP] )
--> hBitmap (if lGDIP is .F. ) or GDI+ Image Ptr if lGDIP is true

- aShapes array: This array is a collection of one or more aShape arrays.

- aShape: This array specifies one drawing component in the following format:

{ cShape, // Line, Curve, etc. Character String. First letter is only significant.
nColor, // RGB or ARGB color to be used for Pen or Brush
nPenSize, // Size of pen where pen is used. 0 indicates brush for solid shape
nRefWidth, nRefHeight, // All measurements in subsequent elements are with
// with reference to these dimensions.
// At the time of final rendering the measurements
// are proportionately scaled to the destination
// dimentions.
nRow1, nCol1, ... nRowN, nColN, [lSpec]
}

nRow1, nCol1, etc indicate diffeent points used for the drawing. These
measurements are relative to the nRefWidth and nRefHeight.

- Implemented Shapes:

Line(s) { 'L', nClr, nPenSize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRowN, nColN }
Poligon { 'L', nClr, nPenSize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRowN, nColN, lClose }
Specify nPenSize = 0 for Filled Polygon
Rectangle { 'R', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight }
Ellipse { 'E', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight }
Curve { 'C', nClr, nPensize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRowN, nColN, nTension }
Bezier { 'C', nClr, nPensize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRow4, nCol4 }
Arc { 'A', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight, nAngle, nSweep }
Pie { 'P', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight, nAngle, nSweep }

Very simple example:
function BtnShapes()

local oDlg, oBtn, aArrowLeft

DEFINE DIALOG oDlg TRUEPIXEL

aArrowLeft := { ;
{ 'Lines', CLR_HBLUE, 0, 64, 64, 32, 4, 4, 48, 60, 48 }, ;
{ 'Lines', CLR_BLACK, 2, 64, 64, 32, 4, 4, 48, 60, 48, .t. } ;
}

@ 20,40 BTNBMP oBtn PROMPT "Left" SIZE 64, 96 PIXEL OF oDlg ;
RESOURCE { 48, 48, aArrowLeft } TOP GDIPLUS
oBtn:bColorMap := { |o| If( o:lMOver, {{ CLR_HBLUE, CLR_HRED}}, nil ) }

ACTIVATE DIALOG oDlg CENTERED

return nil

* adofuncs.prg: In function FW_ValToSQL() double quotes were not
escaped. Now done.

* BUTTONBMP enhancements:

- Accepts any image or any size like BtnBmp. Larger images are scaled to fit
the dimensions of the button.

- Color-remapping is possible if created with GDIP clause.

- At present, clauses TEXTTOP, TEXTLEFT, TEXTBOTTOM, TEXTRIGHT are used to
specify relative positioning of bitmaps and text. The meaning of these
clauses indicate that the text is moved to TOP,LEFT, etc. But actually
this is not done. Prompts are always centered verticaly and hotizontally.
Only the bitmaps are positioned on the opposite side. On the otherside of
the bitmap equal amount of blank space is wasted. This is in contrast to
BTNBMP. To maintain backward comatibilty, this behavior is retained and
and alternative syntax is provided.

- Additional/Alternate syntax identical to BTNBMP is provided. TOP,LEFT,BOTTOM.
RIGHT. This syntax aligns bitmaps and prompts in the opposite sides of the
button in the same manner as BtnBmp.

- Prompts without bitmaps adn bitmaps without prompts are always centered.
This is backward compatible as well as expected behavior.

- New prompts with embedded CRLFs are painted in multi-line.

- New FLAT style paints the buttons in flat style

* BTNBMP

- New Method: SetImages( [img1], [img2], [img3], [img4] )
To change one or more of the bitmaps.
Eg: oBtn:SetImages( nil, nil, nil, cResName ) replaces the 4th bitmap
only and does not disturb other bitmaps. Img can be any image filename,
resource, hbitmap, etc. Direct modification of oBtn:hBitmap? may be
avoided.

- Enhanced Method FreeBitmaps(...). Calling the method without parameters
releases all bitmaps as previously. Now we can specify which bitmaps are to
be released. Eg. oBtn:FreeBitmaps( 2, 4 ) --> releases bitmaps 2 and 4 only.

* New function DrawIconEx( hDC, nRow, nCol, hDC, nWidth, nHeight, hBrush )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to WhatsNew / Novedades

Who is online

Users browsing this forum: No registered users and 3 guests

cron