Re: Are Highlight buttons unsupported?

Subject :Re: Are Highlight buttons unsupported?
From :John DeSoi
Date :Tuesday, April 29, 2014 at 7:08 PM
Link :https://kb.4d.com/resources/inug?msgid=GmailId145b02d07486aa50


On Apr 29, 2014, at 8:26 AM, Keisuke Miyako wrote:



> So to summarize,

> highlight by inverting colours is deprecated,

>

> semi-transparency requires a modern Windows system,

> and the current highlight button depends on semi-transparency for its

> visual effect.

>

> the alternative is a 3D button with active/inactive/hover/focus states.



The situation is the same for all those who lost toolbar buttons when 4D removed the runtime toolbar in v14. Replacing that feature with something else involves the task of creating three additional image states for each button.



Not wanting to do this by hand for a lot of images, the code fragment below shows how to automate it using 4D. To make it work like the previous toolbar, you need two extra images to combine with the icons: a thin rectangle for the hover and a filled rectangle for the clicked state. Of course, these should be the same size as the button images you are converting.



John DeSoi, Ph.D.







CLONGINT($iFile)

CTEXT($artPath;$srcPath;$destpath;$file)

CPICTURE($original;$clicked;$hover;$disabled) //4 state icons

CPICTURE($focus;$fill) //For making hover and clicked.





$artPath:="art:"

$srcPath:=$artPath+"toolbar icons:"

ARRAY TEXT($aFile;0)

DOCUMENT LIST($srcPath;$aFile)



$destpath:=Get 4D folder(Current Resources folder)+"icons:"



$artPath:=$artPath+"build button icons:"

READ PICTURE FILE($artPath+"focus24.png";$focus) //1 pixel frame

READ PICTURE FILE($artPath+"fill24.png";$fill) //filled box



For ($iFile;1;Size of array($aFile))

$file:=$aFile{$iFile}

If ($file="@.png")

READ PICTURE FILE($srcPath+$file;$original)



$clicked:=$original //1 - Original starting image (active button)

$hover:=$original

$disabled:=$original



COMBINE PICTURES($clicked;$fill;Superimposition;$clicked)

COMBINE PICTURES($original;$original;Vertical concatenation;$clicked) //2 - Mouse down



COMBINE PICTURES($hover;$hover;Superimposition;$focus)

COMBINE PICTURES($original;$original;Vertical concatenation;$hover) //3 - Mouse hover



TRANSFORM PICTURE($disabled;Fade to grey scale)

COMBINE PICTURES($original;$original;Vertical concatenation;$disabled) //4 - Disabled or inactive.



WRITE PICTURE FILE($destpath+$file;$original)



End if

End for







**********************************************************************

See how easy it is to extend your 4D solutions to Web and mobile. New opportunities await you with 4D v14!



4D Internet Users Group (4D iNUG)

FAQ: http://lists.4d.com/faqnug.html

Archive: http://lists.4d.com/archives.html

Options: https://lists.4d.com/mailman/options/4d_tech

Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx

**********************************************************************

Subject :Re: Are Highlight buttons unsupported?
From :Keisuke Miyako
Date :Tuesday, April 29, 2014 at 7:26 AM
Link :https://kb.4d.com/resources/inug?msgid=GmailId145adaa4bf9cb012
Hello,



I think I posted the same information before,

but my understanding is that the source is a demo DB called "4D Objects"

which can be downloaded from resources:



http://www.4d.com/support/resources.html



direct link:



ftp://ftp.4d.com/SAMPLE_DATABASES/4D/4D_v13/demo_dbs/4DObjects.zip



if you launch the DB and move to page 9,



you see the footnote,



"This type of button is obsolete and should not be used anymore"



for Highlight buttons.



*



From here is speculation.



As explained in the documentation, highlight buttons are



"designed to be placed on top of graphic objects. Highlight buttons are

transparent. When the user clicks a highlight button, the graphics of the

button are highlighted."



http://doc.4d.com/4D-Design-Reference-13.4/Working-with-active-objects/Butt

ons.300-1226554.en.html



I think the concept of "highlighting the graphics underneath" is the basis

of regarding the object as obsolete.



Highlight buttons used to invoke the old MacOS highlight where colours

were inverted,

but that convention is obviously out-of-date.



Since 2004, 4D implements "system highlight" throughout the application,

but the old invert effect was still used for listforms with the "system

hightlight" property unchecked,

or form objects with a non-system "platform interface" (removed in v13).



The old invert effect can cause redraw issues,

so it is recommended to activate "system highlight" on all listforms,

and apply the "system" platform interface if using v12 or earlier.



My understanding is that highlight buttons now work by appliing a

semi-translucent system highlight colour,

on Windows v13, as opposed to inverting the background image,

so in that sense, they should still be functional in v13 on Windows.



But,

transparency is not available in the GDI+ API of Windows,

which may explain why you see “black" in some cases.



(v13 defaults to GDI+ if the more modern Direct2D API is unavailable or

disabled by SET DATABASE PARAMETER)



I suspect the same might happen on Windows 7+, if the "classic" desktop

theme was used.



On Windows the user can selecta a deskop theme, but the "classic" is a

special theme,

which is actually not a theme but a switch to activate the legacy API.



Some users may think the "classic" theme is less demanding for the

computer,

or may simply prefer it for its design,

but actually the effect might be quite the contrary for that reason.



So to summarize,

highlight by inverting colours is deprecated,



semi-transparency requires a modern Windows system,

and the current highlight button depends on semi-transparency for its

visual effect.



the alternative is a 3D button with active/inactive/hover/focus states.



miyako



On 2014/04/27 10:16, "Keith Goebel" wrote:



>1) Are highlight buttons unsupported and, if so, from which 4D version?

>(there is no mention of this in the v13.4 Design Ref manual)











**********************************************************************

See how easy it is to extend your 4D solutions to Web and mobile. New opportunities await you with 4D v14!



4D Internet Users Group (4D iNUG)

FAQ: http://lists.4d.com/faqnug.html

Archive: http://lists.4d.com/archives.html

Options: https://lists.4d.com/mailman/options/4d_tech

Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx

**********************************************************************